Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: find_the_shortest_path()
Home

[Freeciv-Dev] Re: find_the_shortest_path()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: find_the_shortest_path()
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Sep 2001 12:17:13 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Sep 18, 2001 at 11:02:53AM +0100, Gregory Berkolaiko wrote:
> Hi Jason,
> 
> First of all I am glad that somebody other than me is looking at
> gotohand.c  There is a lot to be cleaned up there.  But caution must be
> exercised.
> 
> 
>  --- Jason Dorje Short <jshort@xxxxxxxxxxxxx> wrote: 
> > /*
> > To avoid RR loops (which may cause find_a_direction() to move a unit in
> > cute little cycles forever and ever...), when we have more than one
> > path
> > to a tile and the second one is via RR (move_cost 0), we do NOT mark
> > the
> > extra path.
> > */
> > 
> > However, Dijkstra's algorithm doesn't have this problem since any time
> > the point is encountered a second time and the movement cost is no less
> > it is not considered a second time.  Later on [2] we have:
> 
> AFAI understand find_the_shortest_path maps all possible paths of the
> same length to a destination.

Looking at
> >       } else if (warmap.seacost[x1][y1] == total_cost) {
> >         local_vector[x1][y1] |= 1 << DIR_REVERSE(dir);

I agree.

> For flexibility reasons.

Why? This is needed/used? Besides the basic move cost there are other
measures to choose between paths: distance to enemy and uncovered
terrain comes to mind. Is this flexibility used for this?

> Client-side gotos don't have to be that flexible: they can always
> ask the human for help.

> no, both comments are correct. the algorithm will mark two equivalent
> pahts unless the last step of the second path has movecost 0.

There have to be comments on this.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "SIGDANGER - The System is likely to crash soon"


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