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
Location:
trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3
Files:
2 edited

Legend:

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

    r5208 r5356  
    7878    public ValueLookupParameter<IOperator> AnalyzerParameter {
    7979      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
     80    }
     81    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
     82      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    8083    }
    8184    private ScopeParameter CurrentScopeParameter {
     
    123126      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
    124127      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
     128      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    125129      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the EvolutionStrategy should be applied."));
    126130      Parameters.Add(new ValueLookupParameter<IOperator>("StrategyParameterManipulator", "The operator to mutate the endogeneous strategy parameters."));
     
    148152      UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
    149153      Placeholder evaluator = new Placeholder();
     154      SubScopesCounter subScopesCounter = new SubScopesCounter();
    150155      ConditionalBranch plusOrCommaReplacementBranch = new ConditionalBranch();
    151156      MergingReducer plusReplacement = new MergingReducer();
     
    155160      IntCounter intCounter = new IntCounter();
    156161      Comparator comparator = new Comparator();
    157       ResultsCollector resultsCollector2 = new ResultsCollector();
    158162      Placeholder analyzer2 = new Placeholder();
    159163      ConditionalBranch conditionalBranch = new ConditionalBranch();
     
    208212      evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
    209213
     214      subScopesCounter.Name = "Increment EvaluatedSolutions";
     215      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
     216
    210217      plusOrCommaReplacementBranch.ConditionParameter.ActualName = PlusSelectionParameter.Name;
    211218
     
    222229      comparator.ResultParameter.ActualName = "Terminate";
    223230      comparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
    224 
    225       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    226       resultsCollector2.ResultsParameter.ActualName = "Results";
    227231
    228232      analyzer2.Name = "Analyzer (placeholder)";
     
    258262      mutator2.Successor = null;
    259263      uniformSubScopesProcessor3.Operator = evaluator;
    260       uniformSubScopesProcessor3.Successor = null;
     264      uniformSubScopesProcessor3.Successor = subScopesCounter;
    261265      evaluator.Successor = null;
     266      subScopesCounter.Successor = null;
    262267      plusOrCommaReplacementBranch.TrueBranch = plusReplacement;
    263268      plusOrCommaReplacementBranch.FalseBranch = commaReplacement;
     
    266271      rightReducer.Successor = intCounter;
    267272      intCounter.Successor = comparator;
    268       comparator.Successor = resultsCollector2;
    269       resultsCollector2.Successor = analyzer2;
     273      comparator.Successor = analyzer2;
    270274      analyzer2.Successor = conditionalBranch;
    271275      conditionalBranch.FalseBranch = selector;
Note: See TracChangeset for help on using the changeset viewer.