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: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: chance of winning a battle
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Thu, 12 Jul 2001 13:45:49 -0700 (PDT)

On Thu, 12 Jul 2001, Gregory Berkolaiko wrote:
> On Wed, 11 Jul 2001, Trent Piepho wrote:
> 
> true, it is expensive to calculate.  but what is the approximation?

The AI more or less uses power * hit points * firepower.  Lots of what it does
is compare one group of units against another group by summing up their
respective strengths.  What you need to consider is how often does the AI do
the wrong thing because it calculates its chances in battle incorrectly?

> > > 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.

The nice thing about the binomial distribution is that each term can be
calculated from the proceeding one with a few computations.  Does the
approximation share this trait?  Actually, how do you find the parameters for
the hypergeometric function?



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