- Timestamp:
- 07/11/17 19:36:03 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/ScatterPlotAnalyzer.cs
r14111 r15203 37 37 } 38 38 39 public IResultParameter< ScatterPlotContent> ScatterPlotResultParameter {40 get { return (IResultParameter< ScatterPlotContent>)Parameters["Scatterplot"]; }39 public IResultParameter<ParetoFrontScatterPlot> ScatterPlotResultParameter { 40 get { return (IResultParameter<ParetoFrontScatterPlot>)Parameters["Scatterplot"]; } 41 41 } 42 42 … … 51 51 public ScatterPlotAnalyzer() { 52 52 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("Individuals", "The individual solutions to the problem")); 53 Parameters.Add(new ResultParameter< ScatterPlotContent>("Scatterplot", "The scatterplot for the current and optimal (if known front)"));53 Parameters.Add(new ResultParameter<ParetoFrontScatterPlot>("Scatterplot", "The scatterplot for the current and optimal (if known front)")); 54 54 55 55 } … … 57 57 public override IOperation Apply() { 58 58 var qualities = QualitiesParameter.ActualValue; 59 var individuals = IndividualsParameter.ActualValue; 59 60 var testFunction = TestFunctionParameter.ActualValue; 60 61 int objectives = qualities[0].Length; 61 var individuals = IndividualsParameter.ActualValue;62 int problemSize = individuals[0].Length; 62 63 63 64 double[][] optimalFront = new double[0][]; … … 68 69 var solutionClones = individuals.Select(s => s.ToArray()).ToArray(); 69 70 70 ScatterPlotResultParameter.ActualValue = new ScatterPlotContent(qualityClones, solutionClones, optimalFront, objectives);71 ScatterPlotResultParameter.ActualValue = new ParetoFrontScatterPlot(qualityClones, solutionClones, optimalFront, objectives, problemSize); 71 72 72 73 return base.Apply(); -
trunk/sources/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/HeuristicLab.Problems.TestFunctions.MultiObjective-3.3.csproj
r14168 r15203 111 111 <Compile Include="Calculators\InvertedGenerationalDistance.cs" /> 112 112 <Compile Include="Calculators\GenerationalDistance.cs" /> 113 <Compile Include=" ScatterPlotContent.cs" />113 <Compile Include="ParetoFrontScatterPlot.cs" /> 114 114 <Compile Include="Utilities.cs" /> 115 115 <Compile Include="Instances\MISCInstanceProvider.cs" /> -
trunk/sources/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/ParetoFrontScatterPlot.cs
r15202 r15203 19 19 */ 20 20 #endregion 21 21 22 using System.Linq; 22 23 using HeuristicLab.Common; … … 26 27 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 27 28 [StorableClass] 28 [Item("ScatterPlot", "The optimal front, current front and its associated Points in the searchspace")] 29 public class ScatterPlotContent : Item { 29 [Item("Pareto Front Scatter Plot", "The optimal front, current front and its associated Points in the searchspace")] 30 public class ParetoFrontScatterPlot : Item { 31 32 [Storable] 33 private int objectives; 34 public int Objectives { 35 get { return objectives; } 36 } 37 38 [Storable] 39 private int problemSize; 40 public int ProblemSize { 41 get { return problemSize; } 42 } 30 43 31 44 [Storable] 32 45 private double[][] qualities; 33 46 public double[][] Qualities { 34 get { 35 return qualities; 36 } 37 38 private set { 39 qualities = value; 40 } 41 } 42 43 [Storable] 44 private int objectives; 45 public int Objectives { 46 get { 47 return objectives; 48 } 49 50 private set { 51 objectives = value; 52 } 47 get { return qualities; } 53 48 } 54 49 … … 56 51 private double[][] solutions; 57 52 public double[][] Solutions { 58 get { 59 return solutions; 60 } 61 62 private set { 63 solutions = value; 64 } 53 get { return solutions; } 65 54 } 66 55 … … 68 57 private double[][] paretoFront; 69 58 public double[][] ParetoFront { 70 get { 71 return paretoFront; 72 } 73 74 private set { 75 paretoFront = value; 76 } 59 get { return paretoFront; } 77 60 } 78 61 79 [StorableConstructor] 80 protected ScatterPlotContent(bool deserializing) : base() { } 81 82 protected ScatterPlotContent(ScatterPlotContent original, Cloner cloner) 83 : this() { 84 this.qualities = original.qualities.Select(s => s.ToArray()).ToArray(); 85 this.solutions = original.solutions.Select(s => s.ToArray()).ToArray(); 86 this.paretoFront = original.paretoFront.Select(s => s.ToArray()).ToArray(); 87 this.objectives = original.objectives; 88 } 89 protected ScatterPlotContent() : base() { } 90 public ScatterPlotContent(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) { 62 #region Constructor, Cloning & Persistance 63 public ParetoFrontScatterPlot(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives, int problemSize) { 91 64 this.qualities = qualities; 92 65 this.solutions = solutions; 93 66 this.paretoFront = paretoFront; 94 67 this.objectives = objectives; 68 this.problemSize = problemSize; 69 } 70 public ParetoFrontScatterPlot() { } 71 72 protected ParetoFrontScatterPlot(ParetoFrontScatterPlot original, Cloner cloner) 73 : base(original, cloner) { 74 if (original.qualities != null) qualities = original.qualities.Select(s => s.ToArray()).ToArray(); 75 if (original.solutions != null) solutions = original.solutions.Select(s => s.ToArray()).ToArray(); 76 if (original.paretoFront != null) paretoFront = original.paretoFront.Select(s => s.ToArray()).ToArray(); 77 objectives = original.objectives; 78 problemSize = original.problemSize; 79 } 80 public override IDeepCloneable Clone(Cloner cloner) { 81 return new ParetoFrontScatterPlot(this, cloner); 95 82 } 96 83 97 public override IDeepCloneable Clone(Cloner cloner) { 98 return new ScatterPlotContent(this, cloner); 99 } 84 [StorableConstructor] 85 protected ParetoFrontScatterPlot(bool deserializing) 86 : base(deserializing) { } 87 #endregion 100 88 } 101 89 }
Note: See TracChangeset
for help on using the changeset viewer.