Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Re: (PR#4089) Estimated incite gain is too high.
Home

[freeciv-ai] Re: (PR#4089) Estimated incite gain is too high.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#4089) Estimated incite gain is too high.
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Wed, 30 Apr 2003 07:48:39 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Wed, 30 Apr 2003, Per I. Mathisen wrote:

> On Wed, 30 Apr 2003, Gregory Berkolaiko wrote:
> > I don't see anything wrong. Yes, the want is a bit high, but it's no
> > fault of PF, the distances are all correct.
> ...
> > The want is high because incite want is high.
> 
> I'll look at pf again, but the incite comment is dead on. Will you commit
> this?

Since we are at it, I thought about other ways of estimating gain.  Here 
are my ideas.

1. Cost to take city by force is (a) hard to estimate and (b) misses the 
point: what if we don't _want_ the city?

2. We should instead ask "will we get our money back in reasonable time?".  
This leads to the question of "reasonable time".  I think we need 
something like "planning horizon" which changes as we approach the 
endyear.  sqrt(turns_to_end) sounds like a good candidate.

3. We should probably consider surpluses rather than gross values.  But we 
don't care for enemy production surplus -- they might have tons of units 
supported that we don't need.  We pretend that we will have only 2 units 
in the city, to defend it.

4. To stop before we go too deep, use

def_upkeep 
  = unit_types[best_role_unit(L_FIRSTBUILD)]->sheild_upkeep;

benefit = food_surplus * FOOD_WEIGHTING
          + (shield_prod - 2*def_upkeep) * SHIELD_WEIGHTING
          + (luxury_total + tax_total + science_total) * TRADE_WEIGHTING;

benefit *= planning_horizon;

benefit -= incite_cost * TRADE_WEIGHTING;

5. To go deeper, we might consider the effects of our 
corruption/waste/government on that city.  But I think that'd be too much.

G.

> Index: ai/aidiplomat.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/ai/aidiplomat.c,v
> retrieving revision 1.17
> diff -u -r1.17 aidiplomat.c
> --- ai/aidiplomat.c     18 Apr 2003 17:51:14 -0000      1.17
> +++ ai/aidiplomat.c     30 Apr 2003 14:17:53 -0000
> @@ -178,7 +180,7 @@
>                         + acity->tax_total
>                         + acity->science_total) * TRADE_WEIGHTING;
>        gain_incite *= SHIELD_WEIGHTING; /* WAG cost to take city otherwise */
> -      gain_incite -= incite_cost;
> +      gain_incite -= incite_cost * TRADE_WEIGHTING;
>      }
>      if (city_owner(acity)->research.techs_researched <
>               pplayer->research.techs_researched
> 
> 
> 
> 




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