Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149)
Home

[Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Chris Richards <chrisr@xxxxxxxxxxxxxxxx>
Cc: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sun, 23 Dec 2001 19:11:48 +0100

Dear diary, on Sun, Dec 23, 2001 at 06:22:18PM CET, I got a letter, where Chris
Richards <chrisr@xxxxxxxxxxxxxxxx> told me, that...
> It can be further reduced to:
> 
>    cost = (amortized * weight) / (MAX(0, weight - amortized));
> 
> except that you are incurring round-off error from amortized results in cost
> being 1 less (integer-wise) than with the old formula.
> 
> Not knowing how round-off was playing a part in the previous heuristic, I
> can't common on which cost is better.
I disagree here. First, division-by-zero smiles to you from that expression,
and second, (amortized * weight) / (1/64) is same like (amortized * weight) *
64. I wouldn't reduce that to zero then.

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv hacking
.
  "A common mistake that people make, when trying to design
   something completely foolproof is to underestimate the
   ingenuity of complete fools."
     -- Douglas Adams in Mostly Harmless
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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