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.NSGA2/3.3/NSGA2MainLoop.cs

    r5208 r5356  
    7575    public ValueLookupParameter<IOperator> AnalyzerParameter {
    7676      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
     77    }
     78    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
     79      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    7780    }
    7881    #endregion
     
    101104      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
    102105      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
     106      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    103107      #endregion
    104108
     
    119123      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
    120124      Placeholder evaluator = new Placeholder();
     125      SubScopesCounter subScopesCounter = new SubScopesCounter();
    121126      MergingReducer mergingReducer = new MergingReducer();
    122127      RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter();
     
    125130      IntCounter intCounter = new IntCounter();
    126131      Comparator comparator = new Comparator();
    127       ResultsCollector resultsCollector2 = new ResultsCollector();
    128132      Placeholder analyzer2 = new Placeholder();
    129133      ConditionalBranch conditionalBranch = new ConditionalBranch();
     
    163167      evaluator.Name = "Evaluator";
    164168      evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
     169
     170      subScopesCounter.Name = "Increment EvaluatedSolutions";
     171      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    165172
    166173      rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance";
     
    177184      comparator.ResultParameter.ActualName = "Terminate";
    178185      comparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
    179 
    180       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    181       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    182186
    183187      analyzer2.Name = "Analyzer";
     
    210214      subScopesRemover.Successor = null;
    211215      uniformSubScopesProcessor2.Operator = evaluator;
    212       uniformSubScopesProcessor2.Successor = null;
     216      uniformSubScopesProcessor2.Successor = subScopesCounter;
    213217      evaluator.Successor = null;
     218      subScopesCounter.Successor = null;
    214219      mergingReducer.Successor = rankAndCrowdingSorter;
    215220      rankAndCrowdingSorter.Successor = leftSelector;
     
    217222      rightReducer.Successor = intCounter;
    218223      intCounter.Successor = comparator;
    219       comparator.Successor = resultsCollector2;
    220       resultsCollector2.Successor = analyzer2;
     224      comparator.Successor = analyzer2;
    221225      analyzer2.Successor = conditionalBranch;
    222226      conditionalBranch.FalseBranch = selector;
Note: See TracChangeset for help on using the changeset viewer.