Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2000:
[Freeciv-Dev] Re: MORT
Home

[Freeciv-Dev] Re: MORT

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv dev list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: MORT
From: Thue Janus Kristensen <thue@xxxxxxx>
Date: Wed, 7 Jun 2000 14:44:36 +0200

On Wed, 07 Jun 2000, Robert Rendell wrote:
> Thue Janus Kristensen wrote:
> } Well, that subject line must be self-explaining, at least if you judge
> } from the freeciv code where MORT is used but never explained.
> } 
> } Can anyone explain it's meaning/use to me? MORT is used in settlers.c and
> } various places in the AI.
> 
> It's a constant factor used by the amortize function (in server/settlers.c)
> and on values passed to that function.  Reading through amortize(), I've
> finally deciphered what it does (on the 10th attempt)...
> 
> amortize(b, d) returns b * ((MORT - 1)/MORT)^d
> 
> (^ = to the power of)
> 
> Plus, it has tests to prevent the numbers getting too big.  It takes
> advantage of the fact that (23/24)^12 approximately = 3/5 to chug through d
> in chunks of 12, and then does the remaining multiplications of (23/24).
> 
> Having worked this out, I think a comment to that effect above the amortize
> function might save others the joy of trying to decipher this function (my
> brain hurts).
> 
> Now, the question remains: WHY do you want to scale values by (23/24)^d?
> How does that help the AI in scoring various choices?

Well, you still haven't explained what MORT really is...
And what does the amortize function calculate anyway? I mean WHY does it
calculate what it does?
*Thue is too lazy to try to figure out himself*

btw, I think we all agree that that code is absolutely horrible...

-Thue



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