- Timestamp:
- 01/20/10 05:10:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SequentialEngine/3.3/SequentialEngine.cs
r2546 r2656 24 24 using System.Text; 25 25 using HeuristicLab.Core; 26 using System.Threading;27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 27 … … 43 42 /// <remarks>Calls <see cref="EngineBase.Abort"/> of base class <see cref="EngineBase"/> and 44 43 /// <see cref="IOperator.Abort"/> of the current <see cref="IOperator"/>.</remarks> 45 public override void Abort() {46 base. Abort();44 public override void Stop() { 45 base.Stop(); 47 46 if (currentOperator != null) 48 47 currentOperator.Abort(); … … 56 55 /// is pushed on the stack again.<br/> 57 56 /// If the execution was successful <see cref="EngineBase.OnOperationExecuted"/> is called.</remarks> 58 protected override void ProcessNextOperation() { 59 IOperation operation = myExecutionStack.Pop(); 60 if (operation is AtomicOperation) { 61 AtomicOperation atomicOperation = (AtomicOperation)operation; 62 IOperation next = null; 63 try { 64 currentOperator = atomicOperation.Operator; 65 next = atomicOperation.Operator.Execute(atomicOperation.Scope); 66 } 67 catch (Exception ex) { 68 // push operation on stack again 69 myExecutionStack.Push(atomicOperation); 70 Abort(); 71 ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex);}); 72 } 73 if (next != null) 74 myExecutionStack.Push(next); 75 OnOperationExecuted(atomicOperation); 76 if (atomicOperation.Operator.Breakpoint) Abort(); 77 } else if (operation is CompositeOperation) { 78 CompositeOperation compositeOperation = (CompositeOperation)operation; 79 for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--) 80 myExecutionStack.Push(compositeOperation.Operations[i]); 57 protected override void ProcessNextOperator() { 58 currentOperator = null; 59 ExecutionContext context = ExecutionStack.Pop(); 60 ExecutionContextCollection next = null; 61 try { 62 currentOperator = context.Operator; 63 next = context.Operator.Execute(context); 64 currentOperator = null; 81 65 } 66 catch (Exception ex) { 67 ExecutionStack.Push(context); 68 Stop(); 69 OnExceptionOccurred(ex); 70 } 71 if (next != null) { 72 for (int i = next.Count - 1; i >= 0; i--) 73 ExecutionStack.Push(next[i]); 74 } 75 if (context.Operator.Breakpoint) 76 Stop(); 82 77 } 83 78 }
Note: See TracChangeset
for help on using the changeset viewer.