Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4137) Auto-Explore with new path-finding
Home

[Freeciv-Dev] Re: (PR#4137) Auto-Explore with new path-finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: cameron@xxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4137) Auto-Explore with new path-finding
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Sat, 3 May 2003 08:27:19 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, May 03, 2003 at 05:39:15AM -0700, Cameron Morland wrote:
> 
> Hi,
> 
> This patch merges parts 1 and 2 of the explorer code into one. Note that
> this does change the behaviour of the explorer somewhat, since slightly
> distant highly-desirable tiles are preferred over adjacent tiles (which
> were always preferred before). I also fiddled with the desirability
> definitions so they make more sense.
> 
> The code works by searching out from the current location using
> simple_unit_path_iterator (where the path length is be non-decreasing,
> as I understand it). It then keeps track of the greatest possible
> desirability score at each given location (which is non-increasing). As
> soon as the best score found so far exceeds the best possible score at
> the given range, or we run out of tiles, we can be certain that the best
> tile found is in fact the best tile available, so we break.
> 
> Note that all movement takes place using gotos; this has the desirable
> effect of making use of rivers.
> 
> I'm going to be away for the next week or so (biking from Waterloo to
> Ottawa), but here it is for your consideration. It reduces the size of
> the code by 62 lines.

Good to see this code. You decide only based on the end position. But
you can also do it based on the path. So for example you may want that
if two paths reach a certain point with the same move-cost you want
the path which discover more tiles along the path. To do this you need
to use get_EC.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Many of my assistants were fans of Tolkien, who wrote 'Lord of the Rings'
  and a number of other children's stories for adults.  The first character
  alphabet that was programmed for my plotter was Elvish rather than Latin."
    -- from SAIs "life as a computer for a quarter of a century"




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