Complete.Org: Mailing Lists: Archives: freeciv-ai: January 2003:
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore
Home

[freeciv-ai] Re: (PR#2477) Improved Auto-Explore

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#2477) Improved Auto-Explore
From: "Cameron Morland via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 8 Jan 2003 09:39:33 -0800
Reply-to: rt@xxxxxxxxxxxxxx

> You don't have to resubmit the patch just because of this change.  Wait 
> for a report from my anonymous reviewer ;)

We found that amortize isn't doing a proper job, frequently it will
give a desirability of zero, which will stop the explorer if the best
tile is not very good and far away. In particular,

      if (desirable > 0) {
        /* add some "noise" to the signal so equally desirable tiles
         * will be selected randomly. The noise has an amplitude
         * of 0.1, so a far-away tile with a higher score will still
         * usually be selected over a nearby tile with a high noise 
         * value. */
        desirable = 1000*desirable + myrand(100);

        /* now we want to reduce the desirability of far-away
         * tiles, without reducing it to zero, regardless how
         * far away it is. */
#define DIST_EXPONENT   5
        if (is_sailing_unit(punit)) {
          /* Hijack amortize for our needs */
          desirable = amortize(desirable, 
                               DIST_EXPONENT*warmap.seacost[x1][y1]);
        } else {
          desirable = amortize(desirable, 
                               DIST_EXPONENT*warmap.cost[x1][y1]);
        }
        if(desirable == 0) { /**************************************/
          freelog(LOG_VERBOSE, "desirable == 0\n");
        }
#undef DIST_EXPONENT

        if (desirable > most_desirable) {
          best_x = x1;
          best_y = y1;
          if (desirable > most_desirable) {
            most_desirable = desirable;
          }
        }
      }

I get a whole lot of "desirable == 0", even though we start with
desirable > 0, and should only reduce the value by a factor. I think
we should stick to pow and floats. Is something wrong with amortize?

The result is that very far away unexplored tiles will never get
explored.

-- 
+-----------------------------------------------------------------
| PGP http://www.eng.uwaterloo.ca/student/cjmorlan/public-key.pgp
| Cameron Morland             ----             Cameron@xxxxxxxxxx
|
| I don't worry about anything. Worry never solved any problem. If 
| the problem is there, you'll find the answer. You just have to 
| keep working on it.    
|     ---Milton Garland
+-----------------------------------------------------------------

Attachment: pgpYrPtf0cAq4.pgp
Description: PGP signature


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