Changeset 12157


Ignore:
Timestamp:
03/09/15 09:39:47 (3 years ago)
Author:
pfleck
Message:

#2350

  • Added a NamedSubScopeProcessor to process an name Scope (created by the NamedSubScopesCreator).
  • Changed the Steady-State ALPS to use the new Processor.
Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3
Files:
1 added
3 edited

Legend:

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

    r12153 r12157  
    131131      var randomCreator = new RandomCreator();
    132132      var workingScopeCreator = new NamedSubScopesCreator() { Name = "Create WorkingScope and Layers-Scope" };
    133       var layersProcessor = new SubScopesProcessor();
     133      var layersProcessor = new NamedSubScopeProcessor() { Name = "Process Layers-Scope" };
    134134      var layerCreator = new SubScopesCreator() { Name = "Create Layer" };
    135135      var layerProcessor = new /*Layer*/UniformSubScopesProcessor();
     
    152152      workingScopeCreator.Successor = layersProcessor;
    153153
    154       layersProcessor.Operators.Add(new EmptyOperator());
    155       layersProcessor.Operators.Add(layerCreator);
     154      layersProcessor.TargetScopeParameter.ActualName = "Layers";
     155      layersProcessor.Operator = layerCreator;
    156156
    157157      layerCreator.NumberOfSubScopesParameter.ActualName = "NumberOfLayers";
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/HeuristicLab.Algorithms.ALPS.SteadyState-3.3.csproj

    r12153 r12157  
    138138    <Compile Include="AlpsSsGeneticAlgorithmMainOperator.cs" />
    139139    <Compile Include="AlpsSsMover.cs" />
     140    <Compile Include="NamedSubScopeProcessor.cs" />
    140141    <Compile Include="NamedSubScopesCreator.cs" />
    141142    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/NamedSubScopesCreator.cs

    r12153 r12157  
    5151
    5252    public override IOperation Apply() {
     53      var intermediateParameters = new LayerIntermediateParameter();
    5354      foreach (string name in NamesParameter.Value) {
    54         ExecutionContext.Scope.SubScopes.Add(new Scope(name));
     55        var scope = new Scope(name);
     56        ExecutionContext.Scope.SubScopes.Add(scope);
     57        intermediateParameters.Add(new ValueParameter<IScope>(name, scope));
    5558      }
    56       return base.Apply();
     59
     60      var intermediateContext = new ExecutionContext(ExecutionContext.Parent, intermediateParameters, ExecutionContext.Scope);
     61      return Successor != null ? intermediateContext.CreateChildOperation(Successor) : null;
    5762    }
    5863  }
Note: See TracChangeset for help on using the changeset viewer.