Complete.Org: Mailing Lists: Archives: freeciv-ai: March 2003:
[freeciv-ai] Re: AI Diplomacy v8 (PR#2413)
Home

[freeciv-ai] Re: AI Diplomacy v8 (PR#2413)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [freeciv-ai] Re: AI Diplomacy v8 (PR#2413)
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 5 Mar 2003 02:40:16 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Wed, Mar 05, 2003 at 01:56:52AM -0800, Per I. Mathisen wrote:
> 
> On Tue, 4 Mar 2003, Raimar Falke wrote:
> > IMHO you make the same error again: hardcoding constants all over the
> > code. It should be the goal to divide the algorithm from the policy.
> 
> There is no framework to do so. Putting them into existing frameworks
> (server vars, rulesets) is too cumbersome and will unnecessarily bloat
> these.

What about a 

struct {
  struct {
    /* In evaluating want to attack when is a city considered big */
    int big_cities_size;
    /* In evaluating want to attack what extra want to we add for an
    enemy big city */
    int big_cities_extra;
    ...
  } diplomacy;
  ...
} ai_param;

void init_ai_param(void)
{
...
  ai_param.diplomacy.big_cities_size=8;
  ai_param.diplomacy.big_cities_extra=1;
...
}

In some further step this can be loaded from some file but this is
just a next step.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Are you saying that you actually used the Classpath Java AWT classes in 
  addition to the GTK peers and got them to display something?
  Wow.  That's way better than I did and I wrote the code!"
    -- Aaron M. Renn in the classpath mailing list




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