Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/29/19 13:53:26 (5 years ago)
Author:
mkommend
Message:

#2521: Integrated changes of #2943 into problem refactoring branch.

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/CrowdingAnalyzer.cs

    r16723 r17225  
    3030namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    3131  [StorableType("F06FB45C-051E-4AD8-BD82-16DA9DCBCACB")]
    32   [Item("CrowdingAnalyzer", "The 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")]
    3333  public class CrowdingAnalyzer : MOTFAnalyzer {
    34 
    35     public ILookupParameter<DoubleMatrix> BoundsParameter {
    36       get { return (ILookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
    37     }
    3834
    3935    public IResultParameter<DoubleValue> CrowdingResultParameter {
     
    4339    [StorableConstructor]
    4440    protected CrowdingAnalyzer(StorableConstructorFlag _) : base(_) { }
    45     public CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner)
    46       : base(original, cloner) {
    47     }
     41    public CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner): base(original, cloner) {}
    4842    public override IDeepCloneable Clone(Cloner cloner) {
    4943      return new CrowdingAnalyzer(this, cloner);
     
    5145
    5246    public CrowdingAnalyzer() {
    53       Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds",
    54         "The bounds of the solution given as either one line for all variables or a line for each variable. The first column specifies lower bound, the second upper bound."));
    55       Parameters.Add(new ResultParameter<DoubleValue>("Crowding", "The average corwding value of all points (excluding infinities)"));
     47      Parameters.Add(new ResultParameter<DoubleValue>("Crowding", "The average corwding distance of all points (excluding infinities)"));
    5648      CrowdingResultParameter.DefaultValue = new DoubleValue(double.NaN);
    57 
    5849    }
    5950
    6051    public override IOperation Apply() {
    6152      var qualities = QualitiesParameter.ActualValue;
    62       var bounds = BoundsParameter.ActualValue;
    63 
    64       var crowdingDistance = Crowding.Calculate(qualities.Select(x => x.ToArray()), bounds.CloneAsMatrix());
     53      var crowdingDistance = CrowdingCalculator.CalculateCrowding(qualities);
    6554      CrowdingResultParameter.ActualValue.Value = crowdingDistance;
    66 
    6755      return base.Apply();
    6856    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/GenerationalDistanceAnalyzer.cs

    r16723 r17225  
    3030namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    3131  [StorableType("EBC72F16-E329-4D18-800C-8642EFD0F05C")]
    32   [Item("GenerationalDistanceAnalyzer", "The generational distance between the current and the best known front (see Multi-Objective Performance Metrics - Shodhganga for more information)")]
     32  [Item("GenerationalDistanceAnalyzer", "This analyzer is functionally equivalent to the GenerationalDistanceAnalyzer in HeuristicLab.Analysis, but is kept as not to break backwards compatibility")]
    3333  public class GenerationalDistanceAnalyzer : MOTFAnalyzer {
    3434
     
    6363    public override IOperation Apply() {
    6464      var qualities = QualitiesParameter.ActualValue;
    65       int objectives = qualities[0].Length;
    66 
    67       var optimalfront = TestFunctionParameter.ActualValue.OptimalParetoFront(objectives);
     65      var optimalfront = TestFunctionParameter.ActualValue.OptimalParetoFront(qualities[0].Length);
    6866      if (optimalfront == null) return base.Apply();
    6967
    70       var distance = GenerationalDistance.Calculate(qualities.Select(x => x.CloneAsArray()), optimalfront, Dampening);
    71       GenerationalDistanceResultParameter.ActualValue.Value = distance;
    72 
     68      var q = qualities.Select(x => x.ToArray());
     69      GenerationalDistanceResultParameter.ActualValue.Value = GenerationalDistance.Calculate(q, optimalfront, Dampening);
    7370      return base.Apply();
    7471    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/HypervolumeAnalyzer.cs

    r16723 r17225  
    3232namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    3333  [StorableType("13D363E4-76FF-4A5A-9B2C-767D9E880E4B")]
    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")]
    3535  public class HypervolumeAnalyzer : MOTFAnalyzer {
    3636
     
    3838      get { return (ILookupParameter<DoubleArray>)Parameters["ReferencePoint"]; }
    3939    }
     40
    4041    public IResultParameter<DoubleValue> HypervolumeResultParameter {
    4142      get { return (IResultParameter<DoubleValue>)Parameters["Hypervolume"]; }
    4243    }
     44
    4345    public IResultParameter<DoubleValue> BestKnownHypervolumeResultParameter {
    4446      get { return (IResultParameter<DoubleValue>)Parameters["Best known hypervolume"]; }
    4547    }
     48
    4649    public IResultParameter<DoubleValue> HypervolumeDistanceResultParameter {
    4750      get { return (IResultParameter<DoubleValue>)Parameters["Absolute Distance to BestKnownHypervolume"]; }
     
    5356    }
    5457
    55     protected HypervolumeAnalyzer(HypervolumeAnalyzer original, Cloner cloner)
    56       : base(original, cloner) {
    57     }
     58    protected HypervolumeAnalyzer(HypervolumeAnalyzer original, Cloner cloner) : base(original, cloner) {}
     59
    5860    public override IDeepCloneable Clone(Cloner cloner) {
    5961      return new HypervolumeAnalyzer(this, cloner);
     
    6870      BestKnownHypervolumeResultParameter.DefaultValue = new DoubleValue(0);
    6971      HypervolumeDistanceResultParameter.DefaultValue = new DoubleValue(0);
    70 
    71 
    7272    }
    7373
     
    7575      var qualities = QualitiesParameter.ActualValue;
    7676      var testFunction = TestFunctionParameter.ActualValue;
    77       int objectives = qualities[0].Length;
     77      var objectives = qualities[0].Length;
    7878      var referencePoint = ReferencePointParameter.ActualValue;
    7979
    80       double best = BestKnownHypervolumeResultParameter.ActualValue.Value;
     80      var best = BestKnownHypervolumeResultParameter.ActualValue.Value;
    8181      if (referencePoint.SequenceEqual(testFunction.ReferencePoint(objectives))) {
    8282        best = Math.Max(best, testFunction.OptimalHypervolume(objectives));
    8383      }
    8484
    85       IEnumerable<double[]> front = NonDominatedSelect.SelectNonDominatedVectors(qualities.Select(q => q.ToArray()), testFunction.Maximization(objectives), true);
    86 
    87       double hv = Hypervolume.Calculate(front, referencePoint.ToArray(), testFunction.Maximization(objectives));
     85      var hv = HypervolumeCalculator.CalculateHypervolume(qualities.Select(x=>x.CloneAsArray()).ToArray(), referencePoint.ToArray(), testFunction.Maximization(objectives));
    8886
    8987      if (hv > best) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/InvertedGenerationalDistanceAnalyzer.cs

    r16723 r17225  
    3030namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    3131  [StorableType("EC99F3C1-D8D2-4738-9523-0D07438647A5")]
    32   [Item("InvertedGenerationalDistanceAnalyzer", "The 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")]
    3333  public class InvertedGenerationalDistanceAnalyzer : MOTFAnalyzer {
    34     public override bool EnabledByDefault { get { return false; } }
     34    public override bool EnabledByDefault {
     35      get { return false; }
     36    }
    3537
    3638    private IFixedValueParameter<DoubleValue> DampeningParameter {
     
    5153      Parameters.Add(new ResultParameter<DoubleValue>("Inverted Generational Distance", "The genrational distance between the current front and the optimal front"));
    5254      InvertedGenerationalDistanceResultParameter.DefaultValue = new DoubleValue(double.NaN);
    53 
    5455    }
    5556
     
    6465    public override IOperation Apply() {
    6566      var qualities = QualitiesParameter.ActualValue;
    66       var testFunction = TestFunctionParameter.ActualValue;
    67       int objectives = qualities[0].Length;
    68 
    69       var optimalfront = testFunction.OptimalParetoFront(objectives);
     67      var optimalfront = TestFunctionParameter.ActualValue.OptimalParetoFront(qualities[0].Length);
    7068      if (optimalfront == null) return base.Apply();
    7169
    72       var invertedGenerationalDistance = InvertedGenerationalDistance.Calculate(qualities.Select(q => q.ToArray()), optimalfront, DampeningParameter.Value.Value);
    73       InvertedGenerationalDistanceResultParameter.ActualValue.Value = invertedGenerationalDistance;
    74 
     70      var q = qualities.Select(x => x.ToArray());
     71      InvertedGenerationalDistanceResultParameter.ActualValue.Value = InvertedGenerationalDistance.Calculate(q, optimalfront, Dampening);
    7572      return base.Apply();
    7673    }
    77 
    78 
    7974  }
    8075}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/MOTFAnalyzer.cs

    r16723 r17225  
    3333  [StorableType("CFBB2CAB-C1B7-4F14-9A01-6D5624B7B681")]
    3434  public abstract class MOTFAnalyzer : SingleSuccessorOperator, IMultiObjectiveTestFunctionAnalyzer {
    35     public virtual bool EnabledByDefault { get { return true; } }
     35    public virtual bool EnabledByDefault {
     36      get { return true; }
     37    }
    3638
    3739    public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/ScatterPlotAnalyzer.cs

    r16723 r17225  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Data;
    2526using HeuristicLab.Encodings.RealVectorEncoding;
    2627using HeuristicLab.Optimization;
     
    4142    }
    4243
    43 
    4444    [StorableConstructor]
    4545    protected ScatterPlotAnalyzer(StorableConstructorFlag _) : base(_) { }
     
    5252      Parameters.Add(new ScopeTreeLookupParameter<RealVector>("Individuals", "The individual solutions to the problem"));
    5353      Parameters.Add(new ResultParameter<ParetoFrontScatterPlot>("Scatterplot", "The scatterplot for the current and optimal (if known front)"));
    54 
    5554    }
    5655
     
    5958      var individuals = IndividualsParameter.ActualValue;
    6059      var testFunction = TestFunctionParameter.ActualValue;
    61       int objectives = qualities[0].Length;
    62       int problemSize = individuals[0].Length;
     60      var objectives = qualities.Length != 0 ? qualities[0].Length:0;   
     61      var problemSize = individuals.Length != 0 ? individuals[0].Length:0;
    6362
    64       double[][] optimalFront = new double[0][];
    65       var front = testFunction.OptimalParetoFront(objectives);
    66       if (front != null) optimalFront = front.ToArray();
     63      var optimalFront = new double[0][];               
     64      if (testFunction != null) {
     65        var front = testFunction.OptimalParetoFront(objectives);
     66        if (front != null) optimalFront = front.ToArray();
     67      }
     68      else {
     69        var mat = BestKnownFrontParameter.ActualValue;
     70        optimalFront = mat == null ? null : Enumerable.Range(0, mat.Rows).Select(r => Enumerable.Range(0, mat.Columns).Select(c => mat[r, c]).ToArray()).ToArray();
     71      }
    6772
    6873      var qualityClones = qualities.Select(s => s.ToArray()).ToArray();
     
    7075
    7176      ScatterPlotResultParameter.ActualValue = new ParetoFrontScatterPlot(qualityClones, solutionClones, optimalFront, objectives, problemSize);
    72 
    7377      return base.Apply();
    7478    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/SpacingAnalyzer.cs

    r16723 r17225  
    2121
    2222using System.Linq;
     23using HEAL.Attic;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
    2627using HeuristicLab.Optimization;
    27 using HEAL.Attic;
    2828
    2929namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    3030  [StorableType("F32027A7-3116-4864-A404-820F866BFD65")]
    31   [Item("SpacingAnalyzer", "The 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")]
    3232  public class SpacingAnalyzer : MOTFAnalyzer {
    3333
     
    3535      get { return (IResultParameter<DoubleValue>)Parameters["Spacing"]; }
    3636    }
     37
    3738    [StorableConstructor]
    3839    protected SpacingAnalyzer(StorableConstructorFlag _) : base(_) { }
    39 
    4040
    4141    protected SpacingAnalyzer(SpacingAnalyzer original, Cloner cloner) : base(original, cloner) { }
     
    5151    public override IOperation Apply() {
    5252      var qualities = QualitiesParameter.ActualValue;
    53       var spacing = Spacing.Calculate(qualities.Select(q => q.ToArray()));
    54       SpacingResultParameter.ActualValue.Value = spacing;
    55 
     53      var q = qualities.Select(x => x.ToArray());
     54      SpacingResultParameter.ActualValue.Value = Spacing.Calculate(q);
    5655      return base.Apply();
    5756    }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/HeuristicLab.Problems.TestFunctions.MultiObjective-3.3.csproj

    r16723 r17225  
    174174  </ItemGroup>
    175175  <ItemGroup>
     176    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
     177      <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project>
     178      <Name>HeuristicLab.Analysis-3.3</Name>
     179      <Private>False</Private>
     180    </ProjectReference>
    176181    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    177182      <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Interfaces/IMultiObjectiveTestFunction.cs

    r16723 r17225  
    3434    double[,] Bounds(int objectives);
    3535
    36     IEnumerable<double[]> OptimalParetoFront(int objectives);
     36    IList<double[]> OptimalParetoFront(int objectives);
    3737    double OptimalHypervolume(int objectives);
    3838    double[] ReferencePoint(int objectives);
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/MultiObjectiveTestFunctionProblem.cs

    r16950 r17225  
    2323using System.Linq;
    2424using HEAL.Attic;
     25using HeuristicLab.Analysis;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
     
    3536  [Creatable(CreatableAttribute.Categories.Problems, Priority = 95)]
    3637  [Item("Test Function (multi-objective)", "Test functions with real valued inputs and multiple objectives.")]
    37   public class MultiObjectiveTestFunctionProblem : RealVectorMultiObjectiveProblem,
    38     IProblemInstanceConsumer<MOTFData> {
    39 
     38  public class MultiObjectiveTestFunctionProblem : RealVectorMultiObjectiveProblem, IProblemInstanceConsumer<MOTFData>, IMultiObjectiveProblemDefinition<RealVectorEncoding, RealVector> {
    4039    #region Parameter Properties
    4140    public IFixedValueParameter<IntValue> ProblemSizeParameter {
     
    5150      get { return (IValueParameter<IMultiObjectiveTestFunction>)Parameters["TestFunction"]; }
    5251    }
    53     public IValueParameter<DoubleArray> ReferencePointParameter {
    54       get { return (IValueParameter<DoubleArray>)Parameters["ReferencePoint"]; }
    55     }
    56     public OptionalValueParameter<DoubleMatrix> BestKnownFrontParameter {
    57       get { return (OptionalValueParameter<DoubleMatrix>)Parameters["BestKnownFront"]; }
    58     }
    59 
    6052    #endregion
    6153
     
    8577      set { TestFunctionParameter.Value = value; }
    8678    }
    87     public DoubleArray ReferencePoint {
    88       get { return ReferencePointParameter.Value; }
    89       set { ReferencePointParameter.Value = value; }
    90     }
    91     public DoubleMatrix BestKnownFront {
    92       get { return BestKnownFrontParameter.Value; }
    93       set { BestKnownFrontParameter.Value = value; }
    94     }
    9579    #endregion
    9680
     
    10286    }
    10387
    104     protected MultiObjectiveTestFunctionProblem(MultiObjectiveTestFunctionProblem original, Cloner cloner)
    105       : base(original, cloner) {
     88    protected MultiObjectiveTestFunctionProblem(MultiObjectiveTestFunctionProblem original, Cloner cloner) : base(original, cloner) {
    10689      RegisterEventHandlers();
    10790    }
     
    11093    }
    11194
    112     public MultiObjectiveTestFunctionProblem()
    113       : base() {
     95    public MultiObjectiveTestFunctionProblem() : base() {
    11496      Parameters.Add(new FixedValueParameter<IntValue>("ProblemSize", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(2)));
    11597      Parameters.Add(new FixedValueParameter<IntValue>("Objectives", "The dimensionality of the solution vector (number of objectives).", new IntValue(2)));
    11698      Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The bounds of the solution given as either one line for all variables or a line for each variable. The first column specifies lower bound, the second upper bound.", new DoubleMatrix(new double[,] { { -4, 4 } })));
    117       Parameters.Add(new ValueParameter<DoubleArray>("ReferencePoint", "The reference point used for hypervolume calculation."));
    11899      Parameters.Add(new ValueParameter<IMultiObjectiveTestFunction>("TestFunction", "The function that is to be optimized.", new Fonseca()));
    119       Parameters.Add(new OptionalValueParameter<DoubleMatrix>("BestKnownFront", "The currently best known Pareto front"));
    120100
    121101      Encoding.LengthParameter = ProblemSizeParameter;
     
    137117    public override void Analyze(RealVector[] solutions, double[][] qualities, ResultCollection results, IRandom random) {
    138118      base.Analyze(solutions, qualities, results, random);
    139       if (results.ContainsKey("Pareto Front")) {
     119      if (results.ContainsKey("Pareto Front"))
    140120        ((DoubleMatrix)results["Pareto Front"].Value).SortableView = true;
    141       }
    142121    }
    143122
     
    149128    public double[] CheckContraints(RealVector individual) {
    150129      var constrainedTestFunction = (IConstrainedTestFunction)TestFunction;
    151       if (constrainedTestFunction != null) {
    152         return constrainedTestFunction.CheckConstraints(individual, Objectives);
    153       }
    154       return new double[0];
     130      return constrainedTestFunction != null ? constrainedTestFunction.CheckConstraints(individual, Objectives) : new double[0];
    155131    }
    156132
     
    166142    #region Events
    167143    private void UpdateParameterValues() {
    168       MaximizationParameter.Value = (BoolArray)new BoolArray(TestFunction.Maximization(Objectives)).AsReadOnly();
    169 
     144      Parameters.Remove(MaximizationParameterName);
     145      Parameters.Add(new FixedValueParameter<BoolArray>(MaximizationParameterName, "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(TestFunction.Maximization(Objectives)).AsReadOnly()));
     146
     147      Parameters.Remove(BestKnownFrontParameterName);
    170148      var front = TestFunction.OptimalParetoFront(Objectives);
    171       if (front != null) {
    172         BestKnownFrontParameter.Value = (DoubleMatrix)Utilities.ToMatrix(front).AsReadOnly();
    173       } else BestKnownFrontParameter.Value = null;
    174 
     149      var bkf = front != null ? (DoubleMatrix)Utilities.ToMatrix(front).AsReadOnly() : null;
     150      Parameters.Add(new FixedValueParameter<DoubleMatrix>(BestKnownFrontParameterName, "A double matrix representing the best known qualites for this problem (aka points on the Pareto front). Points are to be given in a row-wise fashion.", bkf));
     151
     152      Parameters.Remove(ReferencePointParameterName);
     153      Parameters.Add(new FixedValueParameter<DoubleArray>(ReferencePointParameterName, "The refrence point for hypervolume calculations on this problem", new DoubleArray(TestFunction.ReferencePoint(Objectives))));
    175154
    176155      BoundsParameter.Value = new DoubleMatrix(TestFunction.Bounds(Objectives));
    177       ReferencePointParameter.Value = new DoubleArray(TestFunction.ReferencePoint(Objectives));
    178156    }
    179157
     
    183161      ParameterizeAnalyzers();
    184162    }
     163
    185164    protected override void OnEvaluatorChanged() {
    186165      base.OnEvaluatorChanged();
     
    192171      ProblemSize = Math.Max(TestFunction.MinimumSolutionLength, Math.Min(ProblemSize, TestFunction.MaximumSolutionLength));
    193172      Objectives = Math.Max(TestFunction.MinimumObjectives, Math.Min(Objectives, TestFunction.MaximumObjectives));
    194       ReferencePointParameter.ActualValue = new DoubleArray(TestFunction.ReferencePoint(Objectives));
     173      Parameters.Remove(ReferencePointParameterName);
     174      Parameters.Add(new FixedValueParameter<DoubleArray>(ReferencePointParameterName, "The refrence point for hypervolume calculations on this problem", new DoubleArray(TestFunction.ReferencePoint(Objectives))));
    195175      ParameterizeAnalyzers();
    196176      UpdateParameterValues();
     
    207187      UpdateParameterValues();
    208188    }
    209 
    210189    #endregion
    211190
     
    217196      Operators.Add(new HypervolumeAnalyzer());
    218197      Operators.Add(new SpacingAnalyzer());
     198      Operators.Add(new TimelineAnalyzer());
    219199      Operators.Add(new ScatterPlotAnalyzer());
    220 
    221200      ParameterizeAnalyzers();
    222201    }
     
    232211        analyzer.TestFunctionParameter.ActualName = TestFunctionParameter.Name;
    233212        analyzer.BestKnownFrontParameter.ActualName = BestKnownFrontParameter.Name;
    234 
    235         var crowdingAnalyzer = analyzer as CrowdingAnalyzer;
    236         if (crowdingAnalyzer != null) {
    237           crowdingAnalyzer.BoundsParameter.ActualName = BoundsParameter.Name;
    238         }
    239 
    240213        var scatterPlotAnalyzer = analyzer as ScatterPlotAnalyzer;
    241         if (scatterPlotAnalyzer != null) {
     214        if (scatterPlotAnalyzer != null)
    242215          scatterPlotAnalyzer.IndividualsParameter.ActualName = Encoding.Name;
    243         }
    244216      }
    245217    }
    246 
    247218    #endregion
    248219  }
    249220}
    250 
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/DTLZ/DTLZ.cs

    r16723 r17225  
    2828  [StorableType("3ED6C22E-EA6E-4336-BC49-884CE151E514")]
    2929  public abstract class DTLZ : MultiObjectiveTestFunction {
    30     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     30    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3131      if (objectives == 2) return ParetoFrontStore.GetParetoFront("DTLZ.ParetoFronts." + this.ItemName + ".2D");
    3232      return null;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR1.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3031  [StorableType("16DF9415-9D12-4FB9-A985-7EEAE05A24CA")]
    3132  public class IHR1 : IHR {
    32     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     33    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3334      List<double[]> res = new List<double[]>();
    3435      for (int i = 0; i <= 500; i++) {
     
    4142
    4243    protected override double GetBestKnownHypervolume(int objectives) {
    43       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     44      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4445    }
    4546
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR2.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3031  [StorableType("3E06E73F-61CD-4B99-99A8-84E6E9C0EFC9")]
    3132  public class IHR2 : IHR {
    32     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     33    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3334      List<double[]> res = new List<double[]>();
    3435      for (int i = 0; i <= 500; i++) {
     
    4243
    4344    protected override double GetBestKnownHypervolume(int objectives) {
    44       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     45      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4546    }
    4647
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR3.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3031  [StorableType("316D5351-762D-4883-ACEF-06F4EAFA73AE")]
    3132  public class IHR3 : IHR {
    32     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     33    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3334      List<double[]> res = new List<double[]>();
    3435      for (int i = 0; i <= 500; i++) {
     
    4243
    4344    protected override double GetBestKnownHypervolume(int objectives) {
    44       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     45      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4546    }
    4647
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR4.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3031  [StorableType("E83A9E6E-F7B3-4B27-B5CA-A323D89844F5")]
    3132  public class IHR4 : IHR {
    32     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     33    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3334      List<double[]> res = new List<double[]>();
    3435      for (int i = 0; i <= 500; i++) {
     
    4142
    4243    protected override double GetBestKnownHypervolume(int objectives) {
    43       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     44      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4445    }
    4546
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR6.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3031  [StorableType("5C0A4163-831B-4507-997F-A70B59E3A445")]
    3132  public class IHR6 : IHR {
    32     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     33    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3334      List<double[]> res = new List<double[]>();
    3435      for (int i = 0; i <= 500; i++) {
     
    4142
    4243    protected override double GetBestKnownHypervolume(int objectives) {
    43       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     44      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4445    }
    4546
     
    4748    protected IHR6(StorableConstructorFlag _) : base(_) { }
    4849    protected IHR6(IHR6 original, Cloner cloner) : base(original, cloner) { }
    49     public IHR6() : base() {
    50     }
     50    public IHR6() : base() { }
    5151
    5252    public override IDeepCloneable Clone(Cloner cloner) {
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/CIGTAB.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3132  public class CIGTAB : MultiObjectiveTestFunction {
    3233    protected override double[,] GetBounds(int objectives) {
    33       return new double[,] { { -10, 10 } };
     34      return new double[,] {{-10, 10}};
    3435    }
    3536
     
    3940
    4041    protected override double[] GetReferencePoint(int objecitves) {
    41       return new double[] { 11, 11 };
     42      return new double[] {11, 11};
    4243    }
    4344
    44     protected override IEnumerable<double[]> GetOptimalParetoFront(int objecitves) {
     45    protected override IList<double[]> GetOptimalParetoFront(int objecitves) {
    4546      List<double[]> res = new List<double[]>();
    4647      for (int i = 0; i <= 500; i++) {
     
    5455
    5556    protected override double GetBestKnownHypervolume(int objectives) {
    56       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     57      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    5758    }
    5859
     
    8990      double f1 = 1 / (a * a * r.Length) * sum;
    9091
    91       return new double[] { f0, f1 };
     92      return new double[] {f0, f1};
    9293    }
    9394  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/ELLI1.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3132  public class ELLI : MultiObjectiveTestFunction {
    3233    protected override double[,] GetBounds(int objectives) {
    33       return new double[,] { { -10, 10 } };
     34      return new double[,] {{-10, 10}};
    3435    }
    3536
     
    3940
    4041    protected override double[] GetReferencePoint(int objecitves) {
    41       return new double[] { 11, 11 };
     42      return new double[] {11, 11};
    4243    }
    4344
    44     protected override IEnumerable<double[]> GetOptimalParetoFront(int objecitves) {
     45    protected override IList<double[]> GetOptimalParetoFront(int objecitves) {
    4546      List<double[]> res = new List<double[]>();
    4647      for (int i = 0; i <= 500; i++) {
     
    5455
    5556    protected override double GetBestKnownHypervolume(int objectives) {
    56       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     57      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    5758    }
    5859
     
    8485      double f1 = 1 / (a * a * r.Length) * sum;
    8586
    86       return new double[] { f0, f1 };
     87      return new double[] {f0, f1};
    8788    }
    8889  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/Fonseca.cs

    r16807 r17225  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    2728using HeuristicLab.Encodings.RealVectorEncoding;
     29using HeuristicLab.Optimization;
    2830
    2931namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
     
    3234  public class Fonseca : MultiObjectiveTestFunction {
    3335    protected override double[,] GetBounds(int objectives) {
    34       return new double[,] { { -4, 4 } };
     36      return new double[,] {{-4, 4}};
    3537    }
    3638
     
    3941    }
    4042
    41     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
    42       return ParetoFrontStore.GetParetoFront("Misc.ParetoFronts." + this.ItemName);
     43    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
     44      return ParetoFrontStore.GetParetoFront("Misc.ParetoFronts." + this.ItemName).ToList();
    4345    }
    4446
    4547    protected override double GetBestKnownHypervolume(int objectives) {
    46       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     48      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4749    }
    4850
    4951    protected override double[] GetReferencePoint(int objectives) {
    50       return new double[] { 11, 11 };
     52      return new double[] {11, 11};
    5153    }
    5254
     
    7981      f1 = 1 - Math.Exp(-f1);
    8082
    81       double[] res = { f0, f1 };
     83      double[] res = {f0, f1};
    8284      return res;
    8385    }
    84 
    8586  }
    8687}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/Kursawe.cs

    r16723 r17225  
    2121using System;
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Encodings.RealVectorEncoding;
     27using HeuristicLab.Optimization;
    2628using HEAL.Attic;
    2729
     
    3133  public class Kursawe : MultiObjectiveTestFunction {
    3234    protected override double[,] GetBounds(int objectives) {
    33       return new double[,] { { -5, 5 } };
     35      return new double[,] {{-5, 5}};
    3436    }
    3537
     
    3840    }
    3941
    40     protected override IEnumerable<double[]> GetOptimalParetoFront(int objecitves) {
     42    protected override IList<double[]> GetOptimalParetoFront(int objecitves) {
    4143      return ParetoFrontStore.GetParetoFront("Misc.ParetoFronts." + this.ItemName);
    4244    }
    4345
    4446    protected override double GetBestKnownHypervolume(int objectives) {
    45       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     47      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    4648    }
    4749
    4850    protected override double[] GetReferencePoint(int objectives) {
    49       return new double[] { 11, 11 };
     51      return new double[] {11, 11};
    5052    }
    5153
     
    5759    }
    5860    public Kursawe() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 3, maximumSolutionLength: int.MaxValue) { }
    59 
    60 
    61 
    6261
    6362
     
    7574      }
    7675
    77       return new double[] { f0, f1 };
     76      return new double[] {f0, f1};
    7877    }
    7978  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/SchafferN1.cs

    r16723 r17225  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
     26using HeuristicLab.Optimization;
    2627using HEAL.Attic;
    2728
     
    3132  public class SchafferN1 : MultiObjectiveTestFunction {
    3233    protected override double[,] GetBounds(int objectives) {
    33       return new double[,] { { -1e5, 1e5 } };
     34      return new double[,] {{-1e5, 1e5}};
    3435    }
    3536
     
    3940
    4041    protected override double[] GetReferencePoint(int objectives) {
    41       return new double[] { 1e5, 1e5 };
     42      return new double[] {1e5, 1e5};
    4243    }
    4344
    4445
    45     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     46    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    4647      return ParetoFrontStore.GetParetoFront("Misc.ParetoFronts." + "SchafferN1");
    4748    }
    4849
    4950    protected override double GetBestKnownHypervolume(int objectives) {
    50       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     51      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
    5152    }
    5253
     
    7273      f1 *= f1;
    7374
    74       return new double[] { f0, f1 };
     75      return new double[] {f0, f1};
    7576    }
    7677  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/SchafferN2.cs

    r16723 r17225  
    3131  public class SchafferN2 : MultiObjectiveTestFunction {
    3232    protected override double[,] GetBounds(int objectives) {
    33       return new double[,] { { -5, 10 } };
     33      return new double[,] {{-5, 10}};
    3434    }
    3535
     
    3939
    4040    protected override double[] GetReferencePoint(int objecitves) {
    41       return new double[] { 100, 100 };
     41      return new double[] {100, 100};
    4242    }
    4343
    4444
    45     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     45    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    4646      return null;
    4747    }
     
    7272      f1 *= f1;
    7373
    74       return new double[] { f0, f1 };
     74      return new double[] {f0, f1};
    7575    }
    7676  }
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/MultiObjectiveTestFunction.cs

    r16950 r17225  
    8787    /// retrieves the optimal pareto front (if known from a file)
    8888    /// </summary>
    89     public IEnumerable<double[]> OptimalParetoFront(int objectives) {
     89    public IList<double[]> OptimalParetoFront(int objectives) {
    9090      ThrowIfObjectivesOutOfRange(objectives);
    9191      return GetOptimalParetoFront(objectives);
    9292    }
    93     protected abstract IEnumerable<double[]> GetOptimalParetoFront(int objectives);
     93    protected abstract IList<double[]> GetOptimalParetoFront(int objectives);
    9494
    9595    /// <summary>
     
    132132      Parameters.Add(new FixedValueParameter<IntValue>("Minimum Objectives",
    133133        "The dimensionality of the problem instance (number of variables in the function).",
    134         (IntValue)new IntValue(minimumObjectives).AsReadOnly()) { GetsCollected = false });
    135       Parameters.Add(new FixedValueParameter<IntValue>("Maximum Objectives", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(maximumObjectives).AsReadOnly()) { GetsCollected = false });
    136       Parameters.Add(new FixedValueParameter<IntValue>("Minimum SolutionLength", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(minimumSolutionLength).AsReadOnly()) { GetsCollected = false });
    137       Parameters.Add(new FixedValueParameter<IntValue>("Maximum SolutionLength", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(maximumSolutionLength).AsReadOnly()) { GetsCollected = false });
     134        (IntValue)new IntValue(minimumObjectives).AsReadOnly()) {GetsCollected = false});
     135      Parameters.Add(new FixedValueParameter<IntValue>("Maximum Objectives", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(maximumObjectives).AsReadOnly()) {GetsCollected = false});
     136      Parameters.Add(new FixedValueParameter<IntValue>("Minimum SolutionLength", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(minimumSolutionLength).AsReadOnly()) {GetsCollected = false});
     137      Parameters.Add(new FixedValueParameter<IntValue>("Maximum SolutionLength", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(maximumSolutionLength).AsReadOnly()) {GetsCollected = false});
    138138
    139139      MinimumObjectives = minimumObjectives;
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ParetoFrontStore.cs

    r16723 r17225  
    2828namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
    2929  internal class ParetoFrontStore {
    30     internal static IEnumerable<double[]> GetParetoFront(String filename) {
     30    internal static IList<double[]> GetParetoFront(String filename) {
    3131      List<double[]> data = new List<double[]>();
    3232      var assembly = Assembly.GetExecutingAssembly();
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT/ZDT.cs

    r16723 r17225  
    2828  [StorableType("A8192C08-A1DA-479A-9381-9B634761B521")]
    2929  public abstract class ZDT : MultiObjectiveTestFunction {
    30     protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) {
     30    protected override IList<double[]> GetOptimalParetoFront(int objectives) {
    3131      return ParetoFrontStore.GetParetoFront("ZDT.ParetoFronts." + this.ItemName);
    3232    }
    3333
    3434    protected override double[,] GetBounds(int objectives) {
    35       return new double[,] { { 0, 1 } };
     35      return new double[,] {{0, 1}};
    3636    }
    3737
     
    4141
    4242    protected override double[] GetReferencePoint(int objecitives) {
    43       return new double[] { 11.0, 11.0 };
     43      return new double[] {11.0, 11.0};
    4444    }
    4545
     
    5151    protected ZDT(StorableConstructorFlag _) : base(_) { }
    5252    protected ZDT(MultiObjectiveTestFunction original, Cloner cloner)
    53       : base(original, cloner) {
    54     }
     53      : base(original, cloner) { }
    5554    protected ZDT() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 1, maximumSolutionLength: int.MaxValue) { }
    5655
Note: See TracChangeset for help on using the changeset viewer.