Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#
Home

[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx, Petr Baudis <pasky@xxxxxxxxxxx>
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Fri, 22 Feb 2002 17:26:16 +0000 (GMT)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Fri, Feb 22, 2002 at 03:34:10PM +0100, Petr Baudis wrote:
> 
> > +             get_total_attack_power(patt, punit) *
> > +             get_total_attack_power(punit, pdef)
> 
> Can't this test be replaced with win_chance?

Mmmm, I got so carried away with the idea that win_chance takes too much CPU,
that I didn't notice that here it won't be more costly...

If, that is, we modify get_attacker and get_defender slightly to cache the
value of the winchance.  Because all win probabilities were already computed
in there.

Very good idea, Raimar.

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]