- Timestamp:
- 03/22/08 10:52:14 (17 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators/CombinedOperator.cs
r82 r89 28 28 29 29 namespace HeuristicLab.Operators { 30 public class CombinedOperator : OperatorBase{30 public class CombinedOperator : DelegatingOperator { 31 31 private string myDescription; 32 32 public override string Description { … … 62 62 clone.myOperatorGraph = (IOperatorGraph)Auxiliary.Clone(OperatorGraph, clonedObjects); 63 63 return clone; 64 }65 66 public override IOperation Execute(IScope scope) {67 myCanceled = false;68 69 if (scope.GetVariable(Guid.ToString()) == null) { // contained operator not yet executed70 // add marker71 scope.AddVariable(new Variable(Guid.ToString(), new NullData()));72 73 // add aliases74 foreach (IVariableInfo variableInfo in VariableInfos)75 scope.AddAlias(variableInfo.FormalName, variableInfo.ActualName);76 77 CompositeOperation next = new CompositeOperation();78 next.AddOperation(Apply(scope));79 // execute combined operator again after contained operators have been executed80 next.AddOperation(new AtomicOperation(this, scope));81 82 OnExecuted();83 return next;84 } else { // contained operator already executed85 // remove marker86 scope.RemoveVariable(Guid.ToString());87 88 // remove aliases89 foreach (IVariableInfo variableInfo in VariableInfos)90 scope.RemoveAlias(variableInfo.FormalName);91 92 OnExecuted();93 return null;94 }95 64 } 96 65 -
trunk/sources/HeuristicLab.Operators/DelegatingOperator.cs
r88 r89 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq;4 3 using System.Text; 5 4 using HeuristicLab.Core; 6 5 using HeuristicLab.Data; 7 6 8 namespace HeuristicLab. StructureIdentification{7 namespace HeuristicLab.Operators { 9 8 public abstract class DelegatingOperator : OperatorBase { 10 9 public override IOperation Execute(IScope scope) { 11 10 myCanceled = false; 12 11 13 // copied from CombinedOperator (gkronber 22.3.08)14 12 if(scope.GetVariable(Guid.ToString()) == null) { // contained operator not yet executed 15 13 // add marker -
trunk/sources/HeuristicLab.Operators/HeuristicLab.Operators.csproj
r51 r89 64 64 <SubType>Code</SubType> 65 65 </Compile> 66 <Compile Include="DelegatingOperator.cs" /> 66 67 <Compile Include="StochasticMultiBranch.cs" /> 67 68 <Compile Include="SubScopesMixer.cs" /> -
trunk/sources/HeuristicLab.StructureIdentification/HeuristicLab.StructureIdentification.csproj
r88 r89 48 48 </ItemGroup> 49 49 <ItemGroup> 50 <Compile Include="DelegatingOperator.cs" />51 50 <Compile Include="Evaluation\CoefficientOfDeterminationEvaluator.cs" /> 52 51 <Compile Include="Evaluation\FunctionEvaluator.cs">
Note: See TracChangeset
for help on using the changeset viewer.