Changeset 12080 for branches/ALPS/HeuristicLab.Algorithms.ALPS
- Timestamp:
- 02/26/15 12:44:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LayerUniformSubScopesProcessor.cs
r12039 r12080 34 34 [Item("LayerUniformSubScopesProcessor", "")] 35 35 [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 } 37 43 38 44 private ILookupParameter<IntArray> PopulationSizeParameter { 39 45 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; } 40 55 } 41 56 … … 47 62 public LayerUniformSubScopesProcessor() 48 63 : 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 49 67 Parameters.Add(new LookupParameter<IntArray>("PopulationSize")); 50 68 } … … 55 73 56 74 public override IOperation Apply() { 57 OperationCollection next = new OperationCollection(Successor != null ? ExecutionContext.CreateOperation(Successor) : null); // base.base.Apply not possible75 var next = new OperationCollection(Successor != null ? ExecutionContext.CreateOperation(Successor) : null); 58 76 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 }; 62 81 for (int i = 0; i < scopes.Count; i++) { 63 82 var layerParameters = new LayerIntermediateParameter {
Note: See TracChangeset
for help on using the changeset viewer.