Changeset 16807 for branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.MOCMAEvolutionStrategy/3.3/MOCMAEvolutionStrategy.cs
- Timestamp:
- 04/17/19 23:07:03 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.MOCMAEvolutionStrategy/3.3/MOCMAEvolutionStrategy.cs
r16723 r16807 25 25 using System.Linq; 26 26 using System.Threading; 27 using HEAL.Attic; 27 28 using HeuristicLab.Analysis; 28 29 using HeuristicLab.Common; … … 32 33 using HeuristicLab.Optimization; 33 34 using HeuristicLab.Parameters; 34 using HEAL.Attic;35 35 using HeuristicLab.Problems.TestFunctions.MultiObjective; 36 36 using HeuristicLab.Random; … … 42 42 public class MOCMAEvolutionStrategy : BasicAlgorithm { 43 43 public override Type ProblemType { 44 get { return typeof(MultiObjective BasicProblem<RealVectorEncoding>); }45 } 46 public new MultiObjective BasicProblem<RealVectorEncoding> Problem {47 get { return (MultiObjective BasicProblem<RealVectorEncoding>)base.Problem; }44 get { return typeof(MultiObjectiveProblem<RealVectorEncoding, RealVector>); } 45 } 46 public new MultiObjectiveProblem<RealVectorEncoding, RealVector> Problem { 47 get { return (MultiObjectiveProblem<RealVectorEncoding, RealVector>)base.Problem; } 48 48 set { base.Problem = value; } 49 49 } … … 361 361 ResultsDifferenceBestKnownHypervolume = ResultsBestKnownHypervolume; 362 362 } 363 ResultsScatterPlot = new ParetoFrontScatterPlot(new double[0][], new double[0][], problem.BestKnownFront.ToJaggedArray(), problem.Objectives, problem.ProblemSize);363 ResultsScatterPlot = new ParetoFrontScatterPlot(new double[0][], new double[0][], problem.BestKnownFront.ToJaggedArray(), Problem.Objectives, Problem.Encoding.Length); 364 364 } 365 365 #endregion … … 409 409 } 410 410 private double[] Evaluate(RealVector x) { 411 var res = Problem.Evaluate( new SingleEncodingIndividual(Problem.Encoding, new Scope { Variables = { new Variable(Problem.Encoding.Name, x) } }), random);411 var res = Problem.Evaluate(x, random); 412 412 return res; 413 413 } … … 495 495 ResultsHypervolumeDifferenceDataLine.Values.Add(ResultsDifferenceBestKnownHypervolume); 496 496 497 Problem.Analyze( 498 solutions.Select(x => (Optimization.Individual)new SingleEncodingIndividual(Problem.Encoding, new Scope { Variables = { new Variable(Problem.Encoding.Name, x.Mean) } })).ToArray(), 497 Problem.Analyze(solutions.Select(x => x.Mean).ToArray(), 499 498 solutions.Select(x => x.Fitness).ToArray(), 500 499 Results,
Note: See TracChangeset
for help on using the changeset viewer.