Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7249) Auto settlers don't irrigate or mine
Home

[Freeciv-Dev] (PR#7249) Auto settlers don't irrigate or mine

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7249) Auto settlers don't irrigate or mine
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Sat, 31 Jan 2004 02:51:59 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7249 >

I've been thinking about the consider_settler_action() function on and
off for a while now, and I think the problem is that the value it
returns has to be over food_upkeep * FOOD_WEIGHTING.(19 under monarchy,
38 under gov't above monarchy) for the auto settler to begin an
improvement.  Presently it's returning very low values, like 5 or 9, IIRC.

The amortize() function it calls is a little misnamed, I would have
called it a discount() function.  It works under the theory that money
(food, shields, gold, whatever) that we spend now is worth more than if
we spend that same amount of money later.  So if we get a reward in the
future, it is worth less to us in "today" money.

I don't think consider_settler_action() is discounting the return value
of improving the tile properly.  When the tile is improved, the increase
in value will be paid every turn thereafter, not as a lump sum.  If we
assume this is an infinite number of turns, then we simply divide the
lump sum discounted value by 1-d, where d is the discounting factor. 
(I'm not completely sure of my math on this :)

The code in consider_settler_action() actually does say something close
to this, it says ((a * b) / (MAX(1, b - a))).  By fiddling with the
numbers a bit, I find that if that MAX were removed, it would be
dividing by (1/d)-1.  I'm still not sure what exactly this factor is,
though.

-James Canete



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