Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12841) city_luxury_need function
Home

[Freeciv-Dev] Re: (PR#12841) city_luxury_need function

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12841) city_luxury_need function
From: "Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Apr 2005 13:12:30 -0700
Reply-to: bugs@xxxxxxxxxxx

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

On Thu, Apr 21, 2005 at 09:25:12AM -0700, Jason Short wrote:
> I don't see how the "fixed" function will be useful.  Where do you plan
> to use it?

In the CM.  For each #specialists, compute min-luxuries.  Then if we
know we have n specialists, we know we need to produce a certain number
of luxuries (namely, min_{n' >= n} min-luxuries) no matter what; which
implies we need a certain function of lux+trade.  We can check that
against the heuristic.  The calculation isn't trivial devtime-wise but
it's very cheap runtime-wise: at the outset (in start_search),
pcity->size calls to city_luxury_need, and then it's just a constant-time
lookup per internal node.

This would speed up cities that are almost in disorder or that need to
celebrate.  I had this idea ages ago but never got around to
implementing it.

        -- Benoît





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