Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/12/20 11:16:10 (4 years ago)
Author:
dleko
Message:

#2825 Initialize population size with the correct number (according to NSGA-III paper).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs

    r17662 r17663  
    173173            Parameters.Add(new FixedValueParameter<IntValue>(SeedName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
    174174            Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
    175             Parameters.Add(new FixedValueParameter<IntValue>(PopulationSizeName, "The size of the population of Individuals.", new IntValue(200)));
     175            Parameters.Add(new FixedValueParameter<IntValue>(PopulationSizeName, "The size of the population of Individuals.", new IntValue(ReferencePoint.GetNumberOfGeneratedReferencePoints(NumberOfObjectives))));
    176176            Parameters.Add(new FixedValueParameter<PercentValue>(CrossoverProbabilityName, "The probability that the crossover operator is applied on two parents.", new PercentValue(0.9)));
    177177            Parameters.Add(new FixedValueParameter<DoubleValue>(CrossoverContiguityName, "The contiguity value for the Simulated Binary Crossover that specifies how close a child should be to its parents (larger value means closer). The value must be greater than or equal than 0. Typical values are in the range [2;5]."));
     
    209209            base.Initialize(cancellationToken);
    210210
    211             InitFields();
    212211            InitResults();
    213212            InitReferencePoints();
     213            InitFields();
    214214            Analyze();
     215        }
     216
     217        private void InitReferencePoints()
     218        {
     219            // Generate reference points and add them to results
     220            ReferencePoints = ReferencePoint.GenerateReferencePoints(random, NumberOfObjectives);
     221            ResultsGeneratedReferencePoints = Utility.ConvertToDoubleMatrix(ReferencePoints);
    215222        }
    216223
     
    242249            Results.Add(new Result(GeneratedReferencePointsResultName, "The initially generated reference points", new DoubleMatrix()));
    243250            Results.Add(new Result(CurrentFrontResultName, "The Pareto Front", new DoubleMatrix()));
    244         }
    245 
    246         private void InitReferencePoints()
    247         {
    248             // Generate reference points and add them to results
    249             ReferencePoints = ReferencePoint.GenerateReferencePoints(random, NumberOfObjectives);
    250             ResultsGeneratedReferencePoints = Utility.ConvertToDoubleMatrix(ReferencePoints);
    251251        }
    252252
Note: See TracChangeset for help on using the changeset viewer.