Changeset 17229
- Timestamp:
- 09/03/19 14:49:46 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 added
- 8 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj
r16723 r17229 144 144 <DependentUpon>IndexedDataTableView.cs</DependentUpon> 145 145 </Compile> 146 <Compile Include="ParetoFrontScatterPlotViewOfT.cs"> 147 <SubType>UserControl</SubType> 148 </Compile> 149 <Compile Include="ParetoFrontScatterPlotViewOfT.Designer.cs"> 150 <DependentUpon>ParetoFrontScatterPlotViewOfT.cs</DependentUpon> 151 </Compile> 152 <Compile Include="ParetoFrontScatterPlotView.cs"> 153 <SubType>UserControl</SubType> 154 </Compile> 155 <Compile Include="ParetoFrontScatterPlotView.Designer.cs"> 156 <DependentUpon>ParetoFrontScatterPlotView.cs</DependentUpon> 157 </Compile> 146 158 <Compile Include="ScatterPlotView.cs"> 147 159 <SubType>UserControl</SubType> -
branches/2521_ProblemRefactoring/HeuristicLab.Analysis.Views/3.3/ParetoFrontScatterPlotView.Designer.cs
r17228 r17229 20 20 #endregion 21 21 22 namespace HeuristicLab. Problems.TestFunctions.Views {22 namespace HeuristicLab.Analysis.Views { 23 23 partial class ParetoFrontScatterPlotView { 24 24 /// <summary> -
branches/2521_ProblemRefactoring/HeuristicLab.Analysis.Views/3.3/ParetoFrontScatterPlotView.cs
r17228 r17229 22 22 using System; 23 23 using System.Linq; 24 using HeuristicLab.Analysis;25 24 using HeuristicLab.Common; 26 25 using HeuristicLab.Core.Views; 27 26 using HeuristicLab.MainForm; 28 using HeuristicLab.Problems.TestFunctions.MultiObjective;29 27 30 namespace HeuristicLab. Problems.TestFunctions.Views {28 namespace HeuristicLab.Analysis.Views { 31 29 [View("Scatter Plot")] 30 #pragma warning disable CS0618 // Type or member is obsolete 32 31 [Content(typeof(ParetoFrontScatterPlot))] 32 #pragma warning restore CS0618 // Type or member is obsolete 33 33 public partial class ParetoFrontScatterPlotView : ItemView { 34 34 … … 42 42 private bool suppressEvents; 43 43 44 #pragma warning disable CS0618 // Type or member is obsolete 44 45 public new ParetoFrontScatterPlot Content { 45 46 get { return (ParetoFrontScatterPlot)base.Content; } 46 47 set { base.Content = value; } 47 48 } 49 #pragma warning restore CS0618 // Type or member is obsolete 48 50 49 51 public ParetoFrontScatterPlotView() { -
branches/2521_ProblemRefactoring/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r17225 r17229 155 155 <Compile Include="MultiObjective\InvertedGenerationalDistanceAnalyzer.cs" /> 156 156 <Compile Include="MultiObjective\MultiObjectiveSuccessAnalyzer.cs" /> 157 <Compile Include="MultiObjective\ParetoFrontScatterPlot.cs" /> 157 158 <Compile Include="MultiObjective\RankBasedParetoFrontAnalyzer.cs" /> 158 159 <Compile Include="MultiObjective\ParetoFrontAnalyzer.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Analysis/3.3/MultiObjective/ParetoFrontScatterPlot.cs
r17228 r17229 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 22 24 using System.Drawing; 23 25 using System.Linq; 26 using HEAL.Attic; 24 27 using HeuristicLab.Common; 25 28 using HeuristicLab.Core; 26 using HEAL.Attic;27 29 28 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { 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 29 84 [StorableType("3BF7AD0E-8D55-4033-974A-01DB16F9E41A")] 30 85 [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.")] 31 87 public class ParetoFrontScatterPlot : Item { 32 88 public static new Image StaticItemImage { -
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorProblem.cs
r17226 r17229 1 #region License Information 1 2 #region License Information 2 3 /* HeuristicLab 3 4 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) -
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r16723 r17229 130 130 <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" /> 131 131 <Compile Include="Grammars\GrammarUtils.cs" /> 132 <Compile Include="SymbolicExpressionTreeMultiObjectiveProblem.cs" /> 132 133 <Compile Include="SymbolicExpressionTreeProblem.cs" /> 133 134 <Compile Include="Compiler\Instruction.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeProblem.cs
r17226 r17229 71 71 } 72 72 } 73 74 protected override void OnEncodingChanged() { 75 base.OnEncodingChanged(); 76 Parameterize(); 77 } 78 79 private void Parameterize() { 80 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 81 similarityCalculator.SolutionVariableName = Encoding.Name; 82 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 83 } 84 } 73 85 } 74 86 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/Analyzers/ScatterPlotAnalyzer.cs
r17226 r17229 21 21 22 22 using System.Linq; 23 using HEAL.Attic; 24 using HeuristicLab.Analysis; 23 25 using HeuristicLab.Common; 24 26 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 27 using HeuristicLab.Encodings.RealVectorEncoding; 27 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { … … 38 38 } 39 39 40 public IResultParameter<ParetoFrontScatterPlot > ScatterPlotResultParameter {41 get { return (IResultParameter<ParetoFrontScatterPlot >)Parameters["Scatterplot"]; }40 public IResultParameter<ParetoFrontScatterPlot<RealVector>> ScatterPlotResultParameter { 41 get { return (IResultParameter<ParetoFrontScatterPlot<RealVector>>)Parameters["Scatterplot"]; } 42 42 } 43 43 … … 51 51 public ScatterPlotAnalyzer() { 52 52 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("Individuals", "The individual solutions to the problem")); 53 Parameters.Add(new ResultParameter<ParetoFrontScatterPlot >("Scatterplot", "The scatterplot for the current and optimal (if known front)"));53 Parameters.Add(new ResultParameter<ParetoFrontScatterPlot<RealVector>>("Scatterplot", "The scatterplot for the current and optimal (if known front)")); 54 54 } 55 55 … … 58 58 var individuals = IndividualsParameter.ActualValue; 59 59 var testFunction = TestFunctionParameter.ActualValue; 60 var objectives = qualities.Length != 0 ? qualities[0].Length:0; 61 var problemSize = individuals.Length != 0 ? individuals[0].Length:0; 60 var objectives = qualities.Length != 0 ? qualities[0].Length:0; 62 61 63 62 var optimalFront = new double[0][]; … … 71 70 } 72 71 73 var qualityClones = qualities.Select(s => s.ToArray()).ToArray(); 74 var solutionClones = individuals.Select(s => s.ToArray()).ToArray(); 75 76 ScatterPlotResultParameter.ActualValue = new ParetoFrontScatterPlot(qualityClones, solutionClones, optimalFront, objectives, problemSize); 72 var fronts = DominationCalculator.CalculateAllParetoFronts(individuals.ToArray(), qualities.Select(x => x.ToArray()).ToArray(), testFunction.Maximization(objectives), out var rank); 73 74 ScatterPlotResultParameter.ActualValue = new ParetoFrontScatterPlot<RealVector>( 75 fronts.Select(x => x.Select(y => y.Item2).ToArray()).ToArray(), 76 fronts.Select(x => x.Select(y => y.Item1).ToArray()).ToArray(), 77 optimalFront, objectives); 77 78 return base.Apply(); 78 79 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/HeuristicLab.Problems.TestFunctions.MultiObjective-3.3.csproj
r17225 r17229 111 111 <Compile Include="Calculators\InvertedGenerationalDistance.cs" /> 112 112 <Compile Include="Calculators\GenerationalDistance.cs" /> 113 <Compile Include="ParetoFrontScatterPlot.cs" />114 113 <Compile Include="Utilities.cs" /> 115 114 <Compile Include="Instances\MISCInstanceProvider.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.Views/3.3/HeuristicLab.Problems.TestFunctions.Views-3.3.csproj
r16723 r17229 107 107 </ItemGroup> 108 108 <ItemGroup> 109 <Compile Include="ParetoFrontScatterPlotView.cs">110 <SubType>UserControl</SubType>111 </Compile>112 <Compile Include="ParetoFrontScatterPlotView.Designer.cs">113 <DependentUpon>ParetoFrontScatterPlotView.cs</DependentUpon>114 </Compile>115 109 <Compile Include="Plugin.cs" /> 116 110 <Compile Include="Properties\AssemblyInfo.cs" />
Note: See TracChangeset
for help on using the changeset viewer.