- Timestamp:
- 06/15/12 21:37:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/CreateExperimentDialog.cs
r8011 r8012 682 682 int counter = 0, totalVariations = GetNumberOfVariations(); 683 683 if (instances.Count == 0) { 684 AddParameterVariations(Optimizer, localExperiment, ref counter, totalVariations); 684 try { 685 AddParameterVariations(Optimizer, localExperiment, ref counter, totalVariations); 686 } catch (OperationCanceledException) { 687 e.Cancel = true; 688 localExperiment = null; 689 return; 690 } 685 691 experimentCreationBackgroundWorker.ReportProgress(100, string.Empty); 686 687 692 } else { 688 693 foreach (var provider in instances.Keys) { 689 694 foreach (var descriptor in instances[provider]) { 690 #region Check cancellation request691 if (experimentCreationBackgroundWorker.CancellationPending) {692 e.Cancel = true;693 localExperiment = null;694 return;695 }696 #endregion697 695 var algorithm = (IAlgorithm)Optimizer.Clone(); 698 696 bool failed = false; 699 697 try { 700 698 ProblemInstanceManager.LoadData(provider, descriptor, (IProblemInstanceConsumer)algorithm.Problem); 701 } 702 catch (Exception ex) { 699 } catch (Exception ex) { 703 700 failedInstances.AppendLine(descriptor.Name + ": " + ex.Message); 704 701 failed = true; 705 702 } 706 703 if (!failed) { 707 708 AddParameterVariations(algorithm, localExperiment, ref counter, totalVariations); 704 try { 705 AddParameterVariations(algorithm, localExperiment, ref counter, totalVariations); 706 } catch (OperationCanceledException) { 707 e.Cancel = true; 708 localExperiment = null; 709 return; 710 } 709 711 } else experimentCreationBackgroundWorker.ReportProgress((int)Math.Round((100.0 * counter) / totalVariations), "Loading failed (" + descriptor.Name + ")"); 710 712 } … … 724 726 var variations = experimentCreationBackgroundWorker_CalculateParameterVariations(optimizer); 725 727 foreach (var v in variations) { 728 if (experimentCreationBackgroundWorker.CancellationPending) 729 throw new OperationCanceledException(); 726 730 AddOptimizer(v, localExperiment); 727 731 counter++;
Note: See TracChangeset
for help on using the changeset viewer.