Changeset 3226 for trunk/sources/HeuristicLab.Optimization
- Timestamp:
- 03/28/10 04:11:23 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization/3.3
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs ¶
r3107 r3226 66 66 } 67 67 68 public abstract IObservableKeyedCollection<string, IVariable>Results { get; }68 public abstract ResultCollection Results { get; } 69 69 70 70 public abstract TimeSpan ExecutionTime { get; } … … 73 73 public bool Running { 74 74 get { return running; } 75 protected set { 76 if (running != value) { 77 running = value; 78 OnRunningChanged(); 79 } 80 } 75 81 } 76 82 … … 98 104 clone.Problem = (IProblem)cloner.Clone(problem); 99 105 clone.running = running; 100 clone. Canceled = canceled;106 clone.canceled = canceled; 101 107 return clone; 102 108 } 103 109 104 110 public void Prepare() { 105 running = false;106 Canceled = false;107 111 OnPrepared(); 108 112 } 109 113 public void Start() { 110 running = true;114 Running = true; 111 115 Canceled = false; 112 116 OnStarted(); … … 127 131 ExecutionTimeChanged(this, EventArgs.Empty); 128 132 } 133 public event EventHandler RunningChanged; 134 protected virtual void OnRunningChanged() { 135 if (RunningChanged != null) 136 RunningChanged(this, EventArgs.Empty); 137 } 129 138 public event EventHandler Prepared; 130 139 protected virtual void OnPrepared() { … … 141 150 if (Stopped != null) 142 151 Stopped(this, EventArgs.Empty); 152 Canceled = false; 153 Running = false; 143 154 } 144 155 protected virtual void OnCanceledChanged() { } -
TabularUnified trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs ¶
r3017 r3226 88 88 } 89 89 90 private ReadOnlyObservableKeyedCollection<string, IVariable> readOnlyResults; 91 public override IObservableKeyedCollection<string, IVariable> Results { 90 public override ResultCollection Results { 92 91 get { 93 if (readOnlyResults == null) 94 readOnlyResults = ((VariableCollection)globalScope.Variables["Results"].Value).AsReadOnly(); 95 return readOnlyResults; 92 return (ResultCollection)globalScope.Variables["Results"].Value; 96 93 } 97 94 } … … 114 111 : base() { 115 112 globalScope = new Scope("Global Scope"); 116 globalScope.Variables.Add(new Variable("Results", new VariableCollection()));113 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 117 114 OperatorGraph = new OperatorGraph(); 118 115 InitializeEngine(); … … 121 118 : base(name) { 122 119 globalScope = new Scope("Global Scope"); 123 globalScope.Variables.Add(new Variable("Results", new VariableCollection()));120 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 124 121 OperatorGraph = new OperatorGraph(); 125 122 InitializeEngine(); … … 128 125 : base(name, parameters) { 129 126 globalScope = new Scope("Global Scope"); 130 globalScope.Variables.Add(new Variable("Results", new VariableCollection()));127 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 131 128 OperatorGraph = new OperatorGraph(); 132 129 InitializeEngine(); … … 135 132 : base(name, description) { 136 133 globalScope = new Scope("Global Scope"); 137 globalScope.Variables.Add(new Variable("Results", new VariableCollection()));134 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 138 135 OperatorGraph = new OperatorGraph(); 139 136 InitializeEngine(); … … 142 139 : base(name, description, parameters) { 143 140 globalScope = new Scope("Global Scope"); 144 globalScope.Variables.Add(new Variable("Results", new VariableCollection()));141 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 145 142 OperatorGraph = new OperatorGraph(); 146 143 InitializeEngine(); … … 181 178 protected override void OnPrepared() { 182 179 globalScope.Clear(); 183 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 184 readOnlyResults = null; 180 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 185 181 186 182 if (engine != null) { -
TabularUnified trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj ¶
r3107 r3226 86 86 <None Include="HeuristicLabOptimizationPlugin.cs.frame" /> 87 87 <Compile Include="Algorithm.cs" /> 88 <Compile Include="BatchRun.cs" /> 89 <Compile Include="ResultCollectionList.cs" /> 88 90 <Compile Include="Interfaces\IMultiObjectiveSolutionsVisualizer.cs" /> 91 <Compile Include="Interfaces\IResult.cs" /> 89 92 <Compile Include="Interfaces\ISingleObjectiveSolutionsVisualizer.cs" /> 90 93 <Compile Include="Interfaces\ISolutionsVisualizer.cs" /> … … 114 117 <Compile Include="Interfaces\ITabuMoveEvaluator.cs" /> 115 118 <Compile Include="Interfaces\ITabuMoveMaker.cs" /> 119 <Compile Include="Result.cs" /> 116 120 <Compile Include="TabuMoveMaker.cs" /> 117 121 <Compile Include="UserDefinedAlgorithm.cs" /> … … 119 123 <Compile Include="HeuristicLabOptimizationPlugin.cs" /> 120 124 <Compile Include="Properties\AssemblyInfo.cs" /> 125 <Compile Include="ResultCollection.cs" /> 121 126 </ItemGroup> 122 127 <ItemGroup> -
TabularUnified trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IAlgorithm.cs ¶
r2882 r3226 32 32 Type ProblemType { get; } 33 33 IProblem Problem { get; set; } 34 IObservableKeyedCollection<string, IVariable>Results { get; }34 ResultCollection Results { get; } 35 35 TimeSpan ExecutionTime { get; } 36 36 bool Running { get; } … … 43 43 event EventHandler ProblemChanged; 44 44 event EventHandler ExecutionTimeChanged; 45 event EventHandler RunningChanged; 45 46 event EventHandler Prepared; 46 47 event EventHandler Started;
Note: See TracChangeset
for help on using the changeset viewer.