public PopulationBase(PopulationSettings settings, Board board)
        {
            this.settings = settings;
            this.board = board;

            genomeOperations = new GenomeOperations();
        }
        public StatSimulation(int runCount, int boardSeed, PopulationSettings populationSettings)
        {
            this.runCount = runCount;
            this.boardSeed = boardSeed;
            this.populationSettings = populationSettings;

            boardSource = new BoardSourceStatistical(10, 10, this.boardSeed);
        }
 public PopulationMultiRun(PopulationSettings settings, Board board)
     : base(settings, board)
 {
 }
        public void LoadPopulationSettingsFromCSV(string path)
        {
            using (FileStream fs = new FileStream(path, FileMode.Open))
            {
                using (StreamReader reader = new StreamReader(fs))
                {
                    paramHeader = reader.ReadLine();

                    string[] splits = ParamHeader.Split(new[] {","}, StringSplitOptions.None);
                    for (int i = 0; i < splits.Length; i++)
                    {
                        paramOrder.Add(splits[i], i);
                    }

                    while (!reader.EndOfStream)
                    {
                        //filterRate,crossRate,mutateRate,populationSize,generations
                        string param = reader.ReadLine();
                        string[] paramSplits = param.Split(new[] {","}, StringSplitOptions.None);

                        double crossRate = Convert.ToDouble(paramSplits[paramOrder["crossRate"]]);
                        double filterRate = Convert.ToDouble(paramSplits[paramOrder["filterRate"]]);
                        double mutateRate = Convert.ToDouble(paramSplits[paramOrder["mutateRate"]]);
                        int populationSize = Convert.ToInt32(paramSplits[paramOrder["populationSize"]]);
                        int generations = Convert.ToInt32(paramSplits[paramOrder["generations"]]);

                        PopulationSettings settings = new PopulationSettings(generations, populationSize, mutateRate, filterRate, populationSize, crossRate);

                        StatSimulationMultiRunResult result = new StatSimulationMultiRunResult(settings, param);

                        Settingses.Add(result);
                    }
                }
            }
        }
        public void CreateRandomPopulation(int paramSetCount)
        {
            for (int i = 0; i < paramSetCount; i++)
            {
                double crossRate = RandomSource.Instance.NextDoublePositive();
                double filterRate = RandomSource.Instance.NextDoublePositive();
                double mutateRate = RandomSource.Instance.NextDoublePositive();
                int populationSize = RandomSource.Instance.Next(20, 100);
                int generations = RandomSource.Instance.Next(1, 50);

                PopulationSettings settings = new PopulationSettings(generations, populationSize, mutateRate, filterRate, populationSize, crossRate);

                StatSimulationMultiRunResult result = new StatSimulationMultiRunResult(settings, settings.DefaultParamString);

                Settingses.Add(result);
            }
        }
 public StatSimulationMultiRunResult(PopulationSettings settings, string settingsString)
 {
     this.settings = settings;
     SettingsString = settingsString;
 }