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.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs

    r5351 r5356  
    187187    }
    188188    private IslandGeneticAlgorithmMainLoop MainLoop {
    189       get { return (IslandGeneticAlgorithmMainLoop)((UniformSubScopesProcessor)((VariableCreator)IslandProcessor.Successor).Successor).Successor; }
     189      get {
     190        return (IslandGeneticAlgorithmMainLoop)(
     191          (ResultsCollector)(
     192            (UniformSubScopesProcessor)(
     193              (VariableCreator)IslandProcessor.Successor
     194            ).Successor
     195          ).Successor
     196        ).Successor;
     197      }
    190198    }
    191199    [Storable]
     
    238246      UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor();
    239247      SubScopesCounter subScopesCounter = new SubScopesCounter();
     248      ResultsCollector resultsCollector = new ResultsCollector();
    240249      IslandGeneticAlgorithmMainLoop mainLoop = new IslandGeneticAlgorithmMainLoop();
    241250      OperatorGraph.InitialOperator = randomCreator;
     
    262271
    263272      ussp2.Operator = subScopesCounter;
    264       ussp2.Successor = mainLoop;
     273      ussp2.Successor = resultsCollector;
    265274
    266275      subScopesCounter.Name = "Count EvaluatedSolutions";
    267276      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
    268277      subScopesCounter.Successor = null;
     278
     279      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
     280      resultsCollector.ResultsParameter.ActualName = "Results";
     281      resultsCollector.Successor = mainLoop;
    269282
    270283      mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name;
Note: See TracChangeset for help on using the changeset viewer.