Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [RFC] square_dxy_iterate
Home

[Freeciv-Dev] Re: [RFC] square_dxy_iterate

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [RFC] square_dxy_iterate
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 23 Feb 2002 00:23:03 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Feb 22, 2002 at 06:04:45PM -0500, Jason Short wrote:
> Raimar Falke wrote:
> >>From the profile of an autogame (with disabled CHECK_MAP_POS):
> > Flat profile:
> > 
> 
> > 80695222/2379222=33.916 calls of normalize_map_pos for each call of
> > invasion_funct. It turns out that square_dxy_iterate is the
> > problem. And the second one (is_terrain_near_tile) uses adjc_iterate.
> > 
> > Are there any is_border patches or similar handy which solve this?
> 
> Ross's corecleanups (kindof) extend the IS_BORDER_POS check to check for 
> arbitrary (map_dist) distances from the border.  Under the current 
> topology this is easy; under others it will be less so (but still 
> doable, plus our definition that IS_BORDER_POS(..)=>FALSE means the 
> position may or may not be on the border gives us a good default 
> option).  I'll put together a patch sometime this weekend, I suppose - 
> it should be quite short.

Ok.

> Another question to think about here is whether the algorithm of 
> invasion_funct can be improved.

Indead. See attached patch.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "- Amiga Y2K fixes (a bit late, wouldn't you say?)"
    -- Linus Torvalds about linux 2.4.0 at 4 Jan 2001

Attachment: invasion_funct1.diff
Description: Text document


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