November 12th, 2012, 03:09
Posts: 5,636
Threads: 30
Joined: Apr 2009
(November 12th, 2012, 02:02)novice Wrote: Someone could have whipped one city while other cit(ies) grew, could that be throwing you off?
What if you assigned a whip to the wrong city? I.e, they did a 4 to 2 whip instead of 5-3, and someone else grew before a demographics screenhot could be taken in such a way as to hide the error.
November 12th, 2012, 18:57
Posts: 4,090
Threads: 28
Joined: Jul 2008
The only case in which such a change would be population neutral would be that the 5->3 whip happened very late in the turn, and then one size 3 and one size 4 city grew as the turn rolled.
I think I've managed to cover all those, and no such whips has happened on before Univers has gained pop, anyway.
Furthermore, I consider that forum views should be fluid in width
November 12th, 2012, 20:55
(This post was last modified: November 12th, 2012, 20:59 by kjn.)
Posts: 4,090
Threads: 28
Joined: Jul 2008
T65 - 1400BC
Cliff's Notes: My city size tracking is starting to break down with the unassigned pop growths from last turn, but the Spanish grew a city to size 2, and the Germans, and CFC each grew a city, and CivPlayers and CivFr grew 2 cities each. WPC is the clear leader in power with 29000 more than anyone else and probably a newly built Dog soldier. Total rival power rose with 24000. The Germans are the new leaders in land area. CivFr gained an ancient tech in 5t.
Demos:
We, the Spanish, the Germans, and CFC all gain 2 points, CivPlayers gain 5, and CivFr gains a whopping 11. No land points were awarded this thus, so CivFr gained an ancient tech in 5t and 2 pop, CivPlayers gain 2 pop, and everyone else gained 1 pop.
The claimed land area rose with 8000, and the new rival best has 77000. Since CivFr isn't due another expansion yet and we know the German city by the spear expanded borders, I think they are the new rival best. That also assigns some of the unknown tiles from T51 (capital third-ring expansion for several teams) to the Germans.
Total population rose with 109000 over 7 pop, but I still have 84000 unassigned since the previous turn. We'll have to see if I manage to solve this. The fit for the pop-population growth is growth in...
Did anyone finish the "making change" solver for Civ into usable form? I desperately need it! If needed, I can compile it myself (I have the Mac OS X dev tools installed, so can compile any reasonable C or C++ code).
One solution is 2 cities growing to size 5 and 5 growing to size 2. Another is 2 cities growing to 4, 3 to 3, and 2 to 2. However, there are only 4 size 1 cities among the candidates so we get the second solution. Rival worst is 75000, and thus I assign a growth to 2 to the Spanish. But with the Germans and CFC among the mystery pop growths last turn, I'm stuck here.
In power, the most interesting thing is that with our rise to 49000 we are #2, ie the rival best (WPC) is alone up there. Rival best rose with 78000 (a dog), rival worst rose to 34000, and rival total power with 24000, of which 2000 came from pop (CivFr and CivPlayers). That leaves 16000 from tech, buildings, and other units - I think most teams are pushing military now with the first appearance of barbarians.
With lack of anything better to put CivFr's tech in, I pencil in Polytheism.
Buddhism has spread to another city, since its influence rose from 4% to 7%.
Furthermore, I consider that forum views should be fluid in width
November 13th, 2012, 01:05
Posts: 7,548
Threads: 63
Joined: Dec 2005
What is the "making change" solver? It sounds like a way to give all the possibilities for different values of overall population? I had noodled around trying to create something like that but never really put much effort into it. If there is something else out there that tries to do that, I'd love to take a look at it
November 13th, 2012, 01:44
Posts: 4,090
Threads: 28
Joined: Jul 2008
(November 13th, 2012, 01:05)regoarrarr Wrote: What is the "making change" solver? It sounds like a way to give all the possibilities for different values of overall population? I had noodled around trying to create something like that but never really put much effort into it. If there is something else out there that tries to do that, I'd love to take a look at it
Exactly.
See earlier discussion between Waterbat and T-Hawk in this thread.
Furthermore, I consider that forum views should be fluid in width
November 13th, 2012, 02:49
Posts: 13,214
Threads: 25
Joined: Oct 2010
So any C&D news about CivPlayers?
November 13th, 2012, 03:44
Posts: 4,090
Threads: 28
Joined: Jul 2008
(November 13th, 2012, 02:49)NobleHelium Wrote: So any C&D news about CivPlayers?
Nothing from what I can see. Grew 2 pop this turn, but not in their capital.
Furthermore, I consider that forum views should be fluid in width
November 13th, 2012, 04:23
(This post was last modified: November 13th, 2012, 04:28 by kalin.)
Posts: 1,285
Threads: 2
Joined: Jun 2009
I am a linux/python person, so I wrote a python script to do the computation of the population distribution over cities. It can be run as:
python ./making_change.py <population_in_thousands> <number_of_cities>
The output format is:
[ (CitySize1, Pop1), (CitySize2, Pop2), ...]
Example:
Code: python ./making_change.py 124 5
[(5, 90), (3, 21), (2, 6), (2, 6), (1, 1)]
[(4, 48), (4, 48), (3, 21), (2, 6), (1, 1)]
That is, to get 124 population over 5 cites you can have either 5-3-2-2-1 or 4-4-3-2-1.
Code: #!/usr/bin/env python
import sys
coins = [(x,int(x**2.8)) for x in range(1,50)]
MEMOIZE = True
memo = dict()
def make_change(n, m):
if MEMOIZE and ((n,m) in memo):
return(memo[(n,m)])
if (n == 0):
res = [ [] ]
if (MEMOIZE): memo[(n,m)] = res
return(res)
elif ( (n < 0) or (m < 0) ):
return( [] )
else:
res1 = [ [coins[m]] + x for x in make_change(n - coins[m][1], m) ]
res2 = make_change(n, m - 1)
res = res1 + res2
if (MEMOIZE): memo[(n,m)] = res
return(res)
if (__name__ == "__main__"):
try:
pop = int(sys.argv[1])
except:
pop = 124
try:
cities = int(sys.argv[2])
except:
cities = 5
res = make_change( pop, len(coins) - 1 )
for x in res:
if (len(x) == cities):
print x
One can simply copy-paste the code above into a file called making_change.py for example.
@kjn: If you have difficulty running the code, I can run it for you now to get some numbers out quickly, just let me know populations and numbers of cities. I think that on a Mac OS X it should be relatively easy to get python and run the script.
Kalin
November 13th, 2012, 04:59
Posts: 4,090
Threads: 28
Joined: Jul 2008
Thanks Kalin! I have Python (2.6.1) installed on the computer as well, so there should be no issues running your code.
I realised one thing here, the solution space is usually constrained in several ways:
- By earlier solutions, since no city can grow more than 1 per turn (well, there are some edge cases).
- By that we need to hit the rival best and rival worst population numbers.
- By that our ranking should be correct.
So I think the best function would be one that worked on the change per turn: how many ways is it to grow 84000 from a total change of 5 pop diffs? Like the solution spaces I've outlined in my two earlier posts? Am I correct in understanding that I only need to change the size of the coins to make it work that way instead? Ie, the coins would be worth (x^2.8 - (x-1)^2.8)
I've done that manually earlier, but it simply got too tedious to find all the sensible solutions.
Furthermore, I consider that forum views should be fluid in width
November 13th, 2012, 05:39
(This post was last modified: November 13th, 2012, 05:41 by kalin.)
Posts: 1,285
Threads: 2
Joined: Jun 2009
I need to think a bit about how to implement what you just described. I am not sure that changing the coins the way you suggest would work as intended, but feel free to try it may actually work!
EDIT: I think I found a solution that involves changing the coin values, but not the way you mentioned it. I will take a stab at this and report back.
Kalin
|