Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/13/20 14:20:24 (4 years ago)
Author:
dleko
Message:

#2825 Bugfix: The correct number of reference points are returned on ReferencePoint.GetNumberOfGeneratedReferencePoints.

File:
1 edited

Legend:

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

    r17665 r17667  
    1111using HeuristicLab.Optimization;
    1212using HeuristicLab.Parameters;
     13using HeuristicLab.Problems.TestFunctions.MultiObjective;
    1314using HeuristicLab.Random;
    1415
     
    4142        }
    4243
    43         public int NumberOfObjectives => Problem.Maximization.Length;
     44        public int NumberOfObjectives
     45        {
     46            get
     47            {
     48                if (!(Problem is MultiObjectiveTestFunctionProblem testFunctionProblem)) throw new NotSupportedException("Only test multi objective test function problems are supported");
     49                return testFunctionProblem.Objectives;
     50            }
     51        }
    4452
    4553        #endregion ProblemProperties
     
    211219            base.Initialize(cancellationToken);
    212220
    213             PopulationSize.Value = ReferencePoint.GetNumberOfGeneratedReferencePoints(Problem.Maximization.Length);
     221            int pop = ReferencePoint.GetNumberOfGeneratedReferencePoints(NumberOfObjectives);
     222            PopulationSize.Value = pop;
    214223            InitResults();
    215224            InitReferencePoints();
     
    264273                // create copies of generated reference points (to preserve the original ones for
    265274                // the next generation) maybe todo: use cloner?
    266                 //ToNextGeneration(CreateCopyOfReferencePoints());
    267275
    268276                List<Solution> qt = Mutate(Recombine(solutions));
Note: See TracChangeset for help on using the changeset viewer.