Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4677


Ignore:
Timestamp:
10/29/10 19:14:33 (14 years ago)
Author:
abeham
Message:

#922

  • Refactored HeuristicLab.Analysis
Location:
branches/CloningRefactoring/HeuristicLab.Analysis/3.3
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/Allele.cs

    r4623 r4677  
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequency.cs

    r4623 r4677  
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs

    r4648 r4677  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Analysis {
     
    6162    }
    6263
     64    #region Storing & Cloning
     65    [StorableConstructor]
     66    protected AlleleFrequencyAnalyzer(bool deserializing) : base(deserializing) { }
     67    protected AlleleFrequencyAnalyzer(AlleleFrequencyAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
     68    #endregion
    6369    public AlleleFrequencyAnalyzer()
    6470      : base() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequencyCollection.cs

    r4639 r4677  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Analysis {
     
    3132  [StorableClass]
    3233  public class AlleleFrequencyCollection : ReadOnlyItemCollection<AlleleFrequency> {
     34    #region Storing & Cloning
     35    [StorableConstructor]
     36    protected AlleleFrequencyCollection(bool deserializing) : base(deserializing) { }
     37    protected AlleleFrequencyCollection(AlleleFrequencyCollection original, Cloner cloner) : base(original, cloner) { }
     38    public override IDeepCloneable Clone(Cloner cloner) {
     39      return new AlleleFrequencyCollection(this, cloner);
     40    }
     41    #endregion
    3342    public AlleleFrequencyCollection() : base() { }
    3443    public AlleleFrequencyCollection(IEnumerable<AlleleFrequency> frequencies) : base(new ItemCollection<AlleleFrequency>(frequencies)) { }
    35     [StorableConstructor]
    36     protected AlleleFrequencyCollection(bool deserializing) : base(deserializing) { }
    3744  }
    3845}
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequencyCollectionHistory.cs

    r4641 r4677  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Analysis {
     
    3132  [StorableClass]
    3233  public class AlleleFrequencyCollectionHistory : ItemCollection<AlleleFrequencyCollection> {
     34    #region Storing & Cloning
     35    [StorableConstructor]
     36    protected AlleleFrequencyCollectionHistory(bool deserializing) : base(deserializing) { }
     37    protected AlleleFrequencyCollectionHistory(AlleleFrequencyCollectionHistory original, Cloner cloner) : base(original, cloner) { }
     38    public override IDeepCloneable Clone(Cloner cloner) {
     39      return new AlleleFrequencyCollectionHistory(this, cloner);
     40    }
     41    #endregion
    3342    public AlleleFrequencyCollectionHistory() : base() { }
    3443    public AlleleFrequencyCollectionHistory(IEnumerable<AlleleFrequencyCollection> collections) : base(new ItemCollection<AlleleFrequencyCollection>(collections)) { }
    35     [StorableConstructor]
    36     protected AlleleFrequencyCollectionHistory(bool deserializing) : base(deserializing) { }
    3744  }
    3845}
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestAverageWorstQualityAnalyzer.cs

    r3787 r4677  
    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
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestAverageWorstQualityCalculator.cs

    r4068 r4677  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestQualityMemorizer.cs

    r4068 r4677  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestScopeSolutionAnalyzer.cs

    r3901 r4677  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataRow.cs

    r4644 r4677  
    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;
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataRowVisualProperties.cs

    r4648 r4677  
    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;
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataTable.cs

    r4068 r4677  
    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
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataTableValuesCollector.cs

    r4068 r4677  
    2727using HeuristicLab.Parameters;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MinAverageMaxValueAnalyzer.cs

    r3710 r4677  
    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      Initialize();
     92    }
     93    public override IDeepCloneable Clone(Cloner cloner) {
     94      return new MinAverageMaxValueAnalyzer(this, cloner);
     95    }
     96    #endregion
    8597    public MinAverageMaxValueAnalyzer()
    8698      : base() {
     
    132144      Initialize();
    133145    }
    134     [StorableConstructor]
    135     private MinAverageMaxValueAnalyzer(bool deserializing) : base() { }
    136146
    137147    [StorableHook(HookType.AfterDeserialization)]
     
    176186    }
    177187
    178     public override IDeepCloneable Clone(Cloner cloner) {
    179       MinAverageMaxValueAnalyzer clone = (MinAverageMaxValueAnalyzer)base.Clone(cloner);
    180       clone.Initialize();
    181       return clone;
    182     }
    183 
    184188    private void ValueParameter_DepthChanged(object sender, System.EventArgs e) {
    185189      MinAverageMaxValueCalculator.ValueParameter.Depth = ValueParameter.Depth;
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MinAverageMaxValueCalculator.cs

    r4068 r4677  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MultiAnalyzer.cs

    r4641 r4677  
    2727using HeuristicLab.Parameters;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Common;
    2930
    3031namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/QualityAnalyzer.cs

    r3662 r4677  
    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
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/QualityDifferenceCalculator.cs

    r4068 r4677  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Analysis {
     
    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() {
  • branches/CloningRefactoring/HeuristicLab.Analysis/3.3/ValueAnalyzer.cs

    r3662 r4677  
    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.