Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] Re: [RFC] Move cost map interface
Home

[Freeciv-Dev] Re: [RFC] Move cost map interface

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [RFC] Move cost map interface
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 13 Apr 2002 12:25:04 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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."


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