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/SASEGASA.cs

    r4722 r5356  
    215215    }
    216216    private SASEGASAMainLoop MainLoop {
    217       get { return (SASEGASAMainLoop)VillageProcessor.Successor; }
     217      get {
     218        return (SASEGASAMainLoop)(
     219          (ResultsCollector)(
     220            (UniformSubScopesProcessor)(
     221              (VariableCreator)VillageProcessor.Successor
     222            ).Successor
     223          ).Successor
     224        ).Successor;
     225      }
    218226    }
    219227    [Storable]
     
    272280      UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor();
    273281      SolutionsCreator solutionsCreator = new SolutionsCreator();
     282      VariableCreator variableCreator = new VariableCreator();
     283      UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor();
     284      SubScopesCounter subScopesCounter = new SubScopesCounter();
     285      ResultsCollector resultsCollector = new ResultsCollector();
    274286      SASEGASAMainLoop mainLoop = new SASEGASAMainLoop();
    275287      OperatorGraph.InitialOperator = randomCreator;
     
    286298
    287299      ussp1.Operator = solutionsCreator;
    288       ussp1.Successor = mainLoop;
     300      ussp1.Successor = variableCreator;
    289301
    290302      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
    291303      solutionsCreator.Successor = null;
     304
     305      variableCreator.Name = "Initialize EvaluatedSolutions";
     306      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue()));
     307      variableCreator.Successor = ussp2;
     308
     309      ussp2.Operator = subScopesCounter;
     310      ussp2.Successor = resultsCollector;
     311
     312      subScopesCounter.Name = "Increment EvaluatedSolutions";
     313      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
     314
     315      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions"));
     316      resultsCollector.ResultsParameter.ActualName = "Results";
     317      resultsCollector.Successor = mainLoop;
    292318
    293319      mainLoop.NumberOfVillagesParameter.ActualName = NumberOfVillagesParameter.Name;
     
    306332      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    307333      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
     334      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    308335      mainLoop.Successor = null;
    309336
Note: See TracChangeset for help on using the changeset viewer.