Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] Re: [RFC] Path finding interface #9
Home

[Freeciv-Dev] Re: [RFC] Path finding interface #9

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [RFC] Path finding interface #9
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Thu, 30 May 2002 10:59:29 +0200

On Wed, May 29, 2002 at 05:11:43PM +0100, Gregory Berkolaiko wrote:
> On Wed, 29 May 2002, Raimar Falke wrote:
> 
> > Ok. And can I say that I want to trade saved turn for x "danger
> > points"? The difference where I arrive with n turns and 5 points left
> > is different to arriving in n-1 turns and 1 point left. It is more
> > different than the two move points.
> 
> I am not sure how the "danger points" come into the second part of the 
> question...
> 
> Can't you just wait in the final position for one turn, so you'll 
> effectively be there in n turns with 6 points left?

There there 3 different metrics to measure the "goodness" of a path:
 - BMC
 - extra cost (danger and pseudo BMC for unknown tiles)
 - time (turns and moves_left)
and there is is_safe_tile but this just remove some paths in a kind of
pre-processing step.

So you can judge a path just by its BMC or just by its time. So in
general you may want to do something like:
 goodness = BMC*factor1+extra_cost*factor2+turns*factor3+moves_left*factor4

So if we assume that factor1 is 0 you see that you can balance a
higher turns value with a smaller extra_cost value. Depending on the
values you can say that 1 turns can be balanced by n extra_cost
(points).

This model is a lot clearer than the previous one. So I have attached
a 10th version of the interface. You can now specify a function which
does calculate the "goodness" of a path. This also allows you to make
a path with turns=n, moves_left=0 equivalent to turns=n+1,moves_left=6
which is needed for settlers.

The patch also made the definition of is_position_safe a lot
clearer. It is also renamed.

        Raimar

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

Attachment: path_finding10.h
Description: Text document

Attachment: diff
Description: Text document


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