Changeset 1851
- Timestamp:
- 05/19/09 13:18:46 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.2/Interfaces/IOperator.cs
r1847 r1851 60 60 /// </summary> 61 61 ICollection<IVariable> Variables { get; } 62 /// <summary> 63 /// Gets information whether abortion of the operator is supported. 64 /// </summary> 65 bool SupportsAbort { get; } 62 66 63 /// <summary> 67 64 /// Adds the given sub operator to the current instance. -
trunk/sources/HeuristicLab.Core/3.2/OperatorBase.cs
r1847 r1851 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; }96 91 } 97 92 -
trunk/sources/HeuristicLab.SequentialEngine/3.2/SequentialEngine.cs
r1847 r1851 33 33 public class SequentialEngine : EngineBase, IEditable { 34 34 private IOperator currentOperator; 35 private IOperation currentOperation;36 35 37 36 /// <summary> … … 58 57 public override void Abort() { 59 58 base.Abort(); 60 if (currentOperator != null && currentOperator.SupportsAbort) {59 if (currentOperator != null) 61 60 currentOperator.Abort(); 62 myExecutionStack.Push(currentOperation);63 }64 61 } 65 62 … … 72 69 /// If the execution was successful <see cref="EngineBase.OnOperationExecuted"/> is called.</remarks> 73 70 protected override void ProcessNextOperation() { 74 currentOperation = myExecutionStack.Pop();75 if ( currentOperation is AtomicOperation) {76 AtomicOperation atomicOperation = (AtomicOperation) currentOperation;71 IOperation operation = myExecutionStack.Pop(); 72 if (operation is AtomicOperation) { 73 AtomicOperation atomicOperation = (AtomicOperation)operation; 77 74 IOperation next = null; 78 75 try { … … 90 87 OnOperationExecuted(atomicOperation); 91 88 if (atomicOperation.Operator.Breakpoint) Abort(); 92 } else if ( currentOperation is CompositeOperation) {93 CompositeOperation compositeOperation = (CompositeOperation) currentOperation;89 } else if (operation is CompositeOperation) { 90 CompositeOperation compositeOperation = (CompositeOperation)operation; 94 91 for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--) 95 92 myExecutionStack.Push(compositeOperation.Operations[i]); -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorCreator.cs
r1848 r1851 34 34 private object locker = new object(); 35 35 private bool abortRequested = false; 36 37 public override bool SupportsAbort {38 get {39 return true;40 }41 }42 36 43 37 public SupportVectorCreator() … … 103 97 rangeTransformData.Data = rangeTransform; 104 98 scope.AddVariable(new Variable(scope.TranslateName("SVMRangeTransform"), rangeTransformData)); 99 return null; 100 } else { 101 return new AtomicOperation(this, scope); 105 102 } 106 return null;107 103 } 108 104
Note: See TracChangeset
for help on using the changeset viewer.