Changeset 1847
- Timestamp:
- 05/18/09 23:14:57 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.2/Interfaces/IOperator.cs
r776 r1847 60 60 /// </summary> 61 61 ICollection<IVariable> Variables { get; } 62 62 /// <summary> 63 /// Gets information whether abortion of the operator is supported. 64 /// </summary> 65 bool SupportsAbort { get; } 63 66 /// <summary> 64 67 /// Adds the given sub operator to the current instance. -
trunk/sources/HeuristicLab.Core/3.2/OperatorBase.cs
r1529 r1847 89 89 public virtual ICollection<IVariable> Variables { 90 90 get { return myVariables.Values; } 91 } 92 /// <inheritdoc/> 93 /// The default is false. 94 public virtual bool SupportsAbort { 95 get { return false; } 91 96 } 92 97 -
trunk/sources/HeuristicLab.SequentialEngine/3.2/SequentialEngine.cs
r1530 r1847 33 33 public class SequentialEngine : EngineBase, IEditable { 34 34 private IOperator currentOperator; 35 private IOperation currentOperation; 35 36 36 37 /// <summary> … … 57 58 public override void Abort() { 58 59 base.Abort(); 59 if (currentOperator != null )60 if (currentOperator != null && currentOperator.SupportsAbort) { 60 61 currentOperator.Abort(); 62 myExecutionStack.Push(currentOperation); 63 } 61 64 } 62 65 … … 69 72 /// If the execution was successful <see cref="EngineBase.OnOperationExecuted"/> is called.</remarks> 70 73 protected override void ProcessNextOperation() { 71 IOperation operation = myExecutionStack.Pop();72 if ( operation is AtomicOperation) {73 AtomicOperation atomicOperation = (AtomicOperation) operation;74 currentOperation = myExecutionStack.Pop(); 75 if (currentOperation is AtomicOperation) { 76 AtomicOperation atomicOperation = (AtomicOperation)currentOperation; 74 77 IOperation next = null; 75 78 try { … … 87 90 OnOperationExecuted(atomicOperation); 88 91 if (atomicOperation.Operator.Breakpoint) Abort(); 89 } else if ( operation is CompositeOperation) {90 CompositeOperation compositeOperation = (CompositeOperation) operation;92 } else if (currentOperation is CompositeOperation) { 93 CompositeOperation compositeOperation = (CompositeOperation)currentOperation; 91 94 for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--) 92 95 myExecutionStack.Push(compositeOperation.Operations[i]);
Note: See TracChangeset
for help on using the changeset viewer.