[freeciv-ai] Re: (PR#6595) Optimize/reimplement CM
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6595 >
> Actually, if the implementation allows for such a solution, then the
> optimization will be much easier. You could just solve the problem using
> continuous linear programming, and then realize this solution by using
> the food box as a buffer. The only case I can think where this is not
> possible, is if one tile by itself produces more food than the food box
> can contain, since the food box then cannot act as a buffer.
> Of course, this approach blurs the difference between long-term and
> short-term/immediate goals, but if the implementation allows for such
> planning, it will at least result it better use of tiles. It will also
> shorten the shorter execution time needed to find an 'optimal' solution,
> since you don't need to consider integer programming, but instead you
> have to keep a record of the planned tile usage and use time to update
> the city tiles every turn (possibly). I don't know what the net effect
> on execution time would be, but the idea will at least solve the
> potensially very difficult integer programming problem.
I think the implementation would be fairly straightforward. First solve
the LP problem, then take all the remainders and pick a pseudo-random
combination of those tiles based on the turn number. Then do a final
check on the base constraints (mimum food and production surpluses
necessary to avoid unit/population loss).