Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2002:
[Freeciv-Dev] Re: Path-finding in the presence of danger
Home

[Freeciv-Dev] Re: Path-finding in the presence of danger

[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: Path-finding in the presence of danger
From: rf13@xxxxxxxxxxxxxxxxx
Date: Fri, 4 Oct 2002 06:33:20 -0700

On Fri, Oct 04, 2002 at 01:04:15PM +0100, Gregory Berkolaiko wrote:
> > > Personally, I think that allowing such overflowing extracosts to operate 
> > > together with is_position_dangerous is a bit too much.  The end-user will 
> > > have hard time predicting the effects of the call-backs he specifies even 
> > > without this feature (this is why I am strongly against user-specified 
> > > COP 
> > > functions).
> > 
> > Or this could mean that the implementation has to cope with all COP
> > functions which follow the Dijkstra rules.
> 
> Unfortunately your format of COP callback allows functions which break 
> Dijkstra rules.  

> This is a separate discussion though.

Yes this is the biggest problem. But not a hard one and also not an urgent one.

> > > And another idea I had: in some situations, it makes more sense to MAX 
> > > extracosts rather than sum them.  This can be easily handled by passing 
> > > the current extracost to the get_extra_cost call-back.  The call_back can 
> > > then do whatever to the extracosts, even multiply them together in some 
> > > imaginative manner to get the probability to survive by the end of the 
> > > path.
> > 
> > You are right that it may be nice to not force addition by allow more
> > freedom. We had this feature in version 11 of the interface with the
> > extra_cost2 callback.
> 
> We have rather different attitudes to the subject.  You seem to prefer to 
> have many call-backs, while I would rather have one which does it all.
> For this particular proposal,
>       int get_extra(int x, int y, int curent_extra, void *data)
> provides for the desired freedom.

I removed the extra_cost2 callback because there was no need for
it. So while I agree with you that this calculation can be made more
flexible I want to ask: so we know such situations? Is it worth it?
Adding this extra flexibility is done in some hours. No problem.

The above case can't work since ECOT may only depend on the position.

The more I think about it the more I like the slim interface I
proposed in the mail I answered Ross. Nothing on our code would. We
would just rip the code of the path_finding.c and move it into
path_finding_tools.c. So we would get three real layers (algorithm,
callbacks with the freeciv logic and end-user like AI or agents).

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx


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