Changeset 8969 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 11/28/12 17:21:55 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r8965 r8969 73 73 RegisterEvents(); 74 74 if (Algorithm != null) RegisterAlgorithmEvents(); 75 if (Problem != null) Problem.Reset += (o, e) => OnProblemChanged();76 75 } 77 76 … … 121 120 } 122 121 OnAlgorithmChanged(); 123 if (algorithm != null) OnProblemChanged();124 122 Prepare(); 125 123 } … … 541 539 algorithm.ProblemChanged += new EventHandler(Algorithm_ProblemChanged); 542 540 algorithm.ExecutionStateChanged += new EventHandler(Algorithm_ExecutionStateChanged); 541 if (Problem != null) Problem.Reset += new EventHandler(Problem_Reset); 543 542 } 544 543 private void DeregisterAlgorithmEvents() { 545 544 algorithm.ProblemChanged -= new EventHandler(Algorithm_ProblemChanged); 546 545 algorithm.ExecutionStateChanged -= new EventHandler(Algorithm_ExecutionStateChanged); 546 if (Problem != null) Problem.Reset -= new EventHandler(Problem_Reset); 547 547 } 548 548 private void Algorithm_ProblemChanged(object sender, EventArgs e) { … … 551 551 throw new ArgumentException("A cross validation algorithm can only contain DataAnalysisProblems."); 552 552 } 553 algorithm.Problem.Reset += (x, y) => OnProblemChanged(); 553 if(problem!= null) problem.Reset -= new EventHandler(Problem_Reset); 554 if (Problem != null) Problem.Reset += new EventHandler(Problem_Reset); 554 555 problem = (IDataAnalysisProblem)algorithm.Problem; 555 556 OnProblemChanged(); … … 559 560 EventHandler handler = ProblemChanged; 560 561 if (handler != null) handler(this, EventArgs.Empty); 561 562 SamplesStart.Value = 0; 562 ConfigureProblem(); 563 } 564 565 private void Problem_Reset(object sender, EventArgs e) { 566 ConfigureProblem(); 567 } 568 569 private void ConfigureProblem(){ 570 SamplesStart.Value = 0; 563 571 if (Problem != null) { 564 572 SamplesEnd.Value = Problem.ProblemData.Dataset.Rows;
Note: See TracChangeset
for help on using the changeset viewer.