Changeset 2773 for trunk/sources/HeuristicLab.Core
- Timestamp:
- 02/10/10 03:39:02 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Core/3.3
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/Engine.cs
r2757 r2773 93 93 /// </summary> 94 94 [Storable] 95 private Stack<IExecution Context> executionStack;95 private Stack<IExecutionSequence> executionStack; 96 96 /// <summary> 97 97 /// Gets the current execution stack. 98 98 /// </summary> 99 protected Stack<IExecution Context> ExecutionStack {99 protected Stack<IExecutionSequence> ExecutionStack { 100 100 get { return executionStack; } 101 101 } … … 135 135 protected Engine() { 136 136 globalScope = new Scope("Global"); 137 executionStack = new Stack<IExecution Context>();137 executionStack = new Stack<IExecutionSequence>(); 138 138 OperatorGraph = new OperatorGraph(); 139 139 } … … 151 151 clone.globalScope = (Scope)cloner.Clone(globalScope); 152 152 clone.executionTime = executionTime; 153 IExecution Context[] contexts = executionStack.ToArray();153 IExecutionSequence[] contexts = executionStack.ToArray(); 154 154 for (int i = contexts.Length - 1; i >= 0; i--) 155 clone.executionStack.Push((IExecution Context)cloner.Clone(contexts[i]));155 clone.executionStack.Push((IExecutionSequence)cloner.Clone(contexts[i])); 156 156 clone.running = running; 157 157 clone.canceled = canceled; -
trunk/sources/HeuristicLab.Core/3.3/ExecutionContext.cs
r2757 r2773 26 26 27 27 namespace HeuristicLab.Core { 28 public class ExecutionContext : DeepCloneable, IExecution Context{28 public class ExecutionContext : DeepCloneable, IExecutionSequence { 29 29 [Storable] 30 30 private ExecutionContext parent; -
trunk/sources/HeuristicLab.Core/3.3/ExecutionContextCollection.cs
r2757 r2773 28 28 29 29 namespace HeuristicLab.Core { 30 public class ExecutionContextCollection : DeepCloneable, IList<IExecution Context>, IExecutionContext{30 public class ExecutionContextCollection : DeepCloneable, IList<IExecutionSequence>, IExecutionSequence { 31 31 [Storable] 32 private IList<IExecution Context> contexts;32 private IList<IExecutionSequence> contexts; 33 33 34 34 [Storable] … … 40 40 41 41 public ExecutionContextCollection() { 42 contexts = new List<IExecution Context>();42 contexts = new List<IExecutionSequence>(); 43 43 parallel = false; 44 44 } 45 public ExecutionContextCollection(IEnumerable<IExecution Context> collection) {46 contexts = new List<IExecution Context>(collection.Where(e => e != null));45 public ExecutionContextCollection(IEnumerable<IExecutionSequence> collection) { 46 contexts = new List<IExecutionSequence>(collection.Where(e => e != null)); 47 47 parallel = false; 48 48 } 49 public ExecutionContextCollection(params IExecution Context[] list) {50 contexts = new List<IExecution Context>(list.Where(e => e != null));49 public ExecutionContextCollection(params IExecutionSequence[] list) { 50 contexts = new List<IExecutionSequence>(list.Where(e => e != null)); 51 51 parallel = false; 52 52 } … … 57 57 clone.parallel = parallel; 58 58 for (int i = 0; i < contexts.Count; i++) 59 clone.contexts.Add((IExecution Context)cloner.Clone(contexts[i]));59 clone.contexts.Add((IExecutionSequence)cloner.Clone(contexts[i])); 60 60 return clone; 61 61 } 62 62 63 63 #region IList<IExecutionContext> Members 64 public int IndexOf(IExecution Contextitem) {64 public int IndexOf(IExecutionSequence item) { 65 65 return contexts.IndexOf(item); 66 66 } 67 public void Insert(int index, IExecution Contextitem) {67 public void Insert(int index, IExecutionSequence item) { 68 68 if (item != null) contexts.Insert(index, item); 69 69 } … … 71 71 contexts.RemoveAt(index); 72 72 } 73 public IExecution Contextthis[int index] {73 public IExecutionSequence this[int index] { 74 74 get { return contexts[index]; } 75 75 set { if (value != null) contexts[index] = value; } … … 78 78 79 79 #region ICollection<IExecutionContext> Members 80 public void Add(IExecution Contextitem) {80 public void Add(IExecutionSequence item) { 81 81 if (item != null) contexts.Add(item); 82 82 } … … 84 84 contexts.Clear(); 85 85 } 86 public bool Contains(IExecution Contextitem) {86 public bool Contains(IExecutionSequence item) { 87 87 return contexts.Contains(item); 88 88 } 89 public void CopyTo(IExecution Context[] array, int arrayIndex) {89 public void CopyTo(IExecutionSequence[] array, int arrayIndex) { 90 90 contexts.CopyTo(array, arrayIndex); 91 91 } … … 96 96 get { return contexts.IsReadOnly; } 97 97 } 98 public bool Remove(IExecution Contextitem) {98 public bool Remove(IExecutionSequence item) { 99 99 return contexts.Remove(item); 100 100 } … … 102 102 103 103 #region IEnumerable<IExecutionContext> Members 104 public IEnumerator<IExecution Context> GetEnumerator() {104 public IEnumerator<IExecutionSequence> GetEnumerator() { 105 105 return contexts.GetEnumerator(); 106 106 } -
trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj
r2757 r2773 104 104 <Compile Include="ChangedEventArgs.cs" /> 105 105 <None Include="HeuristicLabCorePlugin.cs.frame" /> 106 <Compile Include="Interfaces\IExecution Context.cs" />106 <Compile Include="Interfaces\IExecutionSequence.cs" /> 107 107 <Compile Include="Interfaces\IValueLookupParameter.cs" /> 108 108 <Compile Include="Interfaces\IValueParameter.cs" /> -
trunk/sources/HeuristicLab.Core/3.3/Interfaces/IExecutionSequence.cs
r2772 r2773 30 30 /// Interface which represents an execution context. 31 31 /// </summary> 32 public interface IExecution Context: IDeepCloneable { }32 public interface IExecutionSequence : IDeepCloneable { } 33 33 } -
trunk/sources/HeuristicLab.Core/3.3/Interfaces/IOperator.cs
r2757 r2773 44 44 /// <param name="scope">The scope where to execute the current instance.</param> 45 45 /// <returns>The next operation.</returns> 46 IExecution ContextExecute(ExecutionContext context);46 IExecutionSequence Execute(ExecutionContext context); 47 47 /// <summary> 48 48 /// Aborts the current operator.
Note: See TracChangeset
for help on using the changeset viewer.