Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12094


Ignore:
Timestamp:
02/27/15 11:09:33 (8 years ago)
Author:
pfleck
Message:

#2269 Replaced the NumberOfSelectedSubScopesCalculator with an ExpressionCalculator.

Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
Files:
1 deleted
1 edited

Legend:

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

    r12071 r12094  
    178178    private GeneticAlgorithmMainLoop CreatePreparedGeneticAlgorithmMainLoop() {
    179179      var mainLoop = new GeneticAlgorithmMainLoop();
    180       var numberOfSelectedSubScopesCalculator = new NumberOfSelectedSubScopesCalculator();
     180      var numberOfSelectedSubScopesCalculator = new ExpressionCalculator() { Name = "NumberOfSelectedSubScopes = (PopulationSize - Elites) * 2" };
    181181      var selector = mainLoop.OperatorGraph.Iterate().OfType<Placeholder>().First(o => o.OperatorParameter.ActualName == "Selector");
    182182      var crossover = mainLoop.OperatorGraph.Iterate().OfType<Placeholder>().First(o => o.OperatorParameter.ActualName == "Crossover");
     
    186186      // Operator starts with numberOfSelectedSubScopesCalculator
    187187      mainLoop.OperatorGraph.InitialOperator = numberOfSelectedSubScopesCalculator;
     188      numberOfSelectedSubScopesCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));
     189      numberOfSelectedSubScopesCalculator.CollectedValues.Add(new LookupParameter<IntValue>("Elites"));
     190      numberOfSelectedSubScopesCalculator.ExpressionResultParameter.ActualName = "NumberOfSelectedSubScopes";
     191      numberOfSelectedSubScopesCalculator.ExpressionParameter.Value = new StringValue("PopulationSize Elites - 2 * toint");
    188192      numberOfSelectedSubScopesCalculator.Successor = selector;
    189193
Note: See TracChangeset for help on using the changeset viewer.