[freeciv-ai] Re: rfc: ai properly evaluate governments
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Dec 05, 2002 at 02:19:04AM +0000, Per I. Mathisen wrote:
> + /* Dynamic weights used in addition to Syela's hardcoded weights */
> + int shield_priority;
> + int food_priority;
> + int trade_priority;
> + int happy_priority;
> + int unhappy_priority;
> + int angry_priority;
Nice. Very nice. My only problem is the "in addition to Syela's
hardcoded weights". Is it possible to convert all users?
> + /* Bonuses for non-economic abilities */
> + if (government_has_flag(gov, G_BUILD_VETERAN_DIPLOMAT)) {
> + bonus += 3;
> + }
> + if (government_has_flag(gov, G_REVOLUTION_WHEN_UNHAPPY)) {
> + bonus -= 1; /* Not really a problem for us */
> + }
> + if (government_has_flag(gov, G_UNBRIBABLE)) {
> + bonus += 10;
> + }
> + if (government_has_flag(gov, G_INSPIRES_PARTISANS)) {
> + bonus += 5;
> + }
> + if (government_has_flag(gov, G_RAPTURE_CITY_GROWTH)) {
> + bonus += 8;
> + }
> + if (get_nation_by_idx(pplayer->nation)->goals.government == i) {
> + bonus += 20;
> + }
> +
> + val += (val * bonus) / 100;
You know that these are arbitrary?! IMHO these values are a good
examples of the move-values-out-of-code idea from Gregory.
Can you also compare your function with the existing one? What do you
do better? How does the results change?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Your mail could not be delivered to the following Address:
VTCMC.VTLPR@xxxxxxxxxxxxx ** Unassigned error message **"
|
|