Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: PATCH: AI cleanup Version 2
Home

[Freeciv-Dev] Re: PATCH: AI cleanup Version 2

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx, Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH: AI cleanup Version 2
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 27 Nov 2001 12:02:19 +0000 (GMT)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> On Mon, Nov 26, 2001 at 11:15:41PM -0800, Raahul Kumar wrote:
> > 
> > --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > > On Mon, Nov 26, 2001 at 07:06:09PM +0000, Gregory Berkolaiko wrote:
> > > > I looked at your patch.
> > > > 
> > > > It's absolutely fine apart from the comment to unit_move_turns
> > > > You say: "Things like railroad, roads will make the actual move
> > > > cost
> > > > lower than the given estimation. Mountains, swamps will increase
> > > > actual move cost"
> > > 
> > > The sum of the costs has lost some information. Consider this case:
> > > 
> > > unit has a move rate of 3, cost of the path is 5, unit has 2 move
> > > point left
> > > 
> > > path1 costs: first tile=3, second tile=2
> > >   turn 0: points=2, unit has to wait
> > >   turn 1: points=3, unit can move, points=0, has to wait
> > >   turn 2: points=3, unit can move, points=1
> > > 
> > > path2 costs: first tile=2, second tile=3
> > >   turn 0: points=2, unit can move, points=0, has to wait
> > >   turn 1: points=3, unit can move, points=0
> > > 
> > 
> > Point taken. Here's the new patch with suggested improvements thrown
> in. Enjoy.
> 
> +   Returns the minimal amount of turns required to reach the given
> +   destination position. The actual turn at which the unit will
> 
> +   reach the given point depends on the movement points it has
> remaining.
> 
> reach the given point depends on the movement points it has remaining
> and the distribution of the total costs.
> 
> +   For example: Unit has a move rate of 3, path cost is 5, unit has 2
> +   move points left
> +   path1 costs: first tile = 3, second tile = 2
> 
> I want to point out that the goto agent has made this right. E.g. it
> has simulated each turn and hasn't just added all the costs.

I want to point out that the nature of movement is probabilistic so I am
very surprised at your ability to simulate each turn.

Also, it seems that Raimar misread my email.  I did not contest the fact
that the result is an estimation.  But the comment:
"Things like railroad, roads will make the actual move cost
lower than the given estimation. Mountains, swamps will increase
actual move cost"
is misleading because it gives the impression that movement handicap of
mountains has not been taken into account at all.  It has been, in an
approximation.  Raimar's example is a better explanation of the nature of
the estimation but is still misleading in, e.g.
"turn 0: points=2, unit has to wait" part.
In actual fact the unit will move with probability 2/3.

Finally, while I think that Raimar's example fits more into the comment
on warmap generation, mentioning that "unit_move_turns requires ready
warmap" is crucial.  Somebody might want to use the function without
reading it carefully through.

Best,
G.


__________________________________________________
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]