Changeset 4118
- Timestamp:
- 07/27/10 19:54:20 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs
r4106 r4118 278 278 #region Helpers 279 279 [StorableHook(HookType.AfterDeserialization)] 280 private void AfterDeserializationHook() { 281 // BackwardsCompatibility3.3 282 #region Backwards compatible code (remove with 3.4) 283 if (operators == null) InitializeOperators(); 284 #endregion 285 AttachEventHandlers(); 286 } 287 280 288 private void AttachEventHandlers() { 281 // Start BackwardsCompatibility3.3 (remove with 3.4)282 if (operators == null) InitializeOperators();283 // End BackwardsCompatibility3.3284 289 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 285 290 SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.FeatureSelection/3.3/FeatureSelectionProblem.cs
r4098 r4118 90 90 91 91 [StorableConstructor] 92 pr ivate FeatureSelectionProblem(bool deserializing) : base() { }92 protected FeatureSelectionProblem(bool deserializing) : base(deserializing) { } 93 93 public FeatureSelectionProblem() 94 94 : base() { … … 106 106 107 107 InitializeOperators(); 108 AttachEventHandlers(); 108 RegisterParameterEvents(); 109 RegisterParameterValueEvents(); 109 110 } 110 111 111 112 [StorableHook(HookType.AfterDeserialization)] 112 113 private void AfterDeserializationHook() { 114 // BackwardsCompatibility3.3 115 #region Backwards compatible code (remove with 3.4) 116 if (operators == null) InitializeOperators(); 117 #endregion 113 118 RegisterParameterEvents(); 114 119 RegisterParameterValueEvents(); … … 118 123 FeatureSelectionProblem clone = (FeatureSelectionProblem)base.Clone(cloner); 119 124 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 120 clone.AttachEventHandlers(); 125 clone.RegisterParameterEvents(); 126 clone.RegisterParameterValueEvents(); 121 127 return clone; 122 128 } … … 168 174 169 175 #region Helpers 170 private void AttachEventHandlers() {171 // Start BackwardsCompatibility3.3 (remove with 3.4)172 if (operators == null) InitializeOperators();173 // End BackwardsCompatibility3.3174 RegisterParameterEvents();175 RegisterParameterValueEvents();176 }177 178 176 private void InitializeOperators() { 179 177 operators = new List<IOperator>(); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/MultiObjectiveSymbolicVectorRegressionProblem.cs
r4068 r4118 66 66 #endregion 67 67 68 [StorableConstructor] 69 protected MultiObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base(deserializing) { } 68 70 public MultiObjectiveSymbolicVectorRegressionProblem() 69 71 : base() { … … 75 77 Initialize(); 76 78 } 77 78 [StorableConstructor] 79 private MultiObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base() { } 80 79 81 80 [StorableHook(HookType.AfterDeserialization)] 82 81 private void AfterDeserializationHook() { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionProblem.cs
r4068 r4118 119 119 } 120 120 121 private List<IOperator> operators;122 121 public override IEnumerable<IOperator> Operators { 123 122 get { return operators; } … … 154 153 [Storable] 155 154 private SymbolicVectorRegressionGrammar grammar; 156 155 [Storable] 156 private List<IOperator> operators; 157 158 [StorableConstructor] 159 protected SymbolicVectorRegressionProblem(bool deserializing) : base(deserializing) { } 157 160 public SymbolicVectorRegressionProblem() 158 161 : base() { … … 175 178 UpdateGrammar(); 176 179 UpdateEstimationLimits(); 177 Initialize(); 178 } 179 180 [StorableConstructor] 181 private SymbolicVectorRegressionProblem(bool deserializing) : base() { } 180 InitializeOperators(); 181 RegisterParameterEvents(); 182 RegisterParameterValueEvents(); 183 } 182 184 183 185 [StorableHook(HookType.AfterDeserialization)] 184 186 private void AfterDeserializationHook() { 185 Initialize(); 187 // BackwardsCompatibility3.3 188 #region Backwards compatible code (remove with 3.4) 189 if (operators == null) InitializeOperators(); 190 #endregion 191 RegisterParameterEvents(); 192 RegisterParameterValueEvents(); 186 193 } 187 194 188 195 public override IDeepCloneable Clone(Cloner cloner) { 189 196 SymbolicVectorRegressionProblem clone = (SymbolicVectorRegressionProblem)base.Clone(cloner); 190 clone.Initialize(); 197 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 198 clone.RegisterParameterEvents(); 199 clone.RegisterParameterValueEvents(); 191 200 return clone; 192 201 } … … 254 263 protected void AddOperator(IOperator op) { 255 264 operators.Add(op); 256 }257 258 private void Initialize() {259 InitializeOperators();260 RegisterParameterEvents();261 RegisterParameterValueEvents();262 265 } 263 266 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/SingleObjectiveSymbolicTimeSeriesPrognosisProblem.cs
r4113 r4118 85 85 #endregion 86 86 87 87 [StorableConstructor] 88 protected SingleObjectiveSymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { } 88 89 public SingleObjectiveSymbolicTimeSeriesPrognosisProblem() 89 90 : base() { … … 96 97 ParameterizeEvaluator(); 97 98 98 Initialize(); 99 InitializeOperators(); 100 AttachEventHandlers(); 99 101 } 100 101 [StorableConstructor]102 protected SingleObjectiveSymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { }103 102 104 103 [StorableHook(HookType.AfterDeserialization)] 105 104 private void AfterDeserializationHook() { 106 Initialize();105 AttachEventHandlers(); 107 106 } 108 107 109 108 public override IDeepCloneable Clone(Cloner cloner) { 110 109 SingleObjectiveSymbolicTimeSeriesPrognosisProblem clone = (SingleObjectiveSymbolicTimeSeriesPrognosisProblem)base.Clone(cloner); 111 clone. Initialize();110 clone.AttachEventHandlers(); 112 111 return clone; 113 112 } … … 135 134 136 135 #region Helpers 137 private void Initialize() { 138 InitializeOperators(); 136 private void AttachEventHandlers() { 139 137 } 140 138 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/SymbolicTimeSeriesPrognosisProblem.cs
r4113 r4118 122 122 set { FunctionTreeGrammarParameter.Value = value; } 123 123 } 124 private List<IOperator> operators;125 124 public override IEnumerable<IOperator> Operators { 126 125 get { return operators; } … … 157 156 [Storable] 158 157 private SymbolicTimeSeriesPrognosisGrammar grammar; 159 158 [Storable] 159 private List<IOperator> operators; 160 161 [StorableConstructor] 162 protected SymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { } 160 163 public SymbolicTimeSeriesPrognosisProblem() 161 164 : base() { … … 179 182 180 183 UpdateGrammar(); 181 Initialize(); 182 } 183 184 [StorableConstructor] 185 protected SymbolicTimeSeriesPrognosisProblem(bool deserializing) : base(deserializing) { } 184 InitializeOperators(); 185 RegisterParameterEvents(); 186 RegisterParameterValueEvents(); 187 } 186 188 187 189 [StorableHook(HookType.AfterDeserialization)] 188 190 private void AfterDeserializationHook() { 189 Initialize(); 191 // BackwardsCompatibility3.3 192 #region Backwards compatible code (remove with 3.4) 193 if (operators == null) InitializeOperators(); 194 #endregion 195 RegisterParameterEvents(); 196 RegisterParameterValueEvents(); 190 197 } 191 198 192 199 public override IDeepCloneable Clone(Cloner cloner) { 193 200 SymbolicTimeSeriesPrognosisProblem clone = (SymbolicTimeSeriesPrognosisProblem)base.Clone(cloner); 201 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 194 202 clone.grammar = (SymbolicTimeSeriesPrognosisGrammar)cloner.Clone(grammar); 195 clone.Initialize(); 203 clone.RegisterParameterEvents(); 204 clone.RegisterParameterValueEvents(); 196 205 return clone; 197 206 } … … 253 262 protected void AddOperator(IOperator op) { 254 263 operators.Add(op); 255 }256 257 private void Initialize() {258 InitializeOperators();259 RegisterParameterEvents();260 RegisterParameterValueEvents();261 264 } 262 265 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
r4098 r4118 183 183 184 184 [StorableConstructor] 185 pr ivate SymbolicRegressionProblem(bool deserializing) : base() { }185 protected SymbolicRegressionProblem(bool deserializing) : base(deserializing) { } 186 186 public SymbolicRegressionProblem() 187 187 : base() { … … 213 213 UpdateEstimationLimits(); 214 214 InitializeOperators(); 215 AttachEventHandlers(); 215 RegisterParameterEvents(); 216 RegisterParameterValueEvents(); 216 217 } 217 218 … … 219 220 SymbolicRegressionProblem clone = (SymbolicRegressionProblem)base.Clone(cloner); 220 221 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 221 clone.AttachEventHandlers(); 222 clone.RegisterParameterEvents(); 223 clone.RegisterParameterValueEvents(); 222 224 return clone; 223 225 } … … 303 305 #region Helpers 304 306 [StorableHook(HookType.AfterDeserialization)] 305 private void AttachEventHandlers() { 306 // Start BackwardsCompatibility3.3 (remove with 3.4) 307 private void AfterDeserializationHook() { 308 // BackwardsCompatibility3.3 309 #region Backwards compatible code (remove with 3.4) 307 310 if (operators == null) InitializeOperators(); 308 // End BackwardsCompatibility3.3311 #endregion 309 312 RegisterParameterEvents(); 310 313 RegisterParameterValueEvents(); -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs
r4068 r4118 50 50 #endregion 51 51 52 [StorableConstructor] 53 protected DataAnalysisProblem(bool deserializing) : base(deserializing) { } 52 54 public DataAnalysisProblem() 53 55 : base() { … … 56 58 RegisterParameterValueEvents(); 57 59 } 58 59 [StorableConstructor]60 private DataAnalysisProblem(bool deserializing) : base() { }61 60 62 61 [StorableHook(HookType.AfterDeserialization)] -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentProblem.cs
r4100 r4118 129 129 130 130 [StorableConstructor] 131 private SupportVectorMachineParameterAdjustmentProblem(bool deserializing) : base( ) { }131 private SupportVectorMachineParameterAdjustmentProblem(bool deserializing) : base(deserializing) { } 132 132 public SupportVectorMachineParameterAdjustmentProblem() 133 133 : base() { … … 216 216 #region Helpers 217 217 [StorableHook(HookType.AfterDeserialization)] 218 private void AfterDeserializationHook() { 219 // BackwardsCompatibility3.3 220 #region Backwards compatible code (remove with 3.4) 221 if (operators == null) InitializeOperators(); 222 #endregion 223 AttachEventHandlers(); 224 } 225 218 226 private void AttachEventHandlers() { 219 // Start BackwardsCompatibility3.3 (remove with 3.4)220 if (operators == null) InitializeOperators();221 // End BackwardsCompatibility3.3222 227 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 223 228 SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged); -
trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.3/ExternalEvaluationProblem.cs
r4098 r4118 193 193 #region Helpers 194 194 [StorableHook(HookType.AfterDeserialization)] 195 private void AfterDeserializationHook() { 196 AttachEventHandlers(); 197 } 198 195 199 private void AttachEventHandlers() { 196 200 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); -
trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs
r4098 r4118 138 138 139 139 [StorableConstructor] 140 private KnapsackProblem(bool deserializing) : base( ) { }140 private KnapsackProblem(bool deserializing) : base(deserializing) { } 141 141 public KnapsackProblem() 142 142 : base() { … … 255 255 #region Helpers 256 256 [StorableHook(HookType.AfterDeserialization)] 257 private void AfterDeserializationHook() { 258 // BackwardsCompatibility3.3 259 #region Backwards compatible code (remove with 3.4) 260 if (operators == null) InitializeOperators(); 261 #endregion 262 AttachEventHandlers(); 263 } 264 257 265 private void AttachEventHandlers() { 258 // Start BackwardsCompatibility3.3 (remove with 3.4)259 if (operators == null) InitializeOperators();260 // End BackwardsCompatibility3.3261 266 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 262 267 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged); -
trunk/sources/HeuristicLab.Problems.OneMax/3.3/OnemaxProblem.cs
r4098 r4118 109 109 110 110 [StorableConstructor] 111 private OneMaxProblem(bool deserializing) : base( ) { }111 private OneMaxProblem(bool deserializing) : base(deserializing) { } 112 112 public OneMaxProblem() 113 113 : base() { … … 198 198 #region Helpers 199 199 [StorableHook(HookType.AfterDeserialization)] 200 private void AfterDeserializationHook() { 201 // BackwardsCompatibility3.3 202 #region Backwards compatible code (remove with 3.4) 203 if (operators == null) InitializeOperators(); 204 #endregion 205 AttachEventHandlers(); 206 } 207 200 208 private void AttachEventHandlers() { 201 // Start BackwardsCompatibility3.3 (remove with 3.4)202 if (operators == null) InitializeOperators();203 // End BackwardsCompatibility3.3204 209 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 205 210 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged); … … 207 212 LengthParameter.ValueChanged += new EventHandler(LengthParameter_ValueChanged); 208 213 LengthParameter.Value.ValueChanged += new EventHandler(Length_ValueChanged); 209 BestKnownQualityParameter.Value.Value = Length.Value;210 214 BestKnownQualityParameter.ValueChanged += new EventHandler(BestKnownQualityParameter_ValueChanged); 211 215 } 216 212 217 private void ParameterizeSolutionCreator() { 213 218 SolutionCreator.LengthParameter.ActualName = LengthParameter.Name; -
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r4098 r4118 131 131 132 132 [StorableConstructor] 133 private SingleObjectiveTestFunctionProblem(bool deserializing) : base( ) { }133 private SingleObjectiveTestFunctionProblem(bool deserializing) : base(deserializing) { } 134 134 public SingleObjectiveTestFunctionProblem() 135 135 : base() { … … 297 297 #region Helpers 298 298 [StorableHook(HookType.AfterDeserialization)] 299 private void AfterDeserializationHook() { 300 // BackwardsCompatibility3.3 301 #region Backwards compatible code (remove with 3.4) 302 if (operators == null) InitializeOperators(); 303 #endregion 304 AttachEventHandlers(); 305 } 306 299 307 private void AttachEventHandlers() { 300 // Start BackwardsCompatibility3.3 (remove with 3.4)301 if (operators == null) InitializeOperators();302 // End BackwardsCompatibility3.3303 308 ProblemSizeParameter.ValueChanged += new EventHandler(ProblemSizeParameter_ValueChanged); 304 309 ProblemSize.ValueChanged += new EventHandler(ProblemSize_ValueChanged); -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r4098 r4118 132 132 133 133 [StorableConstructor] 134 private TravelingSalesmanProblem(bool deserializing) : base( ) { }134 private TravelingSalesmanProblem(bool deserializing) : base(deserializing) { } 135 135 public TravelingSalesmanProblem() 136 136 : base() { … … 246 246 #region Helpers 247 247 [StorableHook(HookType.AfterDeserialization)] 248 private void AfterDeserializationHook() { 249 // BackwardsCompatibility3.3 250 #region Backwards compatible code (remove with 3.4) 251 if (operators == null) InitializeOperators(); 252 #endregion 253 AttachEventHandlers(); 254 } 255 248 256 private void AttachEventHandlers() { 249 // Start BackwardsCompatibility3.3 (remove with 3.4)250 if (operators == null) InitializeOperators();251 // End BackwardsCompatibility3.3252 257 CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 253 258 Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/VehicleRoutingProblem.cs
r4098 r4118 182 182 183 183 [StorableConstructor] 184 private VehicleRoutingProblem(bool deserializing) : base( ) { }184 private VehicleRoutingProblem(bool deserializing) : base(deserializing) { } 185 185 public VehicleRoutingProblem() 186 186 : base() { … … 295 295 #region Helpers 296 296 [StorableHook(HookType.AfterDeserialization)] 297 private void AfterDeserializationHook() { 298 // BackwardsCompatibility3.3 299 #region Backwards compatible code (remove with 3.4) 300 if (operators == null) InitializeOperators(); 301 #endregion 302 AttachEventHandlers(); 303 } 304 297 305 private void AttachEventHandlers() { 298 // Start BackwardsCompatibility3.3 (remove with 3.4)299 if (operators == null) InitializeOperators();300 // End BackwardsCompatibility3.3301 306 CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 302 307 Vehicles.ValueChanged += new EventHandler(VehiclesValue_ValueChanged);
Note: See TracChangeset
for help on using the changeset viewer.