Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2001:
[Freeciv-Dev] Re: chance of winning a battle
Home

[Freeciv-Dev] Re: chance of winning a battle

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: chance of winning a battle
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxxxx>
Date: Thu, 12 Jul 2001 18:34:13 +0300 (IDT)

On Wed, 11 Jul 2001, Trent Piepho wrote:

> > "91 - Create a function that gives a statistically excact value for a units
> >  92   chance of winning a battle." ??
> 
> I wrote this for freeciv years ago, back when I was the main developer.  I
> decided not to stick it in, because the AI uses this function a lot.  Figuring
> out the exact value is much more expensive than the approximation and makes
> very little difference overall.

true, it is expensive to calculate.  but what is the approximation?

> > 1. "statistically excact value" will involve a nontrivial mathematical
> > function (the so-called hypergeometric function).  should it be put into a
> > different module?  presumably the function itself would go to
> > server/unittools.c
> 
> It's not that hard.  You just sum part of the area under the binomial

yes, but you can reformulate the sum as a hypergeometric function whose
"good" approximation usually contains only half as many terms as the
original sum does.  but the reduction by 2 is not that great and the
implementation is complicated.

> distribution.  If you check the mailing list from a while back, I explained
> the math in great detail to some math challenged people who couldn't figure it
> out.

yes I found it, 
http://arch.freeciv.org/freeciv-dev-200009/msg00411.html
and followups.  What a friendly discussion.
But why the item is still on the TODO list?  It should then be removed or
at least changed to:
"Create a time-efficient function that gives a good approximation for a units
chance of winning a battle."

> If you want something hard, figure out multiple unit battles.  For example, if
> you have three different units which can attack a single enemy unit.  What
> order should they attack in to minimize the expected value of the unit cost
> you will lose.

ok, now thinking about it.




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