Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation
Home

[Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 6 Apr 2005 20:34:46 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12734 >

Benoit Hudson wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12734 >
> 
> On Wed, Apr 06, 2005 at 04:13:49PM -0700, Jason Short wrote:
> 
>>We should already change the interface a bit to allow partial
>>placements (placement of one new worker without redistributing 
>>any existing ones).
> 
> 
> I'll code this up.  I think the interface should be to add
>   /* don't rearrange these workers */
>   struct {
>     bool workers[CITY_MAP_SIZE][CITY_MAP_SIZE];
>     int specialists[SP_COUNT];
>   } fixed;
> to the cm_parameter.

Powerful but bulky.  I'd suggest making it a pointer so it may be set to 
NULL to be easily disabled.

I was thinking about what different operations *need* to be supported. 
Currently we have:

* Place one "unplaced" citizen.  This can happen when a city grows or 
when a worker is displaced by an enemy unit.  The current behavior is to 
add the citizen as an elvis and then rerun CM from scratch.  But for 
"unmanaged" cities the human player would rather not have his existing 
workers moved around; the new citizen should just be placed on the 
"best" tile.

For this all we would need is a place_one parameter to the cm_parameter 
(if set then just a single SP_DEFAULT specialist is moved).  (It could 
be named better of course.)  Outside of the CM code we need some support 
as well, since it's possible some minimums can't be met after the 
unplaced citizen is created/displaced.

* Consider shuffling citizens when a new tile becomes available (either 
from another city giving it up or an enemy unit being displaced from 
it).  The current behavior here is also to rerun CM from scratch.  But 
for unmanaged cities this is clearly wrong, and can be very bad (see 
PR#11144).  I think in this case the CM shouldn't be run at all.

Note the AI should rerun its CM every turn anyway so this isn't an issue 
for them, except in the rare case where one of the above events happens 
right before the city's end-of-phase action (as in PR#11144).

-jason





[Prev in Thread] Current Thread [Next in Thread]