Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] Re: Improved AI govt evaluation
Home

[freeciv-ai] Re: Improved AI govt evaluation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv AI development <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: Improved AI govt evaluation
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 22 Dec 2002 20:02:03 +0000 (GMT)

Oh damn, I attached a wrong file!!!

On Sun, 22 Dec 2002, Gregory Berkolaiko wrote:

> On Sat, 21 Dec 2002, Per I. Mathisen wrote:
> 
> > This patch should improve AI's evaluation of Democracy and Communism, and
> > handling of Democracy. Most importantly, it moves changing taxes _after_
> > changing government. Also adds the possibility of rather detailed view on
> > exactly what you get with the various governments - change #undef ANALYSE
> > to #define ANALYSE to see this data.
> > 
> > Thanks to Pille for comments on the weights used.
> > 
> >   - Per
> 
> 
> Here is the same patch with a slight modification: capped the usefullness 
> of the city by 0 if it has food or shield deficit:
> 
> int ai_eval_calc_city(struct city *pcity, struct ai_data *ai)
> {
>   int i = (pcity->food_surplus * ai->food_priority
>            + pcity->shield_surplus * ai->shield_priority
>            + pcity->luxury_total * ai->luxury_priority
>            + pcity->tax_total * ai->gold_priority
>            + pcity->science_total * ai->science_priority
>            + pcity->ppl_happy[4] * ai->happy_priority
>            - pcity->ppl_unhappy[4] * ai->unhappy_priority
>            - pcity->ppl_angry[4] * ai->angry_priority
>            - pcity->pollution * ai->pollution_priority);
>   
>   if (pcity->food_surplus < 0 || pcity->shield_surplus < 0) {
>     /* The city is unmaintainable, it can't be good */
>     i = MIN(i, 0);
>   }
> 
>   return i;
> }
> 
> I will commit the patch soon unless discontent citizens prevent me from 
> doing so.
> 
> G.
> 

Attachment: govaifix4.diff
Description: Text document


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