Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2002: [freeciv-ai] Re: Approximate win_chance

# [freeciv-ai] Re: Approximate win_chance

[Top] [All Lists]

 To: rf13@xxxxxxxxxxxxxxxxxxxxxx, "Ross W. Wetmore" Cc: Gregory Berkolaiko , Raahul Kumar , freeciv-ai@xxxxxxxxxxx Subject: [freeciv-ai] Re: Approximate win_chance From: Raahul Kumar Date: Wed, 24 Apr 2002 04:08:41 -0700 (PDT)

```<snip>
> I have done some changes and factor (10.0 in the original test.c) is
> indeed important. I have attached another version which shows the
> quality of the approximation for various factors.
>
> It turns out that the power of 5 minimized the error for the factor
> 8. A power of 6 prefers the factor 12. A power of 5.5 really make the
> factor 10 the one with the minimum error.
>
> Bottom line for me: the proposed approximation is much to fragile.

I'm not with you on the logic train. Let's slam the brakes. Greg's
approximation is far better than the current one, which just squares the
results.

It has a much smaller absolute error and and the error occurs fewer times than
the current implementation. That's good enough for inclusion.

I'm certain there was no mathematical modelling done for the current algorithm.
It was obviously picked because it worked. The problems is the current
implementation has a very large absolute error, and it occurs often. Greg
mentioned in his earlier emails all the sordid details. Greg's version would
result in a smarter AI for free. It would be calculating the combat odds more
accurately.

> Bottom line 2: we have to carefully select the set of values we test
> the approximation against. Best would be the whole possible set of
> values. Or a real (not by simulation) mathematical calculation of the
> errors we have to expect.

Not asking for much are you? A formal mathematical proof is over the top. No
doubt Greg can do it, but I feel this is asking too much of contributors. The
whole possible set is very large, I'm not aware of any range limits to hps or
firepower, although attack power seems to be limited to <= 99.

In fact, can I ask you for a formal proof of combat.c? There are a number of
areas in that region of code that concern me:

No apparent range limits to defence power, and attack power seems to be limited
only to 99.

>       Raimar
>

Aloha,
RK.

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

```