- Timestamp:
- 05/10/10 14:18:22 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs
r3716 r3739 265 265 problem.EvaluatorChanged -= new EventHandler(Problem_EvaluatorChanged); 266 266 problem.OperatorsChanged -= new EventHandler(Problem_OperatorsChanged); 267 problem.Reset -= new EventHandler(Problem_Reset); 267 268 } 268 269 protected virtual void RegisterProblemEvents() { … … 270 271 problem.EvaluatorChanged += new EventHandler(Problem_EvaluatorChanged); 271 272 problem.OperatorsChanged += new EventHandler(Problem_OperatorsChanged); 273 problem.Reset += new EventHandler(Problem_Reset); 272 274 } 273 275 protected virtual void Problem_SolutionCreatorChanged(object sender, EventArgs e) { } 274 276 protected virtual void Problem_EvaluatorChanged(object sender, EventArgs e) { } 275 277 protected virtual void Problem_OperatorsChanged(object sender, EventArgs e) { } 278 protected virtual void Problem_Reset(object sender, EventArgs e) { 279 Prepare(); 280 } 276 281 277 282 protected virtual void DeregisterRunsEvents() { -
trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IProblem.cs
r3616 r3739 39 39 event EventHandler EvaluatorChanged; 40 40 event EventHandler OperatorsChanged; 41 event EventHandler Reset; 41 42 } 42 43 } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs
r3681 r3739 230 230 public event EventHandler SolutionCreatorChanged; 231 231 private void OnSolutionCreatorChanged() { 232 var changed = SolutionCreatorChanged; 233 if (changed != null) 234 changed(this, EventArgs.Empty); 232 EventHandler handler = SolutionCreatorChanged; 233 if (handler != null) handler(this, EventArgs.Empty); 235 234 } 236 235 public event EventHandler EvaluatorChanged; 237 236 private void OnEvaluatorChanged() { 238 var changed = EvaluatorChanged; 239 if (changed != null) 240 changed(this, EventArgs.Empty); 241 } 242 237 EventHandler handler = EvaluatorChanged; 238 if (handler != null) handler(this, EventArgs.Empty); 239 } 243 240 public event EventHandler OperatorsChanged; 244 241 private void OnOperatorsChanged() { 245 var changed = OperatorsChanged; 246 if (changed != null) 247 changed(this, EventArgs.Empty); 242 EventHandler handler = OperatorsChanged; 243 if (handler != null) handler(this, EventArgs.Empty); 244 } 245 public event EventHandler Reset; 246 private void OnReset() { 247 EventHandler handler = Reset; 248 if (handler != null) handler(this, EventArgs.Empty); 248 249 } 249 250 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
r3681 r3739 319 319 private void RaiseOperatorsChanged(EventArgs e) { 320 320 var changed = OperatorsChanged; 321 if (changed != null) 322 changed(this, e); 323 } 324 public event EventHandler Reset; 325 private void RaiseReset(EventArgs e) { 326 var changed = Reset; 321 327 if (changed != null) 322 328 changed(this, e); -
trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs
r3667 r3739 187 187 public event EventHandler SolutionCreatorChanged; 188 188 private void OnSolutionCreatorChanged() { 189 if (SolutionCreatorChanged != null)190 SolutionCreatorChanged(this, EventArgs.Empty);189 EventHandler handler = SolutionCreatorChanged; 190 if (handler != null) handler(this, EventArgs.Empty); 191 191 } 192 192 public event EventHandler EvaluatorChanged; 193 193 private void OnEvaluatorChanged() { 194 if (EvaluatorChanged != null) 195 EvaluatorChanged(this, EventArgs.Empty); 196 } 197 194 EventHandler handler = EvaluatorChanged; 195 if (handler != null) handler(this, EventArgs.Empty); 196 } 198 197 public event EventHandler OperatorsChanged; 199 198 private void OnOperatorsChanged() { 200 if (OperatorsChanged != null) 201 OperatorsChanged(this, EventArgs.Empty); 199 EventHandler handler = OperatorsChanged; 200 if (handler != null) handler(this, EventArgs.Empty); 201 } 202 public event EventHandler Reset; 203 private void OnReset() { 204 EventHandler handler = Reset; 205 if (handler != null) handler(this, EventArgs.Empty); 202 206 } 203 207 -
trunk/sources/HeuristicLab.Problems.OneMax/3.3/OnemaxProblem.cs
r3667 r3739 138 138 public event EventHandler SolutionCreatorChanged; 139 139 private void OnSolutionCreatorChanged() { 140 if (SolutionCreatorChanged != null)141 SolutionCreatorChanged(this, EventArgs.Empty);140 EventHandler handler = SolutionCreatorChanged; 141 if (handler != null) handler(this, EventArgs.Empty); 142 142 } 143 143 public event EventHandler EvaluatorChanged; 144 144 private void OnEvaluatorChanged() { 145 if (EvaluatorChanged != null) 146 EvaluatorChanged(this, EventArgs.Empty); 147 } 148 145 EventHandler handler = EvaluatorChanged; 146 if (handler != null) handler(this, EventArgs.Empty); 147 } 149 148 public event EventHandler OperatorsChanged; 150 149 private void OnOperatorsChanged() { 151 if (OperatorsChanged != null) 152 OperatorsChanged(this, EventArgs.Empty); 150 EventHandler handler = OperatorsChanged; 151 if (handler != null) handler(this, EventArgs.Empty); 152 } 153 public event EventHandler Reset; 154 private void OnReset() { 155 EventHandler handler = Reset; 156 if (handler != null) handler(this, EventArgs.Empty); 153 157 } 154 158 -
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r3719 r3739 165 165 public event EventHandler SolutionCreatorChanged; 166 166 private void OnSolutionCreatorChanged() { 167 if (SolutionCreatorChanged != null)168 SolutionCreatorChanged(this, EventArgs.Empty);167 EventHandler handler = SolutionCreatorChanged; 168 if (handler != null) handler(this, EventArgs.Empty); 169 169 } 170 170 public event EventHandler EvaluatorChanged; 171 171 private void OnEvaluatorChanged() { 172 if (EvaluatorChanged != null)173 EvaluatorChanged(this, EventArgs.Empty);172 EventHandler handler = EvaluatorChanged; 173 if (handler != null) handler(this, EventArgs.Empty); 174 174 } 175 175 public event EventHandler OperatorsChanged; 176 176 private void OnOperatorsChanged() { 177 if (OperatorsChanged != null) 178 OperatorsChanged(this, EventArgs.Empty); 179 } 177 EventHandler handler = OperatorsChanged; 178 if (handler != null) handler(this, EventArgs.Empty); 179 } 180 public event EventHandler Reset; 181 private void OnReset() { 182 EventHandler handler = Reset; 183 if (handler != null) handler(this, EventArgs.Empty); 184 } 185 180 186 private void ProblemSizeParameter_ValueChanged(object sender, EventArgs e) { 181 187 ProblemSize.ValueChanged += new EventHandler(ProblemSize_ValueChanged); -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r3663 r3739 191 191 BestKnownSolution = new Permutation(PermutationTypes.RelativeUndirected, tourParser.Tour); 192 192 } 193 OnReset(); 193 194 } 194 195 public void ImportFromTSPLIB(string tspFileName, string optimalTourFileName, double bestKnownQuality) { … … 200 201 public event EventHandler SolutionCreatorChanged; 201 202 private void OnSolutionCreatorChanged() { 202 if (SolutionCreatorChanged != null)203 SolutionCreatorChanged(this, EventArgs.Empty);203 EventHandler handler = SolutionCreatorChanged; 204 if (handler != null) handler(this, EventArgs.Empty); 204 205 } 205 206 public event EventHandler EvaluatorChanged; 206 207 private void OnEvaluatorChanged() { 207 if (EvaluatorChanged != null)208 EvaluatorChanged(this, EventArgs.Empty);208 EventHandler handler = EvaluatorChanged; 209 if (handler != null) handler(this, EventArgs.Empty); 209 210 } 210 211 public event EventHandler OperatorsChanged; 211 212 private void OnOperatorsChanged() { 212 if (OperatorsChanged != null) 213 OperatorsChanged(this, EventArgs.Empty); 213 EventHandler handler = OperatorsChanged; 214 if (handler != null) handler(this, EventArgs.Empty); 215 } 216 public event EventHandler Reset; 217 private void OnReset() { 218 EventHandler handler = Reset; 219 if (handler != null) handler(this, EventArgs.Empty); 214 220 } 215 221
Note: See TracChangeset
for help on using the changeset viewer.