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: Wed, 11 Jul 2001 16:13:01 -0700 (PDT)

On Thu, 12 Jul 2001, Gregory Berkolaiko wrote:
> Question:
> Has anyone actually had a go at 
> "91 - Create a function that gives a statistically excact value for a units
>  92   chance of winning a battle." ??
> Just didn't want to reinvent things...

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.

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

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.



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