Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/22/11 15:18:20 (14 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/IslandOffspringSelectionGeneticAlgorithm.cs

    r4722 r5356  
    239239    }
    240240    private IslandOffspringSelectionGeneticAlgorithmMainLoop MainLoop {
    241       get { return (IslandOffspringSelectionGeneticAlgorithmMainLoop)IslandProcessor.Successor; }
     241      get {
     242        return (IslandOffspringSelectionGeneticAlgorithmMainLoop)(
     243          (ResultsCollector)(
     244            (UniformSubScopesProcessor)(
     245              (VariableCreator)IslandProcessor.Successor
     246            ).Successor
     247          ).Successor
     248        ).Successor;
     249      }
    242250    }
    243251    [Storable]
     
    300308      UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor();
    301309      SolutionsCreator solutionsCreator = new SolutionsCreator();
     310      VariableCreator variableCreator = new VariableCreator();
     311      UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor();
     312      SubScopesCounter subScopesCounter = new SubScopesCounter();
     313      ResultsCollector resultsCollector = new ResultsCollector();
    302314      IslandOffspringSelectionGeneticAlgorithmMainLoop mainLoop = new IslandOffspringSelectionGeneticAlgorithmMainLoop();
    303315      OperatorGraph.InitialOperator = randomCreator;
     
    314326
    315327      ussp1.Operator = solutionsCreator;
    316       ussp1.Successor = mainLoop;
     328      ussp1.Successor = variableCreator;
    317329
    318330      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
    319331      solutionsCreator.Successor = null;
     332
     333      variableCreator.Name = "Initialize EvaluatedSolutions";
     334      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue()));
     335      variableCreator.Successor = ussp2;
     336
     337      ussp2.Operator = subScopesCounter;
     338      ussp2.Successor = resultsCollector;
     339
     340      subScopesCounter.Name = "Increment EvaluatedSolutions";
     341      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
     342
     343      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions"));
     344      resultsCollector.ResultsParameter.ActualName = "Results";
     345      resultsCollector.Successor = mainLoop;
    320346
    321347      mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name;
     
    339365      mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
    340366      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
     367      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    341368      mainLoop.Successor = null;
    342369
Note: See TracChangeset for help on using the changeset viewer.