Complete.Org: Mailing Lists: Archives: freeciv-dev: January 1999:
Re: [Freeciv-Dev] init_warmap
Home

Re: [Freeciv-Dev] init_warmap

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] init_warmap
From: schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx (Peter Schaefer)
Date: Sat, 30 Jan 1999 05:27:08 +0100

        - what was this threshold usefull to ?

i think it was intented as a rule of thumb.
May be it is even wrong, getting units stuck.
Because, search will be truncated when it hits the
pyramid built by min(i,j) .
Well that's what I understood looking at it quickly.. .

I wonder if it will be faster
if after
    yy[1] = y;
    for (k = 0; k < 8; k++) {
      i = ii[k]; j = jj[k]; /* saves CPU cycles? */
+       if(warmap.cost[xx[i]][yy[j]] > warmap.cost[x][y]){
....
+       }
    } /* end for */
  } while (warstacksize > warnodes);
  if (warnodes > WARSTACK_DIM) {


is added. It will be more work in the 'successful' step in the generation
of the warmap, but will save time on the 'failing' steps in the generation.

Also, does this:
      i = ii[k]; j = jj[k]; /* saves CPU cycles? */
make sense ? i and j are always used with xx[i] and yy[j]
so isn't it easier just to do
     xxi= xx[ii[k]]; yyj= yy[jj[k]];
and use this ?
I guess the existing formulatution saves registers if both i and j
are bytes and xx[i] , yy[j] are big integers, but my guess is
this is not helpfull using the current 'small' x and y coordinates ?

Is THRESHOLD always <=255( which is used in init_warmap )?
--
Peter Schaefer           mailto:schaefer@xxxxxxxxxxxxxxxxxxxxxxxxxxx     
X-Url: http://wwwhoppe.math.uni-augsburg.de/~schaefer/
coz' hackers LOVE irix


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