Changeset 12142 for branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/RandomLayerProcessor.cs
- Timestamp:
- 03/05/15 15:35:15 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/RandomLayerProcessor.cs
r12136 r12142 41 41 } 42 42 43 private ILookupParameter<IntArray> PopulationSizeParameter {44 get { return (ILookupParameter<IntArray>)Parameters["PopulationSize"]; }45 }46 47 43 public IOperator Operator { 48 44 get { return OperatorParameter.Value; } … … 59 55 Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on a random sub-scopes of the current scope.")); 60 56 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 61 62 Parameters.Add(new LookupParameter<IntArray>("PopulationSize"));63 57 } 64 58 … … 74 68 var subScopes = ExecutionContext.Scope.SubScopes; 75 69 int index = random.Next(subScopes.Count); 76 var selectedLayer = subScopes[index]; 77 78 var layerParameters = new LayerIntermediateParameter { 79 new ValueParameter<IntValue>(PopulationSizeParameter.ActualName, new IntValue(PopulationSizeParameter.ActualValue[Math.Min(index, PopulationSizeParameter.ActualValue.Length - 1)])) 80 }; 81 var immediateContext = new ExecutionContext(ExecutionContext.Parent, layerParameters, selectedLayer); 82 next.Insert(0, immediateContext.CreateChildOperation(Operator, selectedLayer)); 70 next.Insert(0, ExecutionContext.CreateOperation(Operator, subScopes[index])); 83 71 } 84 72 return next;
Note: See TracChangeset
for help on using the changeset viewer.