Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8501


Ignore:
Timestamp:
08/19/12 15:56:24 (10 years ago)
Author:
ascheibe
Message:

#1886 fixed cloning and made helper classes items

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs

    r8499 r8501  
    4747    #endregion
    4848
    49 
    5049    #region Parameter properties
    5150    public ILookupParameter<ResultCollection> ResultsParameter {
     
    7877    #endregion
    7978
    80     ScatterPlotHelper plotHelper, childDiversityHelper, parentDiversityHelper;
    81     DataTableHelper performanceHelper, successHelper, equalParentsHelper;
    82     int cnt = 0;
    83     int success = 0;
    84     int lastGeneration = 0;
    85     int equalParents = 0;
    86     List<double> qualityPoints = new List<double>();
     79    private ScatterPlotHelper plotHelper, childDiversityHelper, parentDiversityHelper;
     80    private DataTableHelper performanceHelper, successHelper, equalParentsHelper;
     81    private int cnt = 0;
     82    private int success = 0;
     83    private int lastGeneration = 0;
     84    private int equalParents = 0;
     85    private List<double> qualityPoints = new List<double>();
    8786
    8887    [StorableConstructor]
    8988    private CrossoverPerformanceAnalyzer(bool deserializing) : base(deserializing) { }
    90     private CrossoverPerformanceAnalyzer(CrossoverPerformanceAnalyzer original, Cloner cloner) : base(original, cloner) { }
     89    private CrossoverPerformanceAnalyzer(CrossoverPerformanceAnalyzer original, Cloner cloner)
     90      : base(original, cloner) {
     91      cnt = original.cnt;
     92      success = original.success;
     93      lastGeneration = original.lastGeneration;
     94      equalParents = original.equalParents;
     95      qualityPoints = new List<double>(original.qualityPoints);
     96      plotHelper = (ScatterPlotHelper)original.plotHelper.Clone(cloner);
     97      childDiversityHelper = (ScatterPlotHelper)original.childDiversityHelper.Clone(cloner);
     98      parentDiversityHelper = (ScatterPlotHelper)original.parentDiversityHelper.Clone(cloner);
     99      performanceHelper = (DataTableHelper)original.performanceHelper.Clone(cloner);
     100      successHelper = (DataTableHelper)original.successHelper.Clone(cloner);
     101      equalParentsHelper = (DataTableHelper)original.equalParentsHelper.Clone(cloner);
     102    }
     103
    91104    public CrossoverPerformanceAnalyzer()
    92105      : base() {
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DataTableHelper.cs

    r8498 r8501  
    2020#endregion
    2121
     22using HeuristicLab.Common;
     23using HeuristicLab.Core;
    2224using HeuristicLab.Optimization;
     25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2326
    2427namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
    25   public class DataTableHelper {
     28  [Item("DataTableHelper", "Helper class for creating datatables.")]
     29  [StorableClass]
     30  public class DataTableHelper : Item {
    2631
    2732    private ResultCollection resultsCol;
     
    3035    private DataRow dtRow;
    3136
     37    [StorableConstructor]
     38    private DataTableHelper(bool deserializing) : base(deserializing) { }
     39    private DataTableHelper(DataTableHelper original, Cloner cloner)
     40      : base(original, cloner) {
     41      resultsCol = original.resultsCol;
     42      chartName = original.chartName;
     43      dataRowName = original.dataRowName;
     44      dtRow = (DataRow)original.dtRow.Clone(cloner);
     45    }
     46    public DataTableHelper() : base() { }
     47
     48    public override IDeepCloneable Clone(Cloner cloner) {
     49      return new DataTableHelper(this, cloner);
     50    }
    3251
    3352    public void InitializeChart(ResultCollection results, string chartName, string dataRowName) {
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs

    r8499 r8501  
    7474    #endregion
    7575
    76 
    77     ScatterPlotHelper diversityPlotHelper, qualityPlotHelper;
    78     DataTableHelper avgDataTableHelper;
    79     int cnt = 0, lastGeneration = 0;
    80     List<double> qualityPoints = new List<double>();
     76    private ScatterPlotHelper diversityPlotHelper, qualityPlotHelper;
     77    private DataTableHelper avgDataTableHelper;
     78    private int cnt = 0, lastGeneration = 0;
     79    private List<double> qualityPoints = new List<double>();
    8180
    8281    [StorableConstructor]
    8382    private MutationPerformanceAnalyzer(bool deserializing) : base(deserializing) { }
    84     private MutationPerformanceAnalyzer(MutationPerformanceAnalyzer original, Cloner cloner) : base(original, cloner) { }
     83    private MutationPerformanceAnalyzer(MutationPerformanceAnalyzer original, Cloner cloner)
     84      : base(original, cloner) {
     85      diversityPlotHelper = (ScatterPlotHelper)original.diversityPlotHelper.Clone(cloner);
     86      qualityPlotHelper = (ScatterPlotHelper)original.qualityPlotHelper.Clone(cloner);
     87      avgDataTableHelper = (DataTableHelper)original.avgDataTableHelper.Clone(cloner);
     88      cnt = original.cnt;
     89      lastGeneration = original.lastGeneration;
     90      qualityPoints = new List<double>(original.qualityPoints);
     91    }
     92
    8593    public MutationPerformanceAnalyzer()
    8694      : base() {
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ScatterPlotHelper.cs

    r8498 r8501  
    2222using System.Collections.Generic;
    2323using HeuristicLab.Common;
     24using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2527
    2628namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
    27   public class ScatterPlotHelper {
     29  [Item("ScatterPlotHelper", "Helper class for creating scatter plots.")]
     30  [StorableClass]
     31  public class ScatterPlotHelper : Item {
    2832
    2933    private ResultCollection resultsCol;
     
    3640      get { return plot; }
    3741      private set { plot = value; }
     42    }
     43
     44    [StorableConstructor]
     45    private ScatterPlotHelper(bool deserializing) : base(deserializing) { }
     46    private ScatterPlotHelper(ScatterPlotHelper original, Cloner cloner)
     47      : base(original, cloner) {
     48      resultsCol = original.resultsCol;
     49      chartName = original.chartName;
     50      xAxisTitle = original.xAxisTitle;
     51      yAxisTitle = original.yAxisTitle;
     52      plot = (ScatterPlot)original.plot.Clone(cloner);
     53    }
     54    public ScatterPlotHelper() : base() { }
     55
     56    public override IDeepCloneable Clone(Cloner cloner) {
     57      return new ScatterPlotHelper(this, cloner);
    3858    }
    3959
Note: See TracChangeset for help on using the changeset viewer.