- Timestamp:
- 07/14/20 20:28:33 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3/3.3/NSGA3.cs
r17667 r17668 219 219 base.Initialize(cancellationToken); 220 220 221 int pop = ReferencePoint.GetNumberOfGeneratedReferencePoints(NumberOfObjectives); 221 int numberOfGeneratedReferencePoints = ReferencePoint.GetNumberOfGeneratedReferencePoints(NumberOfObjectives); 222 int pop = ((numberOfGeneratedReferencePoints + 3) / 4) * 4; 222 223 PopulationSize.Value = pop; 223 224 InitResults(); 225 InitFields(); 224 226 InitReferencePoints(); 225 InitFields();226 227 Analyze(); 227 228 } … … 260 261 Results.Add(new Result(GeneratedReferencePointsResultName, "The initially generated reference points", new DoubleMatrix())); 261 262 Results.Add(new Result(CurrentFrontResultName, "The Pareto Front", new DoubleMatrix())); 262 Results.Add(new Result(CurrentGenerationResultName, "The current generation", new IntValue( 0)));263 Results.Add(new Result(CurrentGenerationResultName, "The current generation", new IntValue(1))); 263 264 } 264 265 … … 274 275 // the next generation) maybe todo: use cloner? 275 276 276 List<Solution> qt = Mutate(Recombine(solutions)); 277 List<Solution> rt = Utility.Concat(solutions, qt); 278 279 solutions = NSGA3Selection.SelectSolutionsForNextGeneration(rt, GetCopyOfReferencePoints(), Problem.Maximization, random); 280 281 ResultsCurrentGeneration.Value++; 277 try 278 { 279 List<Solution> qt = Mutate(Recombine(solutions)); 280 List<Solution> rt = Utility.Concat(solutions, qt); 281 282 solutions = NSGA3Selection.SelectSolutionsForNextGeneration(rt, GetCopyOfReferencePoints(), Problem.Maximization, random); 283 284 ResultsCurrentGeneration.Value++; 285 } 286 catch (Exception ex) 287 { 288 throw new Exception($"Failed in generation {ResultsCurrentGeneration}", ex); 289 } 282 290 } 283 291 }
Note: See TracChangeset
for help on using the changeset viewer.