Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_de
Home

[Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_de

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Petr Baudis <pasky@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_desire() (PR#1279)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 26 Feb 2002 12:09:47 +0000 (GMT)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Mon, Feb 25, 2002 at 06:03:30PM +0000, Gregory Berkolaiko wrote:
> >  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > > On Mon, Feb 25, 2002 at 04:58:07PM +0000, Gregory Berkolaiko wrote:
> > > > Ok, you are in for some trouble, boy.
> > > > 
> > > > First of all, I don't think the desire equation is fully correct.
> > > > 
> > > > To be mathematically sound it has to be of the following form
> > > > 
> > > > Desire = Probability_To_Win * Amount_Won - Probability_To_Lose *
> > > Amount_Lost
> > > > 
> > > > This would estimate your average win from the action (if you perform
> this
> > > > action N times, N is big, you'd be N*Desire better off).
> > > 
> > > Ack.
> > > 
> > > > The probabilities are estimated in this way:
> > > 
> > > > Probability_To_Win = Attack_Rating / (Attack_Rating + Defence_Rating)
> > > > Probability_To_Lose = Defence_Rating / (Attack_Rating +
> Defence_Rating)
> > > 
> > > Side note: I came across these a lot. Should be put into extra
> > > functions.
> > 
> > to return float?
> 
> It turns out that all these three occurrences are nicely handled by
> build_cost_balanced (hint).

I am glad that you found time to commit my patch, but I must warn you that the
similarities you observed have different origin.  ;)

In the equations above Attack_Rating is the attack rating of the attacker and
Defence_Rating is the defence rating of the defender.  Which are two different
units belonging to two different players.

In build_cost_balanced both attack power and defence power come from the same
unit.

G.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


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