Changeset 16310 for branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers
- Timestamp:
- 11/20/18 14:53:51 (6 years ago)
- Location:
- branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/CrowdingAnalyzer.cs
r16171 r16310 30 30 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 31 31 [StorableClass] 32 [Item("CrowdingAnalyzer", "Th e mean crowding distance for each point of the Front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]32 [Item("CrowdingAnalyzer", "This analyzer is functionally equivalent to the CrowdingAnalyzer in HeuristicLab.Analysis, but is kept as not to break backwards compatibility")] 33 33 public class CrowdingAnalyzer : MOTFAnalyzer { 34 34 35 public IResultParameter<DoubleValue> CrowdingResultParameter { 36 get { return (IResultParameter<DoubleValue>)Parameters["Crowding"]; } 37 } 35 public IResultParameter<DoubleValue> CrowdingResultParameter => (IResultParameter<DoubleValue>)Parameters["Crowding"]; 38 36 39 37 [StorableConstructor] 40 38 protected CrowdingAnalyzer(bool deserializing) : base(deserializing) { } 41 public CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner) 42 : base(original, cloner) { 43 } 39 public CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner): base(original, cloner) {} 44 40 public override IDeepCloneable Clone(Cloner cloner) { 45 41 return new CrowdingAnalyzer(this, cloner); -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/GenerationalDistanceAnalyzer.cs
r16171 r16310 31 31 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 32 32 [StorableClass] 33 [Item("GenerationalDistanceAnalyzer", "Th e generational distance between the current and the best known front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]33 [Item("GenerationalDistanceAnalyzer", "This analyzer is functionally equivalent to the GenerationalDistanceAnalyzer in HeuristicLab.Analysis, but is kept as not to break backwards compatibility")] 34 34 public class GenerationalDistanceAnalyzer : MOTFAnalyzer { 35 35 36 36 private IFixedValueParameter<DoubleValue> DampeningParameter { 37 get { return (IFixedValueParameter<DoubleValue>)Parameters["Dampening"]; }38 set { Parameters["Dampening"].ActualValue = value; }37 get => (IFixedValueParameter<DoubleValue>)Parameters["Dampening"]; 38 set => Parameters["Dampening"].ActualValue = value; 39 39 } 40 40 41 41 public double Dampening { 42 get { return DampeningParameter.Value.Value; }43 set { DampeningParameter.Value.Value = value; }42 get => DampeningParameter.Value.Value; 43 set => DampeningParameter.Value.Value = value; 44 44 } 45 45 46 public IResultParameter<DoubleValue> GenerationalDistanceResultParameter { 47 get { return (IResultParameter<DoubleValue>)Parameters["Generational Distance"]; } 48 } 46 public IResultParameter<DoubleValue> GenerationalDistanceResultParameter => (IResultParameter<DoubleValue>)Parameters["Generational Distance"]; 49 47 50 48 [StorableConstructor] -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/HypervolumeAnalyzer.cs
r16171 r16310 32 32 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 33 33 [StorableClass] 34 [Item("HypervolumeAnalyzer", " Computes the enclosed Hypervolume between the current front and a given reference Point")]34 [Item("HypervolumeAnalyzer", "This analyzer is functionally equivalent to the HypervolumeAnalyzer in HeuristicLab.Analysis, but is kept as not to break backwards compatibility")] 35 35 public class HypervolumeAnalyzer : MOTFAnalyzer { 36 36 37 public ILookupParameter<DoubleArray> ReferencePointParameter { 38 get { return (ILookupParameter<DoubleArray>)Parameters["ReferencePoint"]; } 39 } 40 public IResultParameter<DoubleValue> HypervolumeResultParameter { 41 get { return (IResultParameter<DoubleValue>)Parameters["Hypervolume"]; } 42 } 43 public IResultParameter<DoubleValue> BestKnownHypervolumeResultParameter { 44 get { return (IResultParameter<DoubleValue>)Parameters["Best known hypervolume"]; } 45 } 46 public IResultParameter<DoubleValue> HypervolumeDistanceResultParameter { 47 get { return (IResultParameter<DoubleValue>)Parameters["Absolute Distance to BestKnownHypervolume"]; } 48 } 37 public ILookupParameter<DoubleArray> ReferencePointParameter => (ILookupParameter<DoubleArray>)Parameters["ReferencePoint"]; 38 39 public IResultParameter<DoubleValue> HypervolumeResultParameter => (IResultParameter<DoubleValue>)Parameters["Hypervolume"]; 40 41 public IResultParameter<DoubleValue> BestKnownHypervolumeResultParameter => (IResultParameter<DoubleValue>)Parameters["Best known hypervolume"]; 42 43 public IResultParameter<DoubleValue> HypervolumeDistanceResultParameter => (IResultParameter<DoubleValue>)Parameters["Absolute Distance to BestKnownHypervolume"]; 49 44 50 45 51 46 [StorableConstructor] 52 protected HypervolumeAnalyzer(bool deserializing) 53 : base(deserializing) { 54 } 47 protected HypervolumeAnalyzer(bool deserializing) : base(deserializing) {} 55 48 56 protected HypervolumeAnalyzer(HypervolumeAnalyzer original, Cloner cloner) 57 : base(original, cloner) { 58 } 49 protected HypervolumeAnalyzer(HypervolumeAnalyzer original, Cloner cloner) : base(original, cloner) {} 50 59 51 public override IDeepCloneable Clone(Cloner cloner) { 60 52 return new HypervolumeAnalyzer(this, cloner); … … 69 61 BestKnownHypervolumeResultParameter.DefaultValue = new DoubleValue(0); 70 62 HypervolumeDistanceResultParameter.DefaultValue = new DoubleValue(0); 71 72 73 63 } 74 64 -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/InvertedGenerationalDistanceAnalyzer.cs
r16171 r16310 30 30 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 31 31 [StorableClass] 32 [Item("InvertedGenerationalDistanceAnalyzer", "Th e inverted generational distance between the current and the best known front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]32 [Item("InvertedGenerationalDistanceAnalyzer", "This analyzer is functionally equivalent to the InvertedGenerationalDistanceAnalyzer in HeuristicLab.Analysis, but is kept as not to break backwards compatibility")] 33 33 public class InvertedGenerationalDistanceAnalyzer : MOTFAnalyzer { 34 public override bool EnabledByDefault { get { return false; } }34 public override bool EnabledByDefault => false; 35 35 36 private IFixedValueParameter<DoubleValue> DampeningParameter { 37 get { return (IFixedValueParameter<DoubleValue>)Parameters["Dampening"]; } 36 private IFixedValueParameter<DoubleValue> DampeningParameter => (IFixedValueParameter<DoubleValue>)Parameters["Dampening"]; 37 38 public double Dampening { 39 get => DampeningParameter.Value.Value; 40 set => DampeningParameter.Value.Value = value; 38 41 } 39 42 40 public double Dampening { 41 get { return DampeningParameter.Value.Value; } 42 set { DampeningParameter.Value.Value = value; } 43 } 44 45 public IResultParameter<DoubleValue> InvertedGenerationalDistanceResultParameter { 46 get { return (IResultParameter<DoubleValue>)Parameters["Inverted Generational Distance"]; } 47 } 43 public IResultParameter<DoubleValue> InvertedGenerationalDistanceResultParameter => (IResultParameter<DoubleValue>)Parameters["Inverted Generational Distance"]; 48 44 49 45 [StorableConstructor] -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/MOTFAnalyzer.cs
r15583 r16310 33 33 [StorableClass] 34 34 public abstract class MOTFAnalyzer : SingleSuccessorOperator, IMultiObjectiveTestFunctionAnalyzer { 35 public virtual bool EnabledByDefault { get { return true; } }35 public virtual bool EnabledByDefault => true; 36 36 37 public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter { 38 get { return (IScopeTreeLookupParameter<DoubleArray>)Parameters["Qualities"]; } 39 } 37 public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter => (IScopeTreeLookupParameter<DoubleArray>)Parameters["Qualities"]; 40 38 41 public ILookupParameter<ResultCollection> ResultsParameter { 42 get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; } 43 } 39 public ILookupParameter<ResultCollection> ResultsParameter => (ILookupParameter<ResultCollection>)Parameters["Results"]; 44 40 45 public ILookupParameter<IMultiObjectiveTestFunction> TestFunctionParameter { 46 get { return (ILookupParameter<IMultiObjectiveTestFunction>)Parameters["TestFunction"]; } 47 } 41 public ILookupParameter<IMultiObjectiveTestFunction> TestFunctionParameter => (ILookupParameter<IMultiObjectiveTestFunction>)Parameters["TestFunction"]; 48 42 49 public ILookupParameter<DoubleMatrix> BestKnownFrontParameter { 50 get { return (ILookupParameter<DoubleMatrix>)Parameters["BestKnownFront"]; } 51 } 43 public ILookupParameter<DoubleMatrix> BestKnownFrontParameter => (ILookupParameter<DoubleMatrix>)Parameters["BestKnownFront"]; 52 44 53 45 protected MOTFAnalyzer(MOTFAnalyzer original, Cloner cloner) : base(original, cloner) { } -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/ScatterPlotAnalyzer.cs
r16171 r16310 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 25 26 using HeuristicLab.Encodings.RealVectorEncoding; 26 27 using HeuristicLab.Optimization; … … 33 34 public class ScatterPlotAnalyzer : MOTFAnalyzer { 34 35 35 public IScopeTreeLookupParameter<RealVector> IndividualsParameter { 36 get { return (IScopeTreeLookupParameter<RealVector>)Parameters["Individuals"]; } 37 } 36 public IScopeTreeLookupParameter<RealVector> IndividualsParameter => (IScopeTreeLookupParameter<RealVector>)Parameters["Individuals"]; 38 37 39 public IResultParameter<ParetoFrontScatterPlot> ScatterPlotResultParameter { 40 get { return (IResultParameter<ParetoFrontScatterPlot>)Parameters["Scatterplot"]; } 41 } 42 38 public IResultParameter<ParetoFrontScatterPlot> ScatterPlotResultParameter => (IResultParameter<ParetoFrontScatterPlot>)Parameters["Scatterplot"]; 43 39 44 40 [StorableConstructor] … … 52 48 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("Individuals", "The individual solutions to the problem")); 53 49 Parameters.Add(new ResultParameter<ParetoFrontScatterPlot>("Scatterplot", "The scatterplot for the current and optimal (if known front)")); 54 55 50 } 56 51 … … 59 54 var individuals = IndividualsParameter.ActualValue; 60 55 var testFunction = TestFunctionParameter.ActualValue; 61 var objectives = qualities [0].Length;62 var problemSize = individuals [0].Length;56 var objectives = qualities.Length != 0 ? qualities[0].Length:0; 57 var problemSize = individuals.Length != 0 ? individuals[0].Length:0; 63 58 64 var optimalFront = new double[0][]; 65 var front = testFunction.OptimalParetoFront(objectives); 66 if (front != null) optimalFront = front.ToArray(); 59 var optimalFront = new double[0][]; 60 if (testFunction != null) { 61 var front = testFunction.OptimalParetoFront(objectives); 62 if (front != null) optimalFront = front.ToArray(); 63 } 64 else { 65 var mat = BestKnownFrontParameter.ActualValue; 66 optimalFront = mat == null ? null : Enumerable.Range(0, mat.Rows).Select(r => Enumerable.Range(0, mat.Columns).Select(c => mat[r, c]).ToArray()).ToArray(); 67 } 67 68 68 69 var qualityClones = qualities.Select(s => s.ToArray()).ToArray(); … … 70 71 71 72 ScatterPlotResultParameter.ActualValue = new ParetoFrontScatterPlot(qualityClones, solutionClones, optimalFront, objectives, problemSize); 72 73 73 return base.Apply(); 74 74 } -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/SpacingAnalyzer.cs
r16171 r16310 29 29 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 30 30 [StorableClass] 31 [Item("SpacingAnalyzer", "Th e spacing of the current front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]31 [Item("SpacingAnalyzer", "This analyzer is functionally equivalent to the SpacingAnalyzer in HeuristicLab.Analysis, but is kept as not to break backwards compatibility")] 32 32 public class SpacingAnalyzer : MOTFAnalyzer { 33 33 34 public IResultParameter<DoubleValue> SpacingResultParameter { 35 get { return (IResultParameter<DoubleValue>)Parameters["Spacing"]; } 36 } 34 public IResultParameter<DoubleValue> SpacingResultParameter => (IResultParameter<DoubleValue>)Parameters["Spacing"]; 35 37 36 [StorableConstructor] 38 37 protected SpacingAnalyzer(bool deserializing) : base(deserializing) { } 39 40 38 41 39 protected SpacingAnalyzer(SpacingAnalyzer original, Cloner cloner) : base(original, cloner) { }
Note: See TracChangeset
for help on using the changeset viewer.