Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Analysis/3.3/Allele.cs

    r4623 r4722  
    5353    #endregion
    5454
     55    #region Storing & Cloning
     56    [StorableConstructor]
     57    protected Allele(bool deserializing) : base(deserializing) { }
     58    protected Allele(Allele original, Cloner cloner)
     59      : base(original, cloner) {
     60      this.id = original.id;
     61      this.impact = original.impact;
     62    }
     63    public override IDeepCloneable Clone(Cloner cloner) {
     64      return new Allele(this, cloner);
     65    }
     66    #endregion
    5567    public Allele()
    5668      : base() {
     
    6880      this.impact = impact;
    6981    }
    70     [StorableConstructor]
    71     protected Allele(bool deserializing) : base(deserializing) { }
    72 
    73     public override IDeepCloneable Clone(Cloner cloner) {
    74       Allele clone = (Allele)base.Clone(cloner);
    75       clone.id = id;
    76       clone.impact = impact;
    77       return clone;
    78     }
    7982
    8083    public override string ToString() {
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequency.cs

    r4623 r4722  
    8989    #endregion
    9090
     91    #region Storing & Cloning
     92    [StorableConstructor]
     93    protected AlleleFrequency(bool deserializing) : base(deserializing) { }
     94    protected AlleleFrequency(AlleleFrequency original, Cloner cloner)
     95      : base(original, cloner) {
     96      this.id = original.id;
     97      this.frequency = original.frequency;
     98      this.averageImpact = original.averageImpact;
     99      this.averageSolutionQuality = original.averageSolutionQuality;
     100      this.containedInBestKnownSolution = original.containedInBestKnownSolution;
     101      this.containedInBestSolution = original.containedInBestSolution;
     102    }
     103    public override IDeepCloneable Clone(Cloner cloner) {
     104      return new AlleleFrequency(this, cloner);
     105    }
     106    #endregion
    91107    public AlleleFrequency()
    92108      : base() {
     
    107123      this.containedInBestSolution = containedInBestSolution;
    108124    }
    109     [StorableConstructor]
    110     protected AlleleFrequency(bool deserializing) : base(deserializing) { }
    111 
    112     public override IDeepCloneable Clone(Cloner cloner) {
    113       AlleleFrequency clone = (AlleleFrequency)base.Clone(cloner);
    114       clone.id = id;
    115       clone.frequency = frequency;
    116       clone.averageImpact = averageImpact;
    117       clone.averageSolutionQuality = averageSolutionQuality;
    118       clone.containedInBestKnownSolution = containedInBestKnownSolution;
    119       clone.containedInBestSolution = containedInBestSolution;
    120       return clone;
    121     }
    122125
    123126    public override string ToString() {
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs

    r4716 r4722  
    2222using System.Collections.Generic;
    2323using System.Linq;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    6364    [StorableConstructor]
    6465    protected AlleleFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
     66    protected AlleleFrequencyAnalyzer(AlleleFrequencyAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
    6567    public AlleleFrequencyAnalyzer()
    6668      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyCollection.cs

    r4704 r4722  
    2222using System.Collections.Generic;
    2323using System.Drawing;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected AlleleFrequencyCollection(bool deserializing) : base(deserializing) { }
     41    protected AlleleFrequencyCollection(AlleleFrequencyCollection original, Cloner cloner) : base(original, cloner) { }
    3842    public AlleleFrequencyCollection() : base() { }
    3943    public AlleleFrequencyCollection(IEnumerable<AlleleFrequency> frequencies) : base(new ItemCollection<AlleleFrequency>(frequencies)) { }
    40     [StorableConstructor]
    41     protected AlleleFrequencyCollection(bool deserializing) : base(deserializing) { }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new AlleleFrequencyCollection(this, cloner);
     47    }
    4248  }
    4349}
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyCollectionHistory.cs

    r4704 r4722  
    2222using System.Collections.Generic;
    2323using System.Drawing;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected AlleleFrequencyCollectionHistory(bool deserializing) : base(deserializing) { }
     41    protected AlleleFrequencyCollectionHistory(AlleleFrequencyCollectionHistory original, Cloner cloner) : base(original, cloner) { }
    3842    public AlleleFrequencyCollectionHistory() : base() { }
    3943    public AlleleFrequencyCollectionHistory(IEnumerable<AlleleFrequencyCollection> collections) : base(new ItemCollection<AlleleFrequencyCollection>(collections)) { }
    40     [StorableConstructor]
    41     protected AlleleFrequencyCollectionHistory(bool deserializing) : base(deserializing) { }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new AlleleFrequencyCollectionHistory(this, cloner);
     47    }
    4248  }
    4349}
  • trunk/sources/HeuristicLab.Analysis/3.3/BestAverageWorstQualityAnalyzer.cs

    r3787 r4722  
    8282    #endregion
    8383
     84    #region Storing & Cloning
     85    [StorableConstructor]
     86    private BestAverageWorstQualityAnalyzer(bool deserializing) : base(deserializing) { }
     87    private BestAverageWorstQualityAnalyzer(BestAverageWorstQualityAnalyzer original, Cloner cloner)
     88      : base(original, cloner) {
     89      Initialize();
     90    }
     91    public override IDeepCloneable Clone(Cloner cloner) {
     92      return new BestAverageWorstQualityAnalyzer(this, cloner);
     93    }
     94    #endregion
    8495    public BestAverageWorstQualityAnalyzer()
    8596      : base() {
     
    151162      Initialize();
    152163    }
    153     [StorableConstructor]
    154     private BestAverageWorstQualityAnalyzer(bool deserializing) : base() { }
    155164
    156165    [StorableHook(HookType.AfterDeserialization)]
     166    private void AfterDeserialization() {
     167      Initialize();
     168    }
     169   
    157170    private void Initialize() {
    158171      QualityParameter.DepthChanged += new EventHandler(QualityParameter_DepthChanged);
    159     }
    160 
    161     public override IDeepCloneable Clone(Cloner cloner) {
    162       BestAverageWorstQualityAnalyzer clone = (BestAverageWorstQualityAnalyzer)base.Clone(cloner);
    163       clone.Initialize();
    164       return clone;
    165172    }
    166173
  • trunk/sources/HeuristicLab.Analysis/3.3/BestAverageWorstQualityCalculator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4950    }
    5051
     52    #region Storing & Cloning
     53    [StorableConstructor]
     54    private BestAverageWorstQualityCalculator(bool deserializing) : base(deserializing) { }
     55    private BestAverageWorstQualityCalculator(BestAverageWorstQualityCalculator original, Cloner cloner) : base(original, cloner) { }
     56    public override IDeepCloneable Clone(Cloner cloner) {
     57      return new BestAverageWorstQualityCalculator(this, cloner);
     58    }
     59    #endregion
    5160    public BestAverageWorstQualityCalculator()
    5261      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/BestQualityMemorizer.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4344    }
    4445
     46    #region Storing & Cloning
     47    [StorableConstructor]
     48    protected BestQualityMemorizer(bool deserializing) : base(deserializing) { }
     49    protected BestQualityMemorizer(BestQualityMemorizer original, Cloner cloner) : base(original, cloner) { }
     50    public override IDeepCloneable Clone(Cloner cloner) {
     51      return new BestQualityMemorizer(this, cloner);
     52    }
     53    #endregion
    4554    public BestQualityMemorizer()
    4655      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/BestScopeSolutionAnalyzer.cs

    r3901 r4722  
    2222using System.Collections.Generic;
    2323using System.Linq;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    5556    }
    5657
     58    #region Storing & Cloning
     59    [StorableConstructor]
     60    protected BestScopeSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     61    protected BestScopeSolutionAnalyzer(BestScopeSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
     62    public override IDeepCloneable Clone(Cloner cloner) {
     63      return new BestScopeSolutionAnalyzer(this, cloner);
     64    }
     65    #endregion
    5766    public BestScopeSolutionAnalyzer()
    5867      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/DataRow.cs

    r4703 r4722  
    6666    #endregion
    6767
     68    #region Storing & Cloning
     69    [StorableConstructor]
     70    private DataRow(bool deserializing) : base(deserializing) { }
     71    private DataRow(DataRow original, Cloner cloner)
     72      : base(original, cloner) {
     73      this.VisualProperties = (DataRowVisualProperties)cloner.Clone(original.visualProperties);
     74      this.values = new ObservableList<double>(original.values);
     75    }
     76    public override IDeepCloneable Clone(Cloner cloner) {
     77      return new DataRow(this, cloner);
     78    }
     79    #endregion
    6880    public DataRow()
    6981      : base() {
     
    8698      values = new ObservableList<double>();
    8799    }
    88     [StorableConstructor]
    89     private DataRow(bool deserializing) { }
    90100
    91101    // BackwardsCompatibility3.3
     
    96106    }
    97107    #endregion
    98 
    99     public override IDeepCloneable Clone(Cloner cloner) {
    100       DataRow clone = new DataRow(Name, Description);
    101       cloner.RegisterClonedObject(this, clone);
    102       clone.VisualProperties = (DataRowVisualProperties)cloner.Clone(visualProperties);
    103       clone.values.AddRange(values);
    104       return clone;
    105     }
    106108
    107109    public event EventHandler VisualPropertiesChanged;
  • trunk/sources/HeuristicLab.Analysis/3.3/DataRowVisualProperties.cs

    r4648 r4722  
    2121
    2222using System.ComponentModel;
     23using System.Drawing;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    25 using System.Drawing;
    2626
    2727namespace HeuristicLab.Analysis {
     
    104104    #endregion
    105105
     106    #region Storing & Cloning
     107    [StorableConstructor]
     108    protected DataRowVisualProperties(bool deserializing) : base() { }
     109    protected DataRowVisualProperties(DataRowVisualProperties original, Cloner cloner)
     110      : base(original, cloner) {
     111      this.chartType = original.chartType;
     112      this.secondYAxis = original.secondYAxis;
     113      this.color = original.color;
     114      this.startIndexZero = original.startIndexZero;
     115    }
     116    public override IDeepCloneable Clone(Cloner cloner) {
     117      return new DataRowVisualProperties(this, cloner);
     118    }
     119    #endregion
    106120    public DataRowVisualProperties() {
    107121      chartType = DataRowChartType.Line;
     
    116130      this.startIndexZero = startIndexZero;
    117131    }
    118     [StorableConstructor]
    119     protected DataRowVisualProperties(bool deserializing) { }
    120 
    121     public override IDeepCloneable Clone(Cloner cloner) {
    122       DataRowVisualProperties clone = (DataRowVisualProperties)base.Clone(cloner);
    123       clone.chartType = chartType;
    124       clone.secondYAxis = secondYAxis;
    125       clone.color = color;
    126       clone.startIndexZero = startIndexZero;
    127       return clone;
    128     }
    129132
    130133    public event PropertyChangedEventHandler PropertyChanged;
  • trunk/sources/HeuristicLab.Analysis/3.3/DataTable.cs

    r4702 r4722  
    4747    }
    4848
     49    #region Storing & Cloning
     50    [StorableConstructor]
     51    private DataTable(bool deserializing) : base(deserializing) { }
     52    private DataTable(DataTable original, Cloner cloner)
     53      : base(original, cloner) {
     54      this.rows = cloner.Clone(original.rows);
     55      this.RegisterRowsEvents();
     56    }
     57    public override IDeepCloneable Clone(Cloner cloner) {
     58      return new DataTable(this, cloner);
     59    }
     60    #endregion
    4961    public DataTable()
    5062      : base() {
     
    127139    private void Values_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
    128140      this.OnReset();
    129     }
    130 
    131     public override IDeepCloneable Clone(Cloner cloner) {
    132       DataTable clone = new DataTable(Name, Description);
    133       cloner.RegisterClonedObject(this, clone);
    134       clone.rows = (NamedItemCollection<DataRow>)cloner.Clone(rows);
    135       return clone;
    136141    }
    137142
  • trunk/sources/HeuristicLab.Analysis/3.3/DataTableHistory.cs

    r4703 r4722  
    2222using System.Collections.Generic;
    2323using System.Drawing;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected DataTableHistory(bool deserializing) : base(deserializing) { }
     41    protected DataTableHistory(DataTableHistory original, Cloner cloner) : base(original, cloner) { }
    3842    public DataTableHistory() : base() { }
    3943    public DataTableHistory(IEnumerable<DataTable> collection) : base(new ItemCollection<DataTable>(collection)) { }
    40     [StorableConstructor]
    41     protected DataTableHistory(bool deserializing) : base(deserializing) { }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new DataTableHistory(this, cloner);
     47    }
    4248  }
    4349}
  • trunk/sources/HeuristicLab.Analysis/3.3/DataTableValuesCollector.cs

    r4068 r4722  
    2222using System.Collections.Generic;
    2323using System.Linq;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    3940    }
    4041
     42    #region Storing & Cloning
     43    [StorableConstructor]
     44    protected DataTableValuesCollector(bool deserializing) : base(deserializing) { }
     45    protected DataTableValuesCollector(DataTableValuesCollector original, Cloner cloner) : base(original, cloner) { }
     46    public override IDeepCloneable Clone(Cloner cloner) {
     47      return new DataTableValuesCollector(this, cloner);
     48    }
     49    #endregion
    4150    public DataTableValuesCollector()
    4251      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/HeatMap.cs

    r4715 r4722  
    3535    }
    3636
     37    [StorableConstructor]
     38    protected HeatMap(bool deserializing) : base(deserializing) { }
     39    protected HeatMap(HeatMap original, Cloner cloner) : base(original, cloner) { }
    3740    public HeatMap() : base() { }
    3841    public HeatMap(int rows, int columns) : base(rows, columns) { }
     
    4447
    4548    public override IDeepCloneable Clone(Cloner cloner) {
    46       HeatMap clone = new HeatMap();
    47       cloner.RegisterClonedObject(this, clone);
    48       clone.matrix = (double[,])matrix.Clone();
    49       clone.columnNames = new List<string>(columnNames);
    50       clone.rowNames = new List<string>(rowNames);
    51       clone.sortableView = sortableView;
    52       clone.readOnly = readOnly;
    53       return clone;
     49      return new HeatMap(this, cloner);
    5450    }
    5551
  • trunk/sources/HeuristicLab.Analysis/3.3/HeatMapHistory.cs

    r4703 r4722  
    2222using System.Collections.Generic;
    2323using System.Drawing;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3637    }
    3738
     39    [StorableConstructor]
     40    protected HeatMapHistory(bool deserializing) : base(deserializing) { }
     41    protected HeatMapHistory(HeatMapHistory original, Cloner cloner) : base(original, cloner) { }
    3842    public HeatMapHistory() : base() { }
    3943    public HeatMapHistory(IEnumerable<HeatMap> collection) : base(new ItemCollection<HeatMap>(collection)) { }
    40     [StorableConstructor]
    41     protected HeatMapHistory(bool deserializing) : base(deserializing) { }
     44
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new HeatMapHistory(this, cloner);
     47    }
    4248  }
    4349}
  • trunk/sources/HeuristicLab.Analysis/3.3/MinAverageMaxValueAnalyzer.cs

    r3710 r4722  
    8383    [Storable]
    8484    private ResultsCollector resultsCollector;
     85
     86    #region Storing & Cloning
     87    [StorableConstructor]
     88    private MinAverageMaxValueAnalyzer(bool deserializing) : base(deserializing) { }
     89    private MinAverageMaxValueAnalyzer(MinAverageMaxValueAnalyzer original, Cloner cloner)
     90      : base(original, cloner) {
     91      resultsCollector = cloner.Clone(original.resultsCollector);
     92      Initialize();
     93    }
     94    public override IDeepCloneable Clone(Cloner cloner) {
     95      return new MinAverageMaxValueAnalyzer(this, cloner);
     96    }
     97    #endregion
    8598    public MinAverageMaxValueAnalyzer()
    8699      : base() {
     
    132145      Initialize();
    133146    }
    134     [StorableConstructor]
    135     private MinAverageMaxValueAnalyzer(bool deserializing) : base() { }
    136147
    137148    [StorableHook(HookType.AfterDeserialization)]
     
    139150      ValueParameter.DepthChanged += new EventHandler(ValueParameter_DepthChanged);
    140151      CollectMinValueInResultsParameter.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_ValueChanged);
    141       CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_ValueChanged);
     152      CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_Value_ValueChanged);
    142153      CollectMaxValueInResultsParameter.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_ValueChanged);
    143       CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_ValueChanged);
     154      CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_Value_ValueChanged);
    144155      CollectAverageValueInResultsParameter.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_ValueChanged);
    145       CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_ValueChanged);
     156      CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_Value_ValueChanged);
    146157    }
    147158
    148159    private void CollectAverageValueInResultsParameter_ValueChanged(object sender, EventArgs e) {
    149       if (CollectAverageValueInResults.Value)
     160      IParameter avgValueParameter;
     161      resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter);
     162      if (CollectAverageValueInResults.Value && avgValueParameter == null)
    150163        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name));
    151       else {
    152         IParameter avgValueParameter;
    153         resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter);
     164      else if (!CollectAverageValueInResults.Value && avgValueParameter != null)
    154165        resultsCollector.CollectedValues.Remove(avgValueParameter);
    155       }
     166      CollectAverageValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectAverageValueInResultsParameter_Value_ValueChanged);
     167    }
     168
     169    private void CollectAverageValueInResultsParameter_Value_ValueChanged(object sender, EventArgs e) {
     170      IParameter avgValueParameter;
     171      resultsCollector.CollectedValues.TryGetValue("AverageValue", out avgValueParameter);
     172      if (CollectAverageValueInResults.Value && avgValueParameter == null)
     173        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name));
     174      else if (!CollectAverageValueInResults.Value && avgValueParameter != null)
     175        resultsCollector.CollectedValues.Remove(avgValueParameter);
    156176    }
    157177
    158178    private void CollectMaxValueInResultsParameter_ValueChanged(object sender, EventArgs e) {
    159       if (CollectMaxValueInResults.Value)
     179      IParameter maxValueParameter;
     180      resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter);
     181      if (CollectMaxValueInResults.Value && maxValueParameter == null)
    160182        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name));
    161       else {
    162         IParameter maxValueParameter;
    163         resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter);
     183      else if (!CollectMaxValueInResults.Value && maxValueParameter != null)
     184        resultsCollector.CollectedValues.Remove(maxValueParameter);
     185      CollectMaxValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMaxValueInResultsParameter_Value_ValueChanged);
     186    }
     187
     188    private void CollectMaxValueInResultsParameter_Value_ValueChanged(object sender, EventArgs e) {
     189      IParameter maxValueParameter;
     190      resultsCollector.CollectedValues.TryGetValue("MaxValue", out maxValueParameter);
     191      if (CollectMaxValueInResults.Value && maxValueParameter == null)
     192        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name));
     193      else if (!CollectMaxValueInResults.Value && maxValueParameter != null)
    164194        resultsCollector.CollectedValues.Remove(maxValueParameter);
    165195      }
    166     }
    167196
    168197    private void CollectMinValueInResultsParameter_ValueChanged(object sender, EventArgs e) {
    169       if (CollectMinValueInResults.Value)
     198      IParameter minValueParameter;
     199      resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter);
     200      if (CollectMinValueInResults.Value && minValueParameter == null)
    170201        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name));
    171       else {
    172         IParameter minValueParameter;
    173         resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter);
     202      else if (!CollectMinValueInResults.Value && minValueParameter != null)
    174203        resultsCollector.CollectedValues.Remove(minValueParameter);
    175       }
    176     }
    177 
    178     public override IDeepCloneable Clone(Cloner cloner) {
    179       MinAverageMaxValueAnalyzer clone = (MinAverageMaxValueAnalyzer)base.Clone(cloner);
    180       clone.Initialize();
    181       return clone;
     204      CollectMinValueInResultsParameter.Value.ValueChanged += new EventHandler(CollectMinValueInResultsParameter_Value_ValueChanged);
     205    }
     206
     207    private void CollectMinValueInResultsParameter_Value_ValueChanged(object sender, EventArgs e) {
     208      IParameter minValueParameter;
     209      resultsCollector.CollectedValues.TryGetValue("MinValue", out minValueParameter);
     210      if (CollectMinValueInResults.Value && minValueParameter == null)
     211        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name));
     212      else if (!CollectMinValueInResults.Value && minValueParameter != null)
     213        resultsCollector.CollectedValues.Remove(minValueParameter);
    182214    }
    183215
  • trunk/sources/HeuristicLab.Analysis/3.3/MinAverageMaxValueCalculator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4647    }
    4748
     49    #region Storing & Cloning
     50    [StorableConstructor]
     51    private MinAverageMaxValueCalculator(bool deserializing) : base(deserializing) { }
     52    private MinAverageMaxValueCalculator(MinAverageMaxValueCalculator original, Cloner cloner) : base(original, cloner) { }
     53    public override IDeepCloneable Clone(Cloner cloner) {
     54      return new MinAverageMaxValueCalculator(this, cloner);
     55    }
     56    #endregion
    4857    public MinAverageMaxValueCalculator()
    4958      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/MultiAnalyzer.cs

    r4641 r4722  
    2121
    2222using HeuristicLab.Collections;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    5152    }
    5253
     54    #region Storing & Cloning
     55    [StorableConstructor]
     56    protected MultiAnalyzer(bool deserializing) : base(deserializing) { }
     57    protected MultiAnalyzer(MultiAnalyzer original, Cloner cloner) : base(original, cloner) { }
     58    public override IDeepCloneable Clone(Cloner cloner) {
     59      return new MultiAnalyzer(this, cloner);
     60    }
     61    #endregion
    5362    public MultiAnalyzer()
    5463      : base() {
     
    5665      Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the MultiAnalyzer was called since the last update.", "MultiAnalyzerUpdateCounter"));
    5766    }
    58     [StorableConstructor]
    59     protected MultiAnalyzer(bool deserializing) : base(deserializing) { }
    6067
    6168    public override IOperation Apply() {
  • trunk/sources/HeuristicLab.Analysis/3.3/PopulationDiversityAnalyzer.cs

    r4715 r4722  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    5960    [StorableConstructor]
    6061    protected PopulationDiversityAnalyzer(bool deserializing) : base(deserializing) { }
     62    protected PopulationDiversityAnalyzer(PopulationDiversityAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
    6163    public PopulationDiversityAnalyzer()
    6264      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/QualityAnalyzer.cs

    r3662 r4722  
    7979    #endregion
    8080
     81    #region Storing & Cloning
     82    [StorableConstructor]
     83    private QualityAnalyzer(bool deserializing) : base(deserializing) { }
     84    private QualityAnalyzer(QualityAnalyzer original, Cloner cloner)
     85      : base(original, cloner) {
     86      Initialize();
     87    }
     88    public override IDeepCloneable Clone(Cloner cloner) {
     89      return new QualityAnalyzer(this, cloner);
     90    }
     91    #endregion
    8192    public QualityAnalyzer()
    8293      : base() {
     
    141152      Initialize();
    142153    }
    143     [StorableConstructor]
    144     private QualityAnalyzer(bool deserializing) : base() { }
    145154
    146155    [StorableHook(HookType.AfterDeserialization)]
     156    private void AfterDeserialization() {
     157      Initialize();
     158    }
     159
    147160    private void Initialize() {
    148161      QualityParameter.DepthChanged += new EventHandler(QualityParameter_DepthChanged);
    149     }
    150 
    151     public override IDeepCloneable Clone(Cloner cloner) {
    152       QualityAnalyzer clone = (QualityAnalyzer)base.Clone(cloner);
    153       clone.Initialize();
    154       return clone;
    155162    }
    156163
  • trunk/sources/HeuristicLab.Analysis/3.3/QualityDifferenceCalculator.cs

    r4068 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    4647    }
    4748
     49    #region Storing & Cloning
     50    [StorableConstructor]
     51    protected QualityDifferenceCalculator(bool deserializing) : base(deserializing) { }
     52    protected QualityDifferenceCalculator(QualityDifferenceCalculator original, Cloner cloner) : base(original, cloner) { }
     53    public override IDeepCloneable Clone(Cloner cloner) {
     54      return new QualityDifferenceCalculator(this, cloner);
     55    }
     56    #endregion
    4857    public QualityDifferenceCalculator()
    4958      : base() {
  • trunk/sources/HeuristicLab.Analysis/3.3/ValueAnalyzer.cs

    r3662 r4722  
    5858    #endregion
    5959
     60    #region Storing & Cloning
     61    [StorableConstructor]
     62    private ValueAnalyzer(bool deserializing) : base(deserializing) { }
     63    private ValueAnalyzer(ValueAnalyzer original, Cloner cloner)
     64      : base(original, cloner) {
     65        Initialize();
     66    }
     67    public override IDeepCloneable Clone(Cloner cloner) {
     68      return new ValueAnalyzer(this, cloner);
     69    }
     70    #endregion
    6071    public ValueAnalyzer()
    6172      : base() {
     
    8899      Initialize();
    89100    }
    90     [StorableConstructor]
    91     private ValueAnalyzer(bool deserializing) : base() { }
    92101
    93102    [StorableHook(HookType.AfterDeserialization)]
     103    private void AfterDeserialization() {
     104      Initialize();
     105    }
     106
    94107    private void Initialize() {
    95108      ValueParameter.DepthChanged += new EventHandler(ValueParameter_DepthChanged);
    96     }
    97 
    98     public override IDeepCloneable Clone(Cloner cloner) {
    99       ValueAnalyzer clone = (ValueAnalyzer)base.Clone(cloner);
    100       clone.Initialize();
    101       return clone;
    102109    }
    103110
Note: See TracChangeset for help on using the changeset viewer.