Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12834) amortize()
Home

[Freeciv-Dev] Re: (PR#12834) amortize()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12834) amortize()
From: "Brian Dunstan" <bdunstan149@xxxxxxxxx>
Date: Mon, 18 Apr 2005 16:25:47 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12834 >


--- Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> <URL:
> http://bugs.freeciv.org/Ticket/Display.html?id=12834
> >
> 
> Brian Dunstan wrote:
> > <URL:
> http://bugs.freeciv.org/Ticket/Display.html?id=12834
> >
> > 
> > I noticed that the amortize() function uses a very
> > clever, but complicated, algorithm.  The reason
> > apparently is to save time.  If that is the
> purpose,
> > why not use a more transparent, but slower
> algorithm,
> > and use it to make a lookup table?  Normal calls
> to
> > amorize could just be reading an element from a
> 20- or
> > 100-element integer array, which would be faster
> than
> > what is there now.
> 
> One coder had the idea that ammortization is based
> on the inflation
> rate, and this inflation rate changes with time.  We
> can calculate the
> inflation rate based on certain factors - gold on
> hand (lower
> inflation), danger/war (raises inflation), etc. 
> Then ammortize should
> use this inflation rate.
> 
> There was a huge patch that completely redesigned
> the AI to do this sort
> of thing - it's in RT somewhere.  For anyone
> interested in working on
> this, I'd suggest ripping out the inflation
> calculation, and then using
> it in ammortize.  We can use it elsewhere later of
> course.
> 
> -jason

So in this situation, part of the end of turn AI
calculations would be to determine the interest rate
using some simple method for now.  A table could be
calculated then, and amortize() would use that table.



Brian


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 





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