Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/11/15 15:45:29 (8 years ago)
Author:
pfleck
Message:

#2350 Improved performance of steady state ALPS.

  • Introduced a batch cycle in the main loop to avoid too frequent updates of some variables and analyzers.
  • No cloning of individuals when creating the mating pool.
File:
1 edited

Legend:

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

    r12159 r12192  
    6464      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    6565    }
     66    private IValueParameter<IntValue> BatchSizeParameter {
     67      get { return (IValueParameter<IntValue>)Parameters["BatchSize"]; }
     68    }
    6669    #endregion
    6770
     
    127130      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
    128131      Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
     132      Parameters.Add(new ValueParameter<IntValue>("BatchSize", "Number of inner iterations before updates and analyzers are fired.", new IntValue(100)) { Hidden = true });
    129133      AgeInheritance = new ReductionOperation(ReductionOperations.Min);
    130134
     
    140144      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
    141145      var initializeEvaluatedSolutions = new ExpressionCalculator() { Name = "Initialize EvaluatedSolutions" };
     146      var initializeResultEvaluatedSolutions = new Assigner() { Name = "Initialize ResultEvaluatedSolutions" };
    142147      var initializePopulationSize = new Assigner() { Name = "Initialize PopulationSize" };
    143148      var resultsCollector = new ResultsCollector();
     
    182187      initializeEvaluatedSolutions.CollectedValues.Add(new LookupParameter<IntValue>("LayerSize"));
    183188      initializeEvaluatedSolutions.CollectedValues.Add(new LookupParameter<IntValue>("NumberOfLayers"));
    184       initializeEvaluatedSolutions.Successor = initializePopulationSize;
     189      initializeEvaluatedSolutions.Successor = initializeResultEvaluatedSolutions;
     190
     191      initializeResultEvaluatedSolutions.LeftSideParameter.ActualName = "ResultEvaluatedSolutions";
     192      initializeResultEvaluatedSolutions.RightSideParameter.ActualName = "EvaluatedSolutions";
     193      initializeResultEvaluatedSolutions.Successor = initializePopulationSize;
    185194
    186195      initializePopulationSize.LeftSideParameter.ActualName = "PopulationSize";
     
    188197      initializePopulationSize.Successor = resultsCollector;
    189198
    190       resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
     199      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "ResultEvaluatedSolutions"));
    191200      resultsCollector.Successor = mainLoop;
    192201
Note: See TracChangeset for help on using the changeset viewer.