Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/16 13:50:08 (7 years ago)
Author:
bwerth
Message:

#1087 removed NormalizedHypervolumeAnalyzer and IMOFrontModel.cs, refactored ScatterPlotAnalyzer ,fixed bug in HypervolumeAnalyzer

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Views/ScatterPlotContent.cs

    r14091 r14092  
    2121using System;
    2222using System.Drawing;
     23using System.Linq;
    2324using HeuristicLab.Common;
     25using HeuristicLab.Core;
    2426using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2527
    2628namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
    2729  [StorableClass]
    28   public class MOSolution : IMOFrontModel {
    29     public bool CanChangeDescription {
    30       get {
    31         return false;
    32       }
    33     }
     30  public class ScatterPlotContent : Item {
    3431
    35     public bool CanChangeName {
    36       get {
    37         return false;
    38       }
    39     }
    40 
    41     public string Description {
    42       get {
    43         return "MYResult";
    44       }
    45 
    46       set { }
    47     }
    48 
    49     public string Filename {
    50       get { return "MyFilename"; }
    51 
    52       set { }
    53     }
    54 
    55     public string ItemDescription {
    56       get { return "this is MOSolutionImplementation"; }
    57     }
    58 
    59     public Image ItemImage {
    60       get {
    61         return HeuristicLab.Common.Resources.VSImageLibrary.Function;
    62       }
    63     }
    64 
    65     public string ItemName {
    66       get {
    67         return "MOSolution";
    68       }
    69     }
    70 
    71     public Version ItemVersion {
    72       get { return Version.Parse("0.1"); }
    73     }
    74 
    75     public string Name {
    76       get {
    77         return ItemName;
    78       }
    79 
    80       set { }
    81     }
    82 
     32    [Storable]
    8333    private double[][] qualities;
    84 
    8534    public double[][] Qualities {
    8635      get {
     
    9342    }
    9443
     44    [Storable]
    9545    private int objectives;
    9646    public int Objectives {
     
    10454    }
    10555
     56    [Storable]
    10657    private double[][] solutions;
    10758    public double[][] Solutions {
     
    11566    }
    11667
     68    [Storable]
    11769    private double[][] paretoFront;
    11870    public double[][] ParetoFront {
     
    12678    }
    12779
    128     public event EventHandler DescriptionChanged;
    129     public event EventHandler ItemImageChanged;
    130     public event EventHandler NameChanged;
    131     public event EventHandler<CancelEventArgs<string>> NameChanging;
    132     public event EventHandler ToStringChanged;
     80    [StorableConstructor]
     81    protected ScatterPlotContent(bool deserializing) : base() { }
    13382
    134     [StorableConstructor]
    135     protected MOSolution(bool deserializing) : base() { }
    136 
    137 
    138     protected MOSolution(MOSolution original, Cloner cloner) : this(original) {
    139       this.qualities = original.qualities;
    140       this.solutions = original.solutions;
    141       this.paretoFront = original.paretoFront;
     83    protected ScatterPlotContent(ScatterPlotContent original, Cloner cloner) : 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();
    14287      this.objectives = original.objectives;
    14388    }
    144     protected MOSolution(MOSolution original) : base() {
    145       this.qualities = original.qualities;
    146       this.solutions = original.solutions;
    147       this.paretoFront = original.paretoFront;
    148       this.objectives = original.objectives;
    149     }
    150     protected MOSolution() : base() { }
    151     public MOSolution(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) {
     89    protected ScatterPlotContent() : base() { }
     90    public ScatterPlotContent(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) {
    15291      this.qualities = qualities;
    15392      this.solutions = solutions;
     
    15695    }
    15796
    158     public object Clone() {
    159       return new MOSolution(this);
    160     }
    161 
    162     public IDeepCloneable Clone(Cloner cloner) {
    163       return (IDeepCloneable)Clone();
     97    public override IDeepCloneable Clone(Cloner cloner) {
     98      return cloner.Clone(this);
    16499    }
    165100  }
Note: See TracChangeset for help on using the changeset viewer.