[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]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12734 >
On Wed, 6 Apr 2005, Per I. Mathisen wrote:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12734 >
>
> I was tired of slow AI games, so I decided to handle the root of all evil
> - the city management code. I wrote my own CM from scratch, and stuffed it
> in the bottom of city.c. At approx 300 lines of code, it is not very big.
>
> In a very difficult, very large savegame that I used for reference, CM did
> 26% better in finding optimal solutions according to the scoring test I
> made. The greedy function was, however, 154 times faster.
>
> Yes, you read that right. It really is blazing fast. Playing on huge maps
> with lots and lots of cities under AI control is a rather different
> experience with this patch.
>
> If you want to measure for yourself, change "#if 0" to "#if 1" in
> server/cityturn.c; if you want more comments on the design, see the huge
> function header comment on the greedy function itself.
Nitpicking:
instead of:
+ if (t1 == NULL) {
use:
+ if (!t1) {
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Jason Short, 2005/04/06
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation,
Vasco Alexandre da Silva Costa <=
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Benoit Hudson, 2005/04/06
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Benoit Hudson, 2005/04/06
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Jason Short, 2005/04/06
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Per I. Mathisen, 2005/04/07
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Per I. Mathisen, 2005/04/07
- [Freeciv-Dev] Re: (PR#12734) A new, fast and greedy CM implementation, Per I. Mathisen, 2005/04/10
- [Freeciv-Dev] (PR#12734) calculate city's lux need, Per I. Mathisen, 2005/04/11
- [Freeciv-Dev] (PR#12734) calculate city's lux need, Per I. Mathisen, 2005/04/11
- [Freeciv-Dev] (PR#12734) quick&dirty CM v5, Per I. Mathisen, 2005/04/11
- [Freeciv-Dev] Re: (PR#12734) calculate city's lux need, Benoit Hudson, 2005/04/12
|
|