Encog.Neural.NEAT.Training.NEATTraining.Init C# (CSharp) Method

Init() private method

Init the training.
private Init ( ) : void
return void
        private void Init()
        {
            if (CalculateScore.ShouldMinimize)
            {
                bestEverScore = Double.MaxValue;
            }
            else
            {
                bestEverScore = Double.MinValue;
            }

            // check the population
            foreach (IGenome obj in Population.Genomes)
            {
                if (!(obj is NEATGenome))
                {
                    throw new TrainingError(
                        "Population can only contain objects of NEATGenome.");
                }

                var neat = (NEATGenome) obj;

                if ((neat.InputCount != inputCount)
                    || (neat.OutputCount != outputCount))
                {
                    throw new TrainingError(
                        "All NEATGenome's must have the same input and output sizes as the base network.");
                }
                neat.GA = this;
            }

            Population.Claim(this);

            ResetAndKill();
            SortAndRecord();
            SpeciateAndCalculateSpawnLevels();
        }