Exemple #1
0
        public void Run()
        {
            var rc = new RaceCollection(_numberOfRaces);
            _numberOfBetsFound = 0;
            double advantage = ((double) _minAdvantage)/100.0;

            foreach (var race in rc.Races)
            {
                _bankroll += race.BetIt(_solution, _bankroll, advantage, ref _numberOfBetsFound);
            }
        }
        protected SolutionPopulation(int count, int numberOfRacesToLoad)
        {
            _numberOfRacesToLoad = numberOfRacesToLoad;

            for (int i = 0; i < count; ++i)
            {
                _solutions.Add(Solution.MakeRandom());
            }

            _races = new RaceCollection(_numberOfRacesToLoad);

            CreateNextGeneration();
        }
Exemple #3
0
        internal double CalculateFitness(RaceCollection rc)
        {
            _partitions.Clear();

            foreach (var race in rc.Races)
            {
                race.UpdatePartitions(this);
            }

            return 0.0;
        }