/// <summary> /// Initializes a new instance of the <see cref="GAF.Population"/> class. /// </summary> /// <param name="populationSize"></param> /// <param name="chromosomeLength"></param> /// <param name="reEvaluateAll"></param> /// <param name="useLinearlyNormalisedFitness"></param> /// <param name="selectionMethod"></param> /// <param name = "evaluateInParallel"></param> public Population(int populationSize, int chromosomeLength, bool reEvaluateAll, bool useLinearlyNormalisedFitness, ParentSelectionMethod selectionMethod, bool evaluateInParallel) { if (populationSize % 2 != 0) { throw new ArgumentException("Population size must be an even number."); } //set the default values this.InitialisationType = InitialisationType.Random; _reEvaluateAll = reEvaluateAll; _useLinearlyNormalisedFitness = useLinearlyNormalisedFitness; _parentSelectionMethod = selectionMethod; _evaluateInParallel = evaluateInParallel; this.Initialise(populationSize, chromosomeLength); }
/// <summary> /// Initializes a new instance of the <see cref="GAF.Population"/> class. /// </summary> /// <param name="populationSize">Population size.</param> /// <param name="chromosomeLength">Chromosome length.</param> /// <param name="reEvaluateAll">If set to <c>true</c> re evaluate all.</param> /// <param name="useLinearlyNormalisedFitness">If set to <c>true</c> use linearly normalised fitness.</param> /// <param name="selectionMethod">Selection method.</param> public Population(int populationSize, int chromosomeLength, bool reEvaluateAll, bool useLinearlyNormalisedFitness, ParentSelectionMethod selectionMethod) : this(populationSize, chromosomeLength, reEvaluateAll, useLinearlyNormalisedFitness, selectionMethod, false) { }