Changeset 10121 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3
- Timestamp:
- 11/11/13 15:51:16 (11 years ago)
- Location:
- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/HeuristicLab.Analysis.SolutionCaching-3.3.csproj
r10117 r10121 69 69 <SpecificVersion>False</SpecificVersion> 70 70 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Hive-3.3.dll</HintPath> 71 <Private>False</Private> 72 </Reference> 73 <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 74 <SpecificVersion>False</SpecificVersion> 75 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath> 71 76 <Private>False</Private> 72 77 </Reference> -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/Plugin.cs.frame
r10114 r10121 29 29 [PluginDependency("HeuristicLab.Hive", "3.3")] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] 31 [PluginDependency("HeuristicLab.MainForm", "3.3")] 31 32 [PluginDependency("HeuristicLab.Core", "3.3")] 32 33 [PluginDependency("HeuristicLab.Data", "3.3")] -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/RunCollectionModifiers/RunCollectionModifierExecutable.cs
r10120 r10121 27 27 using HeuristicLab.Common; 28 28 using HeuristicLab.Core; 29 using HeuristicLab.MainForm; 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Parameters; … … 59 60 } 60 61 62 [Storable] 63 protected Stack<IRunCollectionModifier> executionStack; 64 protected Stack<IRunCollectionModifier> ExecutionStack { 65 get { return executionStack; } 66 } 67 68 [Storable] 69 protected ILog log; 70 public ILog Log { 71 get { return log; } 72 } 73 74 protected CancellationTokenSource cancellationTokenSource; 75 protected bool stopPending; 76 public IProgress Progress { get; set; } 77 61 78 public ValueParameter<ItemList<IRunCollectionModifier>> RunCollectionModifiersParameter { 62 79 get { return (ValueParameter<ItemList<IRunCollectionModifier>>)Parameters["RunCollectionModifiers"]; } … … 72 89 get { return RunCollectionModifiersParameter.Value; } 73 90 } 74 75 [Storable]76 protected Stack<IRunCollectionModifier> executionStack;77 protected Stack<IRunCollectionModifier> ExecutionStack {78 get { return executionStack; }79 }80 81 [Storable]82 protected ILog log;83 public ILog Log {84 get { return log; }85 }86 87 protected CancellationTokenSource cancellationTokenSource;88 protected bool stopPending;89 91 90 92 #region Constructors and Cloning … … 94 96 executionStack = new Stack<IRunCollectionModifier>(); 95 97 log = new Log(); 98 executionState = ExecutionState.Stopped; 96 99 } 97 100 [StorableConstructor] … … 112 115 #endregion 113 116 117 protected virtual void ReportProgress(double progress) { 118 if (Progress != null) { 119 Progress.ProgressValue = progress; 120 } 121 } 122 123 protected virtual void FinishProgress() { 124 if (Progress != null) { 125 Progress.Finish(); 126 } 127 } 128 114 129 public void Pause() { 115 130 cancellationTokenSource.Cancel(); … … 121 136 executionStack.Push(RunCollectionModifiers[i]); 122 137 } 138 OnPrepared(); 123 139 } 124 140 … … 140 156 } 141 157 } 158 FinishProgress(); 142 159 cancellationTokenSource.Dispose(); 143 160 cancellationTokenSource = null; … … 150 167 public void Stop() { 151 168 if (ExecutionState == ExecutionState.Paused) { 152 executionStack.Clear();153 169 OnStopped(); 154 170 } else { … … 173 189 ct.ThrowIfCancellationRequested(); 174 190 next.Modify(runs); 191 if (executionStack.Count > 0) { 192 ReportProgress(((double)RunCollectionModifiers.Count) / executionStack.Count()); 193 } else { 194 ReportProgress(1.0); 195 } 175 196 } 176 197 catch (Exception ex) { -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/RunCollectionModifiers/RunCollectionModifierHiveTask.cs
r10117 r10121 97 97 var rcmHiveTask = new RunCollectionModifierHiveTask(exec); 98 98 rcmHiveTask.Task.Priority = Task.Priority; 99 rcmHiveTask.ItemTask.IsParallelizable = false; 99 100 childHiveTasks.Add(rcmHiveTask); 100 101 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/RunCollectionModifiers/RunCollectionModifierTask.cs
r10119 r10121 35 35 } 36 36 37 [Storable] 38 private bool isParallelizable; 39 public override bool IsParallelizable { 40 get { return isParallelizable; } 41 set { isParallelizable = value; } 42 } 43 37 44 #region Constructors and Cloning 38 45 public RunCollectionModifierTask(RunCollectionModifierExecutable executable) 39 46 : base() { 40 47 Item = executable; 48 isParallelizable = true; 41 49 } 42 50 [StorableConstructor] … … 44 52 protected RunCollectionModifierTask(RunCollectionModifierTask original, Cloner cloner) 45 53 : base(original, cloner) { 54 isParallelizable = original.isParallelizable; 46 55 } 47 56 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.