[Freeciv-Dev] Re: find_the_shortest_path()
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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"
- [Freeciv-Dev] Re: find_the_shortest_path(), (continued)
- [Freeciv-Dev] Re: find_the_shortest_path(), Raimar Falke, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Raahul Kumar, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Raimar Falke, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Reinier Post, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Raimar Falke, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Paul Zastoupil, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Greg Wooledge, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Ross W. Wetmore, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(), Raimar Falke, 2001/09/19
[Freeciv-Dev] Re: find_the_shortest_path(), Gregory Berkolaiko, 2001/09/18
- [Freeciv-Dev] Re: find_the_shortest_path(),
Raimar Falke <=
[Freeciv-Dev] Re: find_the_shortest_path(), Gregory Berkolaiko, 2001/09/18
[Freeciv-Dev] Re: find_the_shortest_path(), Jason Dorje Short, 2001/09/18
|
|