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: Robert Rendell <rob@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 7 Jun 2000 12:29:50 +1000 (EST)

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?

                                                        Have fun,
                                                         Rob R.
                                                          \((/
                                                          ~oo~
                                                          /))\



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