[13672] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[17226] | 3 | * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[13672] | 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
[15203] | 21 |
|
---|
[17229] | 22 | using System;
|
---|
| 23 | using System.Collections.Generic;
|
---|
[15221] | 24 | using System.Drawing;
|
---|
[14092] | 25 | using System.Linq;
|
---|
[17229] | 26 | using HEAL.Attic;
|
---|
[13622] | 27 | using HeuristicLab.Common;
|
---|
[14092] | 28 | using HeuristicLab.Core;
|
---|
[13622] | 29 |
|
---|
[17229] | 30 | namespace 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 |
|
---|
[16723] | 84 | [StorableType("3BF7AD0E-8D55-4033-974A-01DB16F9E41A")]
|
---|
[15203] | 85 | [Item("Pareto Front Scatter Plot", "The optimal front, current front and its associated Points in the searchspace")]
|
---|
[17229] | 86 | [Obsolete("Use the generic ParetoFrontScatterPlot<T> instead.")]
|
---|
[15203] | 87 | public class ParetoFrontScatterPlot : Item {
|
---|
[15221] | 88 | public static new Image StaticItemImage {
|
---|
| 89 | get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; }
|
---|
| 90 | }
|
---|
[13622] | 91 |
|
---|
[14092] | 92 | [Storable]
|
---|
[15203] | 93 | private int objectives;
|
---|
| 94 | public int Objectives {
|
---|
| 95 | get { return objectives; }
|
---|
| 96 | }
|
---|
[13622] | 97 |
|
---|
[15203] | 98 | [Storable]
|
---|
| 99 | private int problemSize;
|
---|
| 100 | public int ProblemSize {
|
---|
| 101 | get { return problemSize; }
|
---|
[13988] | 102 | }
|
---|
[13622] | 103 |
|
---|
[14092] | 104 | [Storable]
|
---|
[15203] | 105 | private double[][] qualities;
|
---|
| 106 | public double[][] Qualities {
|
---|
| 107 | get { return qualities; }
|
---|
[13988] | 108 | }
|
---|
[13622] | 109 |
|
---|
[14092] | 110 | [Storable]
|
---|
[13988] | 111 | private double[][] solutions;
|
---|
| 112 | public double[][] Solutions {
|
---|
[15203] | 113 | get { return solutions; }
|
---|
[13988] | 114 | }
|
---|
[13622] | 115 |
|
---|
[14092] | 116 | [Storable]
|
---|
[13988] | 117 | private double[][] paretoFront;
|
---|
| 118 | public double[][] ParetoFront {
|
---|
[15203] | 119 | get { return paretoFront; }
|
---|
[13988] | 120 | }
|
---|
[13622] | 121 |
|
---|
[15203] | 122 | #region Constructor, Cloning & Persistance
|
---|
| 123 | public ParetoFrontScatterPlot(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives, int problemSize) {
|
---|
[13988] | 124 | this.qualities = qualities;
|
---|
| 125 | this.solutions = solutions;
|
---|
| 126 | this.paretoFront = paretoFront;
|
---|
| 127 | this.objectives = objectives;
|
---|
[15203] | 128 | this.problemSize = problemSize;
|
---|
[13988] | 129 | }
|
---|
[15203] | 130 | public ParetoFrontScatterPlot() { }
|
---|
[13622] | 131 |
|
---|
[15203] | 132 | protected ParetoFrontScatterPlot(ParetoFrontScatterPlot original, Cloner cloner)
|
---|
| 133 | : base(original, cloner) {
|
---|
| 134 | if (original.qualities != null) qualities = original.qualities.Select(s => s.ToArray()).ToArray();
|
---|
| 135 | if (original.solutions != null) solutions = original.solutions.Select(s => s.ToArray()).ToArray();
|
---|
| 136 | if (original.paretoFront != null) paretoFront = original.paretoFront.Select(s => s.ToArray()).ToArray();
|
---|
| 137 | objectives = original.objectives;
|
---|
| 138 | problemSize = original.problemSize;
|
---|
| 139 | }
|
---|
[14092] | 140 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
[15203] | 141 | return new ParetoFrontScatterPlot(this, cloner);
|
---|
[13988] | 142 | }
|
---|
[15203] | 143 |
|
---|
| 144 | [StorableConstructor]
|
---|
[16723] | 145 | protected ParetoFrontScatterPlot(StorableConstructorFlag _) : base(_) { }
|
---|
[15203] | 146 | #endregion
|
---|
[13988] | 147 | }
|
---|
[13622] | 148 | }
|
---|