Changeset 12771 for branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs
- Timestamp:
- 07/17/15 09:25:44 (9 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerEvaluationsAnalyzer.cs
r12764 r12771 30 30 31 31 namespace HeuristicLab.Analysis { 32 [Item("Quality VsEvaluationsAnalyzer", @"Creates a plot of the solution quality with respect to the number of evaluated solutions.")]32 [Item("QualityPerEvaluationsAnalyzer", @"Creates a plot of the solution quality with respect to the number of evaluated solutions.")] 33 33 [StorableClass] 34 public class Quality VsEvaluationsAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator {34 public class QualityPerEvaluationsAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator { 35 35 public virtual bool EnabledByDefault { 36 36 get { return false; } … … 43 43 get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 44 44 } 45 public IResultParameter<IndexedDataTable< int>> QualityVsEvaluationsParameter {46 get { return (IResultParameter<IndexedDataTable< int>>)Parameters["QualityVsEvaluations"]; }45 public IResultParameter<IndexedDataTable<double>> QualityPerEvaluationsParameter { 46 get { return (IResultParameter<IndexedDataTable<double>>)Parameters["QualityPerEvaluations"]; } 47 47 } 48 48 49 49 [StorableConstructor] 50 protected Quality VsEvaluationsAnalyzer(bool deserializing) : base(deserializing) { }51 protected Quality VsEvaluationsAnalyzer(QualityVsEvaluationsAnalyzer original, Cloner cloner) : base(original, cloner) { }52 public Quality VsEvaluationsAnalyzer()50 protected QualityPerEvaluationsAnalyzer(bool deserializing) : base(deserializing) { } 51 protected QualityPerEvaluationsAnalyzer(QualityPerEvaluationsAnalyzer original, Cloner cloner) : base(original, cloner) { } 52 public QualityPerEvaluationsAnalyzer() 53 53 : base() { 54 54 Parameters.Add(new LookupParameter<DoubleValue>("BestQuality", "The quality value that should be compared.")); 55 55 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The quality value that should be compared.")); 56 Parameters.Add(new ResultParameter<IndexedDataTable<int>>("QualityVsEvaluations", "Data table containing the first hitting graph with evaluations as the x-axis.")); 57 QualityVsEvaluationsParameter.DefaultValue = new IndexedDataTable<int>("Quality vs Evaluations") { 58 Rows = { new IndexedDataRow<int>("First-hit Graph") { VisualProperties = { ChartType = DataRowVisualProperties.DataRowChartType.StepLine } } } 56 Parameters.Add(new ResultParameter<IndexedDataTable<double>>("QualityPerEvaluations", "Data table containing the first hitting graph with evaluations as the x-axis.")); 57 QualityPerEvaluationsParameter.DefaultValue = new IndexedDataTable<double>("Quality per Evaluations") { 58 VisualProperties = { 59 XAxisTitle = "Evaluations", 60 YAxisTitle = "Quality" 61 }, 62 Rows = { new IndexedDataRow<double>("First-hit Graph") { VisualProperties = { 63 ChartType = DataRowVisualProperties.DataRowChartType.StepLine, 64 LineWidth = 3 65 } } } 59 66 }; 60 67 } 61 68 62 69 public override IDeepCloneable Clone(Cloner cloner) { 63 return new Quality VsEvaluationsAnalyzer(this, cloner);70 return new QualityPerEvaluationsAnalyzer(this, cloner); 64 71 } 65 72 66 73 public override IOperation Apply() { 67 74 var bestQuality = BestQualityParameter.ActualValue.Value; 68 var evaluations = EvaluatedSolutionsParameter.ActualValue.Value;75 var evaluations = Math.Max(EvaluatedSolutionsParameter.ActualValue.Value, 1); 69 76 70 var dataTable = Quality VsEvaluationsParameter.ResultValue;71 dataTable.Rows["First-hit Graph"].Values.Add(Tuple.Create( evaluations, bestQuality));77 var dataTable = QualityPerEvaluationsParameter.ResultValue; 78 dataTable.Rows["First-hit Graph"].Values.Add(Tuple.Create((double)evaluations, bestQuality)); 72 79 73 80 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.