- Timestamp:
- 04/07/16 15:26:47 (9 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 2 added
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs
r13722 r13748 107 107 108 108 public KnowledgeCenter() { 109 maximumEvaluations = new IntValue( 0);109 maximumEvaluations = new IntValue(10000); 110 110 instanceRuns = new RunCollection(); 111 seededRuns = new RunCollection(); 111 112 knowledgeBase = new RunCollection(); 112 113 suggestedInstances = new ItemList<IAlgorithm>(); … … 122 123 123 124 private void ProblemOnProblemChanged(object sender, EventArgs eventArgs) { 124 125 // TODO: Potentially, knowledge base has to be re-downloaded 125 126 } 126 127 … … 337 338 EventHandler exeStateChanged = (sender, e) => { 338 339 if (algorithmClone.ExecutionState == ExecutionState.Stopped) { 339 foreach (var solution in algorithmClone.Results.Where(x => x.Name.ToLower().Contains("solution")).Select(x => x.Value).OfType<IScope>()) { 340 Problem.Solutions.Add(new SingleObjectiveOKBSolution(Problem.ProblemId) { 341 Quality = solution.Variables.ContainsKey(Problem.Problem.Evaluator.QualityParameter.ActualName) ? ((DoubleValue)solution.Variables[Problem.Problem.Evaluator.QualityParameter.ActualName].Value).Value : double.NaN, 342 Solution = (IItem)solution.Clone() 343 }); 340 lock (Problem.Solutions) { 341 foreach (var solution in algorithmClone.Results.Where(x => x.Name.ToLower().Contains("solution")).Select(x => x.Value).OfType<IScope>()) { 342 Problem.Solutions.Add(new SingleObjectiveOKBSolution(Problem.ProblemId) { 343 Quality = solution.Variables.ContainsKey(Problem.Problem.Evaluator.QualityParameter.ActualName) ? ((DoubleValue)solution.Variables[Problem.Problem.Evaluator.QualityParameter.ActualName].Value).Value : double.NaN, 344 Solution = (IItem)solution.Clone() 345 }); 346 } 344 347 } 345 348 if (seedingStrategyLocal == SeedingStrategyTypes.NoSeeding) { 346 InstanceRuns.Add(algorithmClone.Runs.Last()); 347 } else SeededRuns.Add(algorithmClone.Runs.Last()); 349 lock (InstanceRuns) { 350 InstanceRuns.Add(algorithmClone.Runs.Last()); 351 } 352 } else { 353 lock (SeededRuns) { 354 SeededRuns.Add(algorithmClone.Runs.Last()); 355 } 356 } 348 357 waitHandle.Set(); 349 358 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem-3.3.csproj
r13743 r13748 191 191 <DependentUpon>AlgorithmControlForm.cs</DependentUpon> 192 192 </Compile> 193 <Compile Include="Toolbar\DownloadFromOKBToolbarItem.cs" /> 194 <Compile Include="Toolbar\ToolbarItemBase.cs" /> 193 195 <Compile Include="Views\KnowledgeCenterAllinOneView.cs"> 194 196 <SubType>UserControl</SubType> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Menu/0_Config/30_DownloadFromOkbMenuItem.cs
r13720 r13748 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Common.Resources; 24 using HeuristicLab.MainForm; 23 25 using System; 24 26 using System.Collections.Generic; … … 41 43 } 42 44 43 public override string ToolTipText { get { return "Download relevant runs from the knowledge base."; } } 45 public override string ToolTipText { 46 get { 47 return @"Download relevant runs, including algorithm instances 48 and problem instances from the OKB server."; 49 } 50 } 44 51 45 52 public override void Execute() { … … 51 58 ToolStripItem.Enabled = MainForm.ExpertSystem.Problem.ProblemId != -1; 52 59 MainForm.ExpertSystem.Problem.ProblemChanged += OnProblemChanged; 60 MainForm.ExpertSystem.DownloadStarted += OnDownloadStarted; 53 61 } 54 62 … … 56 64 ToolStripItem.Enabled = MainForm.ExpertSystem.Problem.ProblemId != -1; 57 65 } 66 67 private void OnDownloadStarted(object sender, EventArgs<IProgress> e) { 68 ToolStripItem.Enabled = false; 69 e.Value.ProgressStateChanged += DownloadProgressOnStateChanged; 70 } 71 72 private void DownloadProgressOnStateChanged(object sender, EventArgs eventArgs) { 73 var progress = (IProgress)sender; 74 if (progress.ProgressState == ProgressState.Finished || progress.ProgressState == ProgressState.Canceled) { 75 ToolStripItem.Enabled = true; 76 progress.ProgressStateChanged -= DownloadProgressOnStateChanged; 77 } 78 } 58 79 } 59 80 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/OptimizationKnowledgeCenter.cs
r13722 r13748 42 42 43 43 private void ExpertSystemOnDownloadStarted(object sender, EventArgs<IProgress> e) { 44 if (InvokeRequired) { Invoke((Action<object, EventArgs<IProgress>>)ExpertSystemOnDownloadStarted, sender, e); return; } 44 45 e.Value.ProgressStateChanged += OnProgressStateChanged; 45 46 e.Value.ProgressValueChanged += OnProgressValueChanged; … … 52 53 53 54 private void OnProgressStateChanged(object sender, EventArgs e) { 55 if (InvokeRequired) { Invoke((Action<object, EventArgs>)OnProgressStateChanged, sender, e); return; } 54 56 var progress = (IProgress)sender; 55 57 if (progress.ProgressState == ProgressState.Canceled … … 64 66 65 67 private void OnProgressValueChanged(object sender, EventArgs e) { 68 if (InvokeRequired) { Invoke((Action<object, EventArgs>)OnProgressValueChanged, sender, e); return; } 66 69 var progress = (IProgress)sender; 67 70 progressBar.Value = Math.Max(progressBar.Minimum, Math.Min(progressBar.Maximum, (int)(progress.ProgressValue * 100))); … … 69 72 70 73 private void OnProgressStatusChanged(object sender, EventArgs e) { 74 if (InvokeRequired) { Invoke((Action<object, EventArgs>)OnProgressStatusChanged, sender, e); return; } 71 75 var progress = (IProgress)sender; 72 76 progressLabel.Text = progress.Status.Replace(Environment.NewLine, " "); -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Toolbar/ToolbarItemBase.cs
r13739 r13748 22 22 using HeuristicLab.MainForm.WindowsForms; 23 23 24 namespace HeuristicLab.OptimizationExpertSystem. Menu{25 internal abstract class MenuItemBase : MenuItem, IOptimizationKnowledgeCenterUi {24 namespace HeuristicLab.OptimizationExpertSystem.Toolbar { 25 internal abstract class ToolbarItemBase : ToolBarItem, IOptimizationKnowledgeCenterUi { 26 26 public OptimizationKnowledgeCenter MainForm { 27 27 get { return (OptimizationKnowledgeCenter)HeuristicLab.MainForm.MainFormManager.MainForm; }
Note: See TracChangeset
for help on using the changeset viewer.