Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/15/10 05:26:02 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on operators, parameters and problems
Location:
trunk/sources/HeuristicLab.Operators/3.3
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/CombinedOperator.cs

    r2794 r2796  
    6666      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    6767      if (operatorGraph.InitialOperator != null)
    68         next.Insert(0, new ExecutionContext(ExecutionContext, operatorGraph.InitialOperator, ExecutionContext.Scope));
     68        next.Insert(0, ExecutionContext.CreateChildContext(operatorGraph.InitialOperator));
    6969      return next;
    7070    }
  • trunk/sources/HeuristicLab.Operators/3.3/ConditionalBranch.cs

    r2794 r2796  
    6161      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    6262      if (ConditionParameter.ActualValue.Value) {
    63         if (TrueBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, TrueBranch, ExecutionContext.Scope));
     63        if (TrueBranch != null) next.Insert(0, ExecutionContext.CreateContext(TrueBranch));
    6464      } else {
    65         if (FalseBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, FalseBranch, ExecutionContext.Scope));
     65        if (FalseBranch != null) next.Insert(0, ExecutionContext.CreateContext(FalseBranch));
    6666      }
    6767      return next;
  • trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj

    r2794 r2796  
    108108    </Compile>
    109109    <Compile Include="HeuristicLabOperatorsPlugin.cs" />
    110     <Compile Include="Operator.cs" />
    111110    <Compile Include="Properties\AssemblyInfo.cs" />
    112111    <Compile Include="SingleSuccessorOperator.cs" />
  • trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs

    r2794 r2796  
    110110      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    111111      for (int i = Operators.Count - 1; i >= 0; i--)
    112         next.Insert(0, new ExecutionContext(ExecutionContext.Parent, Operators[i], ExecutionContext.Scope));
     112        next.Insert(0, ExecutionContext.CreateContext(Operators[i]));
    113113      return next;
    114114    }
  • trunk/sources/HeuristicLab.Operators/3.3/ParallelSubScopesProcessor.cs

    r2794 r2796  
    3939        inner.Parallel = true;
    4040        for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++)
    41           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operators[i], ExecutionContext.Scope.SubScopes[i]));
     41          inner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i]));
    4242        next.Insert(0, inner);
    4343      }
  • trunk/sources/HeuristicLab.Operators/3.3/Placeholder.cs

    r2794 r2796  
    4545      IOperator op = OperatorParameter.ActualValue;
    4646      if (op != null)
    47         next.Insert(0, new ExecutionContext(ExecutionContext.Parent, op, ExecutionContext.Scope));
     47        next.Insert(0, ExecutionContext.CreateContext(op));
    4848      return next;
    4949    }
  • trunk/sources/HeuristicLab.Operators/3.3/SequentialSubScopesProcessor.cs

    r2794 r2796  
    3838        ExecutionContextCollection inner = new ExecutionContextCollection();
    3939        for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++)
    40           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operators[i], ExecutionContext.Scope.SubScopes[i]));
     40          inner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i]));
    4141        next.Insert(0, inner);
    4242      }
  • trunk/sources/HeuristicLab.Operators/3.3/SingleCallOperator.cs

    r2794 r2796  
    4848      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    4949      if (Operator != null)
    50         next.Insert(0, new ExecutionContext(ExecutionContext.Parent, Operator, ExecutionContext.Scope));
     50        next.Insert(0, ExecutionContext.CreateContext(Operator));
    5151      return next;
    5252    }
  • trunk/sources/HeuristicLab.Operators/3.3/SingleSuccessorOperator.cs

    r2794 r2796  
    4747    public override IExecutionSequence Apply() {
    4848      if (Successor != null)
    49         return new ExecutionContext(ExecutionContext.Parent, Successor, ExecutionContext.Scope);
     49        return ExecutionContext.CreateContext(Successor);
    5050      else
    5151        return null;
  • trunk/sources/HeuristicLab.Operators/3.3/StochasticBranch.cs

    r2794 r2796  
    6565      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    6666      if (RandomParameter.ActualValue.NextDouble() < ProbabilityParameter.ActualValue.Value) {
    67         if (FirstBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, FirstBranch, ExecutionContext.Scope));
     67        if (FirstBranch != null) next.Insert(0, ExecutionContext.CreateContext(FirstBranch));
    6868      } else {
    69         if (SecondBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, SecondBranch, ExecutionContext.Scope));
     69        if (SecondBranch != null) next.Insert(0, ExecutionContext.CreateContext(SecondBranch));
    7070      }
    7171      return next;
  • trunk/sources/HeuristicLab.Operators/3.3/UniformParallelSubScopesProcessor.cs

    r2794 r2796  
    4444        inner.Parallel = true;
    4545        for (int i = 0; i < ExecutionContext.Scope.SubScopes.Count; i++)
    46           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operator, ExecutionContext.Scope.SubScopes[i]));
     46          inner.Add(ExecutionContext.CreateContext(Operator, ExecutionContext.Scope.SubScopes[i]));
    4747        next.Insert(0, inner);
    4848      }
  • trunk/sources/HeuristicLab.Operators/3.3/UniformSequentialSubScopesProcessor.cs

    r2794 r2796  
    4343        ExecutionContextCollection inner = new ExecutionContextCollection();
    4444        for (int i = 0; i < ExecutionContext.Scope.SubScopes.Count; i++)
    45           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operator, ExecutionContext.Scope.SubScopes[i]));
     45          inner.Add(ExecutionContext.CreateContext(Operator, ExecutionContext.Scope.SubScopes[i]));
    4646        next.Insert(0, inner);
    4747      }
Note: See TracChangeset for help on using the changeset viewer.