Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/10 16:47:16 (14 years ago)
Author:
epitzer
Message:

Better reflect single successor operation generation inside user visible code. (#1275)

File:
1 edited

Legend:

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

    r4828 r4838  
    99  [StorableClass]
    1010  public class ProgrammableSingleSuccessorOperator : ProgrammableOperator {
     11
     12    public IOperator Successor {
     13      get {
     14        IParameter parameter;
     15        Parameters.TryGetValue("Successor", out parameter);
     16        OperatorParameter successorParameter = parameter as OperatorParameter;
     17        if (successorParameter == null)
     18          return null;
     19        return successorParameter.Value;
     20      }
     21      set {
     22        ((OperatorParameter)Parameters["Successor"]).Value = value;
     23      }
     24    }
    1125
    1226    [StorableConstructor]
     
    2438    }
    2539
    26     public override IOperation Apply() {
    27       IOperation operation = base.Apply();
    28       if (operation != null)
    29         return operation;
    30       IParameter parameter;
    31       Parameters.TryGetValue("Successor", out parameter);
    32       OperatorParameter successorParameter = parameter as OperatorParameter;
    33       if (successorParameter != null && successorParameter.Value != null)
    34         return ExecutionContext.CreateOperation(successorParameter.Value);
    35       else
    36         return null;
     40    public override string MethodSuffix {
     41      get { return "return op.Successor == null ? null : context.CreateOperation(op.Successor);"; }
    3742    }
    3843  }
Note: See TracChangeset for help on using the changeset viewer.