Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: auto settlers rework
Home

[Freeciv-Dev] Re: auto settlers rework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: auto settlers rework
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Thu, 24 Jan 2002 19:22:07 +0000 (GMT)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Thu, Jan 24, 2002 at 05:20:26PM +0000, Gregory Berkolaiko wrote:
> >  --- Jason Short <vze2zq63@xxxxxxxxxxx> wrote: 
> > > Raimar Falke wrote:
> > > 
> > > > 
> > > > The only way AFAIK is to increase the time horizon of the
> > > > calculation. The current server auto-settler code is based on 24
> > > > turns
> > > > (the famous MORT constant). This means that the action which
> would
> > > > yield the most benefit in the next 24 turns is considered.
> > > > 
> > > > Example:
> > > >  build a rail at the current tile:
> > > >    - time to move to the target: 0 turns
> > > >    - time to create the improvement: 3 turns
> > > >    - benefit per turn: 1 trade
> > > >    - number of effective turns: 24-0-3=21
> > > >    - total benefit: 21*1 trade=21 trades
> > > > 
> > > >  build a mine some distance away:
> > > >    - time to move to the target: 10 turns
> > > >    - time to create the improvement: 10 turns
> > > >    - benefit per turn: 3 shields
> > > >    - number of effective turns: 24-10-10=4
> > > >    - total benefit: 4*3 shield=12 shields
> > > > 
> > > > So the total benefit of the second will increase with a larger
> time
> > > > horizon.
> > 
> > Excuse me, where did you get this formula?  Syela might be a messy
> > programmer, but he usually had better (or at least more complicated)
> > ideas than that.
> 
> I created it by the little I know about the AI (benefit, MORT) and
> some own thinking. It may be (too) easy but at least I understand it
> fully.

It decieved me at least.  I though that you took it from settlers.c

> > Linear value decrease for something that doesn't age is not a good
> > model.
> 
> I don't understand this.

Sorry, I just used fancy words to the point where the initial meaning is
lost :(

In your model, if an improvement takes 24 turns to complete, it's worth
nothing.  Doesn't matter how good it is, it will still cost 0.0 in 24
turns.

In amortization scheme, however, things decay exponentially (q^t, q<1). 
How can it be justified?

Assumtion: Ideal civilization grows exponentially.
It is a good approximation in the real life (for explanations refer to
your credit card terms and conditions).  It is a bit worse for Civ, I
guess, but the powergraph still looked vaguely exponential if your rate
of expansion is healthy.

How can we compare the output of an improvement at times 0 and t?
An absolute measure for the output is how big a part it contributes to 
the GDP.  But we agreed that GDP at time t is equal to GDP at time 0
multiplied by p^t (p>0) where p is your expansion rate.  Therefore if 
your improvement gave out A percent of the GDP at time 0 and the output
of the improvement remained the same then at time t it will correspond to
A/p^t percent of the GDP.  The choice of MORT=24 then corresponds to
approx 4% expansion rate (p=1.04), a rather healthy economy.

This is pretty much handwaving, I admit, and Syela actually used slightly
different formula, 

A(t) = A(0) * sqrt( 1/(p^t-1) )

(you get it from lines 872-874 after some simplification), which I don't
quite understand, but it has roughly the same properties.  Mainly it
doesn't decrease to 0 in finite time.

G.

P.S. I might have just said a lot of crap, feel free to correct me.

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


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