Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/11 15:18:20 (13 years ago)
Author:
abeham
Message:

#1344

  • Adapted all algorithms to count evaluated solutions / moves and outside of the parallel region
  • Used the same pattern in every algorithm: Initialize and collect the variable in the Algorithm and increment it in the main loops and main operators
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r4722 r5356  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Operators;
    2829using HeuristicLab.Optimization;
    2930using HeuristicLab.Optimization.Operators;
     
    190191    }
    191192    private OffspringSelectionGeneticAlgorithmMainLoop MainLoop {
    192       get { return (OffspringSelectionGeneticAlgorithmMainLoop)SolutionsCreator.Successor; }
     193      get {
     194        return (OffspringSelectionGeneticAlgorithmMainLoop)(
     195          (ResultsCollector)(
     196            (SubScopesCounter)SolutionsCreator.Successor
     197          ).Successor
     198        ).Successor;
     199      }
    193200    }
    194201    [Storable]
     
    236243      RandomCreator randomCreator = new RandomCreator();
    237244      SolutionsCreator solutionsCreator = new SolutionsCreator();
     245      SubScopesCounter subScopesCounter = new SubScopesCounter();
     246      ResultsCollector resultsCollector = new ResultsCollector();
    238247      OffspringSelectionGeneticAlgorithmMainLoop mainLoop = new OffspringSelectionGeneticAlgorithmMainLoop();
    239248      OperatorGraph.InitialOperator = randomCreator;
     
    247256
    248257      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
    249       solutionsCreator.Successor = mainLoop;
     258      solutionsCreator.Successor = subScopesCounter;
     259
     260      subScopesCounter.Name = "Initialize EvaluatedSolutions";
     261      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
     262      subScopesCounter.Successor = resultsCollector;
     263
     264      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions"));
     265      resultsCollector.ResultsParameter.ActualName = "Results";
     266      resultsCollector.Successor = mainLoop;
    250267
    251268      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     
    255272      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    256273      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
     274      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    257275      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    258276      mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
Note: See TracChangeset for help on using the changeset viewer.