Changeset 4677 for branches/CloningRefactoring/HeuristicLab.Analysis
- Timestamp:
- 10/29/10 19:14:33 (14 years ago)
- Location:
- branches/CloningRefactoring/HeuristicLab.Analysis/3.3
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/Allele.cs
r4623 r4677 53 53 #endregion 54 54 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 55 67 public Allele() 56 68 : base() { … … 68 80 this.impact = impact; 69 81 } 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 }79 82 80 83 public override string ToString() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequency.cs
r4623 r4677 89 89 #endregion 90 90 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 91 107 public AlleleFrequency() 92 108 : base() { … … 107 123 this.containedInBestSolution = containedInBestSolution; 108 124 } 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 }122 125 123 126 public override string ToString() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs
r4648 r4677 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Analysis { … … 61 62 } 62 63 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 63 69 public AlleleFrequencyAnalyzer() 64 70 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequencyCollection.cs
r4639 r4677 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Analysis { … … 31 32 [StorableClass] 32 33 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 33 42 public AlleleFrequencyCollection() : base() { } 34 43 public AlleleFrequencyCollection(IEnumerable<AlleleFrequency> frequencies) : base(new ItemCollection<AlleleFrequency>(frequencies)) { } 35 [StorableConstructor]36 protected AlleleFrequencyCollection(bool deserializing) : base(deserializing) { }37 44 } 38 45 } -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/AlleleFrequencyCollectionHistory.cs
r4641 r4677 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Analysis { … … 31 32 [StorableClass] 32 33 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 33 42 public AlleleFrequencyCollectionHistory() : base() { } 34 43 public AlleleFrequencyCollectionHistory(IEnumerable<AlleleFrequencyCollection> collections) : base(new ItemCollection<AlleleFrequencyCollection>(collections)) { } 35 [StorableConstructor]36 protected AlleleFrequencyCollectionHistory(bool deserializing) : base(deserializing) { }37 44 } 38 45 } -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestAverageWorstQualityAnalyzer.cs
r3787 r4677 82 82 #endregion 83 83 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 84 95 public BestAverageWorstQualityAnalyzer() 85 96 : base() { … … 151 162 Initialize(); 152 163 } 153 [StorableConstructor]154 private BestAverageWorstQualityAnalyzer(bool deserializing) : base() { }155 164 156 165 [StorableHook(HookType.AfterDeserialization)] 166 private void AfterDeserialization() { 167 Initialize(); 168 } 169 157 170 private void Initialize() { 158 171 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;165 172 } 166 173 -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestAverageWorstQualityCalculator.cs
r4068 r4677 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Analysis { … … 49 50 } 50 51 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 51 60 public BestAverageWorstQualityCalculator() 52 61 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestQualityMemorizer.cs
r4068 r4677 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Analysis { … … 43 44 } 44 45 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 45 54 public BestQualityMemorizer() 46 55 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/BestScopeSolutionAnalyzer.cs
r3901 r4677 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Analysis { … … 55 56 } 56 57 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 57 66 public BestScopeSolutionAnalyzer() 58 67 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataRow.cs
r4644 r4677 66 66 #endregion 67 67 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 68 80 public DataRow() 69 81 : base() { … … 86 98 values = new ObservableList<double>(); 87 99 } 88 [StorableConstructor]89 private DataRow(bool deserializing) { }90 100 91 101 // BackwardsCompatibility3.3 … … 96 106 } 97 107 #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 }106 108 107 109 public event EventHandler VisualPropertiesChanged; -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataRowVisualProperties.cs
r4648 r4677 104 104 #endregion 105 105 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 106 120 public DataRowVisualProperties() { 107 121 chartType = DataRowChartType.Line; … … 116 130 this.startIndexZero = startIndexZero; 117 131 } 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 }129 132 130 133 public event PropertyChangedEventHandler PropertyChanged; -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataTable.cs
r4068 r4677 47 47 } 48 48 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 49 61 public DataTable() 50 62 : base() { … … 127 139 private void Values_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) { 128 140 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;136 141 } 137 142 -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/DataTableValuesCollector.cs
r4068 r4677 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Analysis { … … 39 40 } 40 41 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 41 50 public DataTableValuesCollector() 42 51 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MinAverageMaxValueAnalyzer.cs
r3710 r4677 83 83 [Storable] 84 84 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 85 97 public MinAverageMaxValueAnalyzer() 86 98 : base() { … … 132 144 Initialize(); 133 145 } 134 [StorableConstructor]135 private MinAverageMaxValueAnalyzer(bool deserializing) : base() { }136 146 137 147 [StorableHook(HookType.AfterDeserialization)] … … 176 186 } 177 187 178 public override IDeepCloneable Clone(Cloner cloner) {179 MinAverageMaxValueAnalyzer clone = (MinAverageMaxValueAnalyzer)base.Clone(cloner);180 clone.Initialize();181 return clone;182 }183 184 188 private void ValueParameter_DepthChanged(object sender, System.EventArgs e) { 185 189 MinAverageMaxValueCalculator.ValueParameter.Depth = ValueParameter.Depth; -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MinAverageMaxValueCalculator.cs
r4068 r4677 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Analysis { … … 46 47 } 47 48 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 48 57 public MinAverageMaxValueCalculator() 49 58 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/MultiAnalyzer.cs
r4641 r4677 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Analysis { … … 51 52 } 52 53 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 53 62 public MultiAnalyzer() 54 63 : base() { … … 56 65 Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the MultiAnalyzer was called since the last update.", "MultiAnalyzerUpdateCounter")); 57 66 } 58 [StorableConstructor]59 protected MultiAnalyzer(bool deserializing) : base(deserializing) { }60 67 61 68 public override IOperation Apply() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/QualityAnalyzer.cs
r3662 r4677 79 79 #endregion 80 80 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 81 92 public QualityAnalyzer() 82 93 : base() { … … 141 152 Initialize(); 142 153 } 143 [StorableConstructor]144 private QualityAnalyzer(bool deserializing) : base() { }145 154 146 155 [StorableHook(HookType.AfterDeserialization)] 156 private void AfterDeserialization() { 157 Initialize(); 158 } 159 147 160 private void Initialize() { 148 161 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;155 162 } 156 163 -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/QualityDifferenceCalculator.cs
r4068 r4677 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Analysis { … … 46 47 } 47 48 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 48 57 public QualityDifferenceCalculator() 49 58 : base() { -
branches/CloningRefactoring/HeuristicLab.Analysis/3.3/ValueAnalyzer.cs
r3662 r4677 58 58 #endregion 59 59 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 60 71 public ValueAnalyzer() 61 72 : base() { … … 88 99 Initialize(); 89 100 } 90 [StorableConstructor]91 private ValueAnalyzer(bool deserializing) : base() { }92 101 93 102 [StorableHook(HookType.AfterDeserialization)] 103 private void AfterDeserialization() { 104 Initialize(); 105 } 106 94 107 private void Initialize() { 95 108 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;102 109 } 103 110
Note: See TracChangeset
for help on using the changeset viewer.