Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12315) Slowness (fix)
Home

[Freeciv-Dev] Re: (PR#12315) Slowness (fix)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12315) Slowness (fix)
From: "Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 6 Mar 2005 11:51:35 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12315 >

On Sun, Mar 06, 2005 at 10:52:21AM -0800, Per I. Mathisen wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12315 >
> 
> On Sun, 6 Mar 2005, Benoit Hudson wrote:
> > On Sun, Mar 06, 2005 at 10:19:43AM -0800, Jason Short wrote:
> > > I think a random sampling of cities would be better...
> >
> > As a guess, you probably want a log-size sample to deal with very large
> > empires, yet still be cheap on small civs; how well does a sample of
> > size 10 + lg(|cities|) work?
> 
> We don't really need anything that fancy, do we? I think Jason's
> suggestion is a good one.

log isn't very fancy, and it insulates us from having to ever submit
PR#26719 "stupid AI chooses bad government with large civ"

Everyone who ever does random samples takes a sample whose size is
dependent on the size of the set, and usually the dependence is on the
log of the size of the set (sometimes it's linear) for various reasons
well understood by people who aren't me.

All we need is:
    #define GOVT_EVAL_MIN_SAMPLES 20
    #define GOVT_EVAL_SCALE 5
    int max_samples = GOVT_EVAL_MIN_SAMPLES
                      + GOVT_EVAL_SCALE * log(pplayer->cities.nelements);

And we get about the same ratio of 50 samples / 350 cities.

        -- Benoît





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