[Freeciv-Dev] Re: MORT
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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~
/))\
- [Freeciv-Dev] MORT, Thue Janus Kristensen, 2000/06/06
- [Freeciv-Dev] Re: MORT,
Robert Rendell <=
|
|