[freeciv-ai] Re: (PR#2477) Improved Auto-Explore
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> 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
+-----------------------------------------------------------------
pgpYrPtf0cAq4.pgp
Description: PGP signature
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore, Gregory Berkolaiko via RT, 2003/01/08
- Message not available
- [freeciv-ai] Re: (PR#2477) Improved Auto-Explore,
Cameron Morland via RT <=
Message not available
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore, Gregory Berkolaiko via RT, 2003/01/26
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore, Gregory Berkolaiko via RT, 2003/01/28
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore, Gregory Berkolaiko, 2003/01/29
[freeciv-ai] Re: (PR#2477) Improved Auto-Explore, Gregory Berkolaiko via RT, 2003/01/29
|
|