Changeset 8965 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 11/28/12 12:19:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r8962 r8965 73 73 RegisterEvents(); 74 74 if (Algorithm != null) RegisterAlgorithmEvents(); 75 if (Problem != null) Problem.Reset += (o, e) => OnProblemChanged(); 75 76 } 76 77 … … 521 522 private void RegisterEvents() { 522 523 Folds.ValueChanged += new EventHandler(Folds_ValueChanged); 523 SamplesStart.ValueChanged += new EventHandler(SamplesStart_ValueChanged);524 SamplesEnd.ValueChanged += new EventHandler(SamplesEnd_ValueChanged);525 524 RegisterClonedAlgorithmsEvents(); 526 525 } … … 530 529 } 531 530 532 private bool samplesChanged = false;533 private void SamplesStart_ValueChanged(object sender, EventArgs e) {534 samplesChanged = true;535 if (Problem != null) Problem.ProblemData.TrainingPartition.Start = SamplesStart.Value;536 samplesChanged = false;537 }538 private void SamplesEnd_ValueChanged(object sender, EventArgs e) {539 samplesChanged = true;540 if (Problem != null) Problem.ProblemData.TrainingPartition.End = SamplesEnd.Value;541 samplesChanged = false;542 }543 531 544 532 #region template algorithms events … … 571 559 EventHandler handler = ProblemChanged; 572 560 if (handler != null) handler(this, EventArgs.Empty); 573 if (samplesChanged) return;574 561 575 562 SamplesStart.Value = 0; … … 593 580 } else 594 581 SamplesEnd.Value = 0; 595 596 SamplesStart_ValueChanged(this, EventArgs.Empty);597 SamplesEnd_ValueChanged(this, EventArgs.Empty);598 582 } 599 583 … … 689 673 lock (locker) { 690 674 if (!stopPending && ExecutionState == ExecutionState.Started) { 691 IAlgorithm preparedAlgorithm = clonedAlgorithms. Where(alg => alg.ExecutionState == ExecutionState.Prepared ||692 alg.ExecutionState == ExecutionState.Paused).FirstOrDefault();675 IAlgorithm preparedAlgorithm = clonedAlgorithms.FirstOrDefault(alg => alg.ExecutionState == ExecutionState.Prepared || 676 alg.ExecutionState == ExecutionState.Paused); 693 677 if (preparedAlgorithm != null) preparedAlgorithm.Start(); 694 678 }
Note: See TracChangeset
for help on using the changeset viewer.