Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2002:
[freeciv-ai] Re: README.AI
Home

[freeciv-ai] Re: README.AI

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: Raimar Falke <rf13@xxxxxxxxxxxxxxxxxxxxxx>, <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: README.AI
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Tue, 30 Apr 2002 18:06:54 +0100 (BST)

On Mon, 29 Apr 2002, Raahul Kumar wrote:

> --- Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx> wrote:
> > I really like French spacing but I don't think it's good to edit other 
> > people's typing in this case.  Besides it's not that important.
> 
> Greg, go ahead and edit other people's typing. I don't care.

okay.

> > "now" is in fact "5 years from now".  Or did you mean something else?
> > Added "in":
> > What is better, to receive 10$ annually starting in 5 years from now or
> > 5$ annually starting from this year? 
> 
> Slightly confusing. If all of your investments will pay off in 10 yrs, 
> what do you have in the shorterm? You could go bankrupt waiting for your
> fortune to arrive.

You have to take into account inflation (that's what the whole story is 
about): 5 bucks now might buy you more than 10 bucks in five years time.

> > > > years time 10$ will buy as much as 10*(100/(100+x))^5 $ will buy
> > > > today.  Denoting 100/(100+x) by q we get the general formula, N$ in Y
> > > > years time will be equivalent to N*q^Y in todays money.  If we will
> > > > receive N$ every year starting Y years from now, the total amount
> > > > receivable (in todays money) is 
> > > 
> > > Please drop the $. They make it hard to read.
> > 
> > ok
> 
> Greg, can you do a prettier version using MathML. This calculation looks butt
> ugly. Just post a link to a pretty version.

I can but I don't think it is needed.  People who'd want to read it can 
read it.  It's essentially LaTeX.  And the only non-C notation I use is 
"^" for "to the power".

> > Suppose we have a constant rate of inflation, x percent.  Then in five
> > years time 10$ will buy as much as 10*(100/(100+x))^5 will buy
> > today.  Denoting 100/(100+x) by q we get the general formula, N in Y
> > years time will be equivalent to N*q^Y in todays money.  If we will
> > receive N every year starting Y years from now, the total amount
> > receivable (in todays money) is 
> >            N*q^Y + N*q^{Y+1} + N*q^{Y+2} + ...  
> >            = N*q^Y * (1 + q + q^2 + q^3 + ...)  
> >            = N*q^Y / (1-q)
> 
> Unreadable. Please have a prettier version linked to on the Freeciv website.

I'll try to avoid it altogether...

> > Most likely this explanation is not what the authors of amortize() had
> > in mind, but the basic idea is correct: the value of the payoff decays
> > exponentially with the delay.
> > 
> > The version of amortize used in military code (military_amortize())
> > remains a complete mystery.
> 
> Greg, a bit more detail on what you find inexplicable about military_amortise.

errr.
everything.

> > * struct choice should have a priority indicator in it.  This will
> > reduce the number of "special" want values, thus reducing confusion.
> 
> What the hell is this? If we are going to have priority indicators, what is 
> the
> use of want?????

You calculate your desire for a diplomat and you get 287 as your want.  
How do you fit it into the above mentioned scale (0 -- 100) ?
You can either cut it off (A) or divide by some large number (B).
If you do (B), what is the number you divide by?  Scale of want changes 
considerably through the game duration.
If you do (A), you loose a lot of important info.  After assessing 
diplomats you think about making a battleship and you get 121.  If you 
were able to compare it with 287, you'd know that diplomat is better.  
Unfortunately you cut 287 down to 99, so now you don't really know...

My suggestion is that choice has to contain:
int want;
enum {DEFENCE_CRITICAL, EXPANSION, DEFENCE_ROUTINE} priority;
enum {CT_DEFENDER, CT_ATTACKER, CT_BUILDING, CT_NONMIL} type;
int type_id;

Then you are not risking overwriting a badly needed defender choice with, 
say, Bank which you fansy too.

G.




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