[Freeciv-Dev] Re: [RFC] Move cost map interface
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Apr 12, 2002 at 03:39:55PM -0400, Ross W. Wetmore wrote:
> At 01:56 PM 02/04/12 +0100, Gregory Berkolaiko wrote:
> >On Thu, 11 Apr 2002, Ross W. Wetmore wrote:
> >3. Qsort is not going to be in. Priority queue (log(n)) is my choice due
> >to the following problems with the bucket list:
> >(a) we don't know in advance how big the range of costs will be, and it
> >can be very big (fx around 255*100 in the current Raimar's proposal, and I
> >wouldn't call it excessive)
>
> You know the range of costs. It is a parameter to the warmap (maxcost).
In the previous proposals the cost is an unsigned int. There is no
limit.
> There are two parts to switch cases.
>
> 1) call the *right* costfn() - I really think this should be pushed
> back into a wrapped costfn which allows full program control and
> clean interface separation.
> 2) termination conditions - this is the real point at which code
> becomes diverse and you want inline control. I suppose this could
> be checkfn() like the costfn(), but somehow I like to see the
> actual code at this point from a readability/debugging aspect.
> If you add this as a checkfn(), then *any* warmap loop devolves to
> the single 3 line for, I think - total black magic to call though.
If you don't do inlining then it doesn't matter if loop in a pf_
function and call back to test for the exit or loop in the user
function and call one per turn the pf_get_next function. In both cases
you have a function call.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"We've all heard that a million monkeys banging on a million typewriters
will eventually reproduce the entire works of Shakespeare.
Now, thanks to the Internet, we know this is not true."
Message not available
Message not available[Freeciv-Dev] Re: [RFC] Move cost map interface, Ross W. Wetmore, 2002/04/12
[Freeciv-Dev] Re: [RFC] Move cost map interface,
Raimar Falke <=
[Freeciv-Dev] Re: [RFC] Move cost map interface, Ross W. Wetmore, 2002/04/14
[Freeciv-Dev] Re: [RFC] Move cost map interface, Raimar Falke, 2002/04/14
[Freeciv-Dev] Re: [RFC] Move cost map interface, Gregory Berkolaiko, 2002/04/15
Message not available[Freeciv-Dev] Re: [RFC] Move cost map interface, Ross W. Wetmore, 2002/04/15
[Freeciv-Dev] Re: [RFC] Move cost map interface, Raimar Falke, 2002/04/16
[Freeciv-Dev] Re: [RFC] Path finding interface #6, Raimar Falke, 2002/04/13
[Freeciv-Dev] Re: [RFC] Path finding interface #9, Raimar Falke, 2002/04/27
|
|