[Freeciv-Dev] Re: MAX_COMBINATIONS?
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, Apr 16, 2003 at 12:24:32PM -0500, Matthew D. Fuller wrote:
> So, I'm running 1.13.0 (can't upgrade for the moment), and I figured it
> was time I bit the bullet and tried to figure out this CMA thing. So, I
> try, I end turn, my client crashes, and I get this:
>
> ---
> 1: Warning: there are currently 98 out of 100 combinations used
> 1: Warning: there are currently 99 out of 100 combinations used
> 1: Warning: there are currently 100 out of 100 combinations used
> 0: No more free combinations left. You may increase MAX_COMBINATIONS or
> report this error to freeciv-dev@xxxxxxxxxxx.
> Current MAX_COMBINATIONS=100
> ---
>
> OK, I found MAX_COMBINATIONS in client/agents/cma_core.c and bumped it up
> to 1000, and it seems to be working.
There will be no negative effects except higher memory usage.
> I'm curious as to what exactly it's combining, though; a glance over
> the code doesn't seem too enlightening. What limit am I hitting
> here?
A combination is a distribution of workers on the city map. For
example say you have a city of size 5 and 15 tiles can be used (the
other 5 are blocked by other cities or by enemy units). So you now
have to distribute these 5 workers onto these 15 tiles. If you do the
maths you get that there are 15*14*13*12*11=360360 combinations. So
why can we cope with 100 (or 1000 in your case)? Because a lot of
these combinations are duplicates (the worker allocation doesn't
matter if two combinations yield the same amount of food, shield and
trade). And another big part of the combinations are clearly worst
than others. We don't have to remember a combination which yields
(food=1, shield=1, trade=1) if we know a combination which yields
(food=1, shield=1, trade=2) with the same amount of workers. So these
360360 combinations get usually folded back into <100
combinations. But you see that the amount of reduction can't be
predicated. This is the reason why I'm interrested in what map did you
use, how big the city was and if you have changed the ruleset or what
server options did you use.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Your mail could not be delivered to the following Address:
VTCMC.VTLPR@xxxxxxxxxxxxx ** Unassigned error message **"
|
|