Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/03/19 14:49:46 (5 years ago)
Author:
abeham
Message:

#2521: Refactored ParetoFrontScatterPlot (moved from TestFunctions.MultiObjective to Analysis)

  • Introduced generic type that may work with all solution encodings
Location:
branches/2521_ProblemRefactoring/HeuristicLab.Analysis/3.3
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj

    r17225 r17229  
    155155    <Compile Include="MultiObjective\InvertedGenerationalDistanceAnalyzer.cs" />
    156156    <Compile Include="MultiObjective\MultiObjectiveSuccessAnalyzer.cs" />
     157    <Compile Include="MultiObjective\ParetoFrontScatterPlot.cs" />
    157158    <Compile Include="MultiObjective\RankBasedParetoFrontAnalyzer.cs" />
    158159    <Compile Include="MultiObjective\ParetoFrontAnalyzer.cs" />
  • branches/2521_ProblemRefactoring/HeuristicLab.Analysis/3.3/MultiObjective/ParetoFrontScatterPlot.cs

    r17228 r17229  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using System.Drawing;
    2325using System.Linq;
     26using HEAL.Attic;
    2427using HeuristicLab.Common;
    2528using HeuristicLab.Core;
    26 using HEAL.Attic;
    2729
    28 namespace HeuristicLab.Problems.TestFunctions.MultiObjective {
     30namespace HeuristicLab.Analysis {
     31  [StorableType("1bc5f640-ed3a-49dd-9dca-aa034cc81e12")]
     32  [Item("Pareto Front Scatter Plot", "The optimal front, current front(s) and associated items.")]
     33  public class ParetoFrontScatterPlot<T> : Item where T: class, IItem {
     34
     35    public static new Image StaticItemImage {
     36      get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; }
     37    }
     38
     39    [Storable]
     40    private int objectives;
     41    public int Objectives {
     42      get { return objectives; }
     43    }
     44
     45    [Storable]
     46    private IList<double[][]> fronts;
     47    public IList<double[][]> Fronts {
     48      get { return fronts; }
     49    }
     50
     51    [Storable]
     52    private IList<T[]> items;
     53    public IList<T[]> Items {
     54      get { return items; }
     55    }
     56
     57    [Storable]
     58    private IList<double[]> bestKnownFront;
     59    public IList<double[]> BestKnownFront {
     60      get { return bestKnownFront; }
     61    }
     62
     63    [StorableConstructor]
     64    protected ParetoFrontScatterPlot(StorableConstructorFlag _) : base(_) { }
     65    public ParetoFrontScatterPlot() { }
     66    public ParetoFrontScatterPlot(IList<double[][]> qualities, IList<T[]> items, IList<double[]> paretoFront, int objectives) {
     67      this.fronts = qualities;
     68      this.items = items;
     69      this.bestKnownFront = paretoFront;
     70      this.objectives = objectives;
     71    }
     72    protected ParetoFrontScatterPlot(ParetoFrontScatterPlot<T> original, Cloner cloner)
     73      : base(original, cloner) {
     74      if (original.fronts != null) fronts = original.fronts.Select(s => s.Select(x => x.ToArray()).ToArray()).ToArray();
     75      if (original.items != null) items = original.items.Select(s => s.Select(cloner.Clone).ToArray()).ToArray();
     76      if (original.bestKnownFront != null) bestKnownFront = original.bestKnownFront.Select(s => s.ToArray()).ToArray();
     77      objectives = original.objectives;
     78    }
     79    public override IDeepCloneable Clone(Cloner cloner) {
     80      return new ParetoFrontScatterPlot<T>(this, cloner);
     81    }
     82  }
     83
    2984  [StorableType("3BF7AD0E-8D55-4033-974A-01DB16F9E41A")]
    3085  [Item("Pareto Front Scatter Plot", "The optimal front, current front and its associated Points in the searchspace")]
     86  [Obsolete("Use the generic ParetoFrontScatterPlot<T> instead.")]
    3187  public class ParetoFrontScatterPlot : Item {
    3288    public static new Image StaticItemImage {
Note: See TracChangeset for help on using the changeset viewer.