Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/26/15 12:44:13 (10 years ago)
Author:
pfleck
Message:

#2269

  • LayerUniformSubScopesProcessor does not longer derives from UniformSubScopesProcessor.
  • Reverted changes of UniformSubScopesProcessor.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUniformSubScopesProcessor.cs

    r12039 r12080  
    3434  [Item("LayerUniformSubScopesProcessor", "")]
    3535  [StorableClass]
    36   public class LayerUniformSubScopesProcessor : UniformSubScopesProcessor {
     36  public class LayerUniformSubScopesProcessor : SingleSuccessorOperator {
     37    private OperatorParameter OperatorParameter {
     38      get { return (OperatorParameter)Parameters["Operator"]; }
     39    }
     40    public ValueLookupParameter<BoolValue> ParallelParameter {
     41      get { return (ValueLookupParameter<BoolValue>)Parameters["Parallel"]; }
     42    }
    3743
    3844    private ILookupParameter<IntArray> PopulationSizeParameter {
    3945      get { return (ILookupParameter<IntArray>)Parameters["PopulationSize"]; }
     46    }
     47
     48    public IOperator Operator {
     49      get { return OperatorParameter.Value; }
     50      set { OperatorParameter.Value = value; }
     51    }
     52    public BoolValue Parallel {
     53      get { return ParallelParameter.Value; }
     54      set { ParallelParameter.Value = value; }
    4055    }
    4156
     
    4762    public LayerUniformSubScopesProcessor()
    4863      : base() {
     64      Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on all sub-scopes of the current scope."));
     65      Parameters.Add(new ValueLookupParameter<BoolValue>("Parallel", "True if the operator should be applied in parallel on all sub-scopes, otherwise false.", new BoolValue(false)));
     66
    4967      Parameters.Add(new LookupParameter<IntArray>("PopulationSize"));
    5068    }
     
    5573
    5674    public override IOperation Apply() {
    57       OperationCollection next = new OperationCollection(Successor != null ? ExecutionContext.CreateOperation(Successor) : null); // base.base.Apply not possible
     75      var next = new OperationCollection(Successor != null ? ExecutionContext.CreateOperation(Successor) : null);
    5876      if (Operator != null) {
    59         List<IScope> scopes = GetScopesOnLevel(ExecutionContext.Scope, Depth.Value).ToList();
    60         OperationCollection inner = new OperationCollection();
    61         inner.Parallel = Parallel == null ? false : Parallel.Value;
     77        var scopes = ExecutionContext.Scope.SubScopes;
     78        var inner = new OperationCollection() {
     79          Parallel = Parallel == null ? false : Parallel.Value
     80        };
    6281        for (int i = 0; i < scopes.Count; i++) {
    6382          var layerParameters = new LayerIntermediateParameter {
Note: See TracChangeset for help on using the changeset viewer.