Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5356 for trunk


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
Location:
trunk/sources
Files:
21 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;
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs

    r5352 r5356  
    135135    }
    136136    private GeneticAlgorithmMainLoop GeneticAlgorithmMainLoop {
    137       get { return (GeneticAlgorithmMainLoop)((SubScopesCounter)SolutionsCreator.Successor).Successor; }
     137      get {
     138        return (GeneticAlgorithmMainLoop)(
     139          (ResultsCollector)(
     140            (SubScopesCounter)SolutionsCreator.Successor
     141          ).Successor
     142        ).Successor;
     143      }
    138144    }
    139145    [Storable]
     
    157163      SolutionsCreator solutionsCreator = new SolutionsCreator();
    158164      SubScopesCounter subScopesCounter = new SubScopesCounter();
    159       GeneticAlgorithmMainLoop geneticAlgorithmMainLoop = new GeneticAlgorithmMainLoop();
     165      ResultsCollector resultsCollector = new ResultsCollector();
     166      GeneticAlgorithmMainLoop mainLoop = new GeneticAlgorithmMainLoop();
    160167      OperatorGraph.InitialOperator = randomCreator;
    161168
     
    172179      subScopesCounter.Name = "Initialize EvaluatedSolutions";
    173180      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
    174       subScopesCounter.Successor = geneticAlgorithmMainLoop;
    175 
    176       geneticAlgorithmMainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
    177       geneticAlgorithmMainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    178       geneticAlgorithmMainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
    179       geneticAlgorithmMainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    180       geneticAlgorithmMainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
    181       geneticAlgorithmMainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
    182       geneticAlgorithmMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
    183       geneticAlgorithmMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
    184       geneticAlgorithmMainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    185       geneticAlgorithmMainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
    186       geneticAlgorithmMainLoop.ResultsParameter.ActualName = "Results";
     181      subScopesCounter.Successor = resultsCollector;
     182
     183      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
     184      resultsCollector.ResultsParameter.ActualName = "Results";
     185      resultsCollector.Successor = mainLoop;
     186
     187      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
     188      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
     189      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
     190      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
     191      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
     192      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
     193      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     194      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     195      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     196      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
     197      mainLoop.ResultsParameter.ActualName = "Results";
    187198
    188199      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs

    r5352 r5356  
    141141      IntCounter intCounter = new IntCounter();
    142142      Comparator comparator = new Comparator();
    143       ResultsCollector resultsCollector2 = new ResultsCollector();
    144143      Placeholder analyzer2 = new Placeholder();
    145144      ConditionalBranch conditionalBranch = new ConditionalBranch();
     
    148147
    149148      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    150       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>(EvaluatedSolutionsParameter.Name));
    151149      resultsCollector1.ResultsParameter.ActualName = "Results";
    152150
     
    190188      comparator.ResultParameter.ActualName = "Terminate";
    191189      comparator.RightSideParameter.ActualName = "MaximumGenerations";
    192 
    193       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    194       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>(EvaluatedSolutionsParameter.Name));
    195       resultsCollector2.ResultsParameter.ActualName = "Results";
    196190
    197191      analyzer2.Name = "Analyzer";
     
    230224      mergingReducer.Successor = intCounter;
    231225      intCounter.Successor = comparator;
    232       comparator.Successor = resultsCollector2;
    233       resultsCollector2.Successor = analyzer2;
     226      comparator.Successor = analyzer2;
    234227      analyzer2.Successor = conditionalBranch;
    235228      conditionalBranch.FalseBranch = selector;
  • 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;
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithmMainLoop.cs

    r5351 r5356  
    159159      UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
    160160      Placeholder evaluator = new Placeholder();
     161      SubScopesCounter subScopesCounter = new SubScopesCounter();
    161162      SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor();
    162163      BestSelector bestSelector = new BestSelector();
     
    165166      IntCounter generationsCounter = new IntCounter();
    166167      UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
    167       SubScopesCounter subScopesCounter = new SubScopesCounter();
    168168      Placeholder islandAnalyzer2 = new Placeholder();
    169169      IntCounter generationsSinceLastMigrationCounter = new IntCounter();
     
    179179      Comparator generationsComparator = new Comparator();
    180180      Placeholder analyzer2 = new Placeholder();
    181       ResultsCollector resultsCollector2 = new ResultsCollector();
    182181      ConditionalBranch generationsTerminationCondition = new ConditionalBranch();
    183182
     
    197196      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    198197      resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results"));
    199       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));
    200198      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    201199
     
    220218      evaluator.Name = "Evaluator (placeholder)";
    221219      evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;
     220
     221      subScopesCounter.Name = "Increment EvaluatedSolutions";
     222      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    222223
    223224      bestSelector.CopySelected = new BoolValue(false);
     
    225226      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
    226227      bestSelector.QualityParameter.ActualName = QualityParameter.Name;
    227 
    228       subScopesCounter.Name = "Increment EvaluatedSolutions";
    229       subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    230228
    231229      islandAnalyzer2.Name = "Island Analyzer (placeholder)";
     
    274272      analyzer2.Name = "Analyzer (placeholder)";
    275273      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    276 
    277       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
    278       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
    279       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));
    280       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    281274
    282275      generationsTerminationCondition.Name = "Terminate?";
     
    335328      uniformSubScopesProcessor6.Successor = null;
    336329      generationsComparator.Successor = analyzer2;
    337       analyzer2.Successor = resultsCollector2;
    338       resultsCollector2.Successor = generationsTerminationCondition;
     330      analyzer2.Successor = generationsTerminationCondition;
    339331      generationsTerminationCondition.TrueBranch = null;
    340332      generationsTerminationCondition.FalseBranch = uniformSubScopesProcessor1;
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs

    r4722 r5356  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Operators;
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Optimization.Operators;
     
    117118    }
    118119    private LocalSearchMainLoop MainLoop {
    119       get { return (LocalSearchMainLoop)SolutionsCreator.Successor; }
     120      get {
     121        return (LocalSearchMainLoop)(
     122          (ResultsCollector)(
     123            (VariableCreator)SolutionsCreator.Successor
     124          ).Successor
     125        ).Successor;
     126      }
    120127    }
    121128    [Storable]
     
    150157      RandomCreator randomCreator = new RandomCreator();
    151158      SolutionsCreator solutionsCreator = new SolutionsCreator();
    152       LocalSearchMainLoop lsMainLoop = new LocalSearchMainLoop();
     159      VariableCreator variableCreator = new VariableCreator();
     160      ResultsCollector resultsCollector = new ResultsCollector();
     161      LocalSearchMainLoop mainLoop = new LocalSearchMainLoop();
    153162      OperatorGraph.InitialOperator = randomCreator;
    154163
     
    161170
    162171      solutionsCreator.NumberOfSolutions = new IntValue(1);
    163       solutionsCreator.Successor = lsMainLoop;
    164 
    165       lsMainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name;
    166       lsMainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name;
    167       lsMainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name;
    168       lsMainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
    169       lsMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
    170       lsMainLoop.ResultsParameter.ActualName = "Results";
    171       lsMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     172      solutionsCreator.Successor = variableCreator;
     173
     174      variableCreator.Name = "Initialize EvaluatedMoves";
     175      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue()));
     176      variableCreator.Successor = resultsCollector;
     177
     178      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     179      resultsCollector.ResultsParameter.ActualName = "Results";
     180      resultsCollector.Successor = mainLoop;
     181
     182      mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name;
     183      mainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name;
     184      mainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name;
     185      mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     186      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     187      mainLoop.ResultsParameter.ActualName = "Results";
     188      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     189      mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves";
    172190
    173191      moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs

    r5353 r5356  
    7070      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
    7171    }
    72 
    73     private ScopeParameter CurrentScopeParameter {
    74       get { return (ScopeParameter)Parameters["CurrentScope"]; }
    75     }
    76     public IScope CurrentScope {
    77       get { return CurrentScopeParameter.ActualValue; }
     72    public LookupParameter<IntValue> EvaluatedMovesParameter {
     73      get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; }
    7874    }
    7975    #endregion
     
    107103
    108104      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution and moves."));
    109       Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied."));
     105      Parameters.Add(new LookupParameter<IntValue>("EvaluatedMoves", "The number of evaluated moves."));
    110106      #endregion
    111107
     
    137133      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class LocalSearch expects this to be called Iterations
    138134      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));
    139       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0)));
    140135
    141136      bestQualityInitializer.Name = "Initialize BestQuality";
     
    149144      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    150145      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    151       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    152146      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    153147
     
    161155
    162156      subScopesCounter.Name = "Increment EvaluatedMoves";
    163       subScopesCounter.ValueParameter.ActualName = "EvaluatedMoves";
     157      subScopesCounter.ValueParameter.ActualName = EvaluatedMovesParameter.Name;
    164158
    165159      bestSelector.CopySelected = new BoolValue(false);
  • trunk/sources/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs

    r5143 r5356  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Operators;
    2829using HeuristicLab.Optimization;
    2930using HeuristicLab.Optimization.Operators;
     
    139140    }
    140141    private RankAndCrowdingSorter RankAndCrowdingSorter {
    141       get { return (RankAndCrowdingSorter)SolutionsCreator.Successor; }
     142      get { return (RankAndCrowdingSorter)((SubScopesCounter)SolutionsCreator.Successor).Successor; }
    142143    }
    143144    private NSGA2MainLoop MainLoop {
    144       get { return (NSGA2MainLoop)RankAndCrowdingSorter.Successor; }
     145      get {
     146        return (NSGA2MainLoop)(
     147          (ResultsCollector)RankAndCrowdingSorter.Successor
     148        ).Successor;
     149      }
    145150    }
    146151    #endregion
     
    151156    [StorableConstructor]
    152157    protected NSGA2(bool deserializing) : base(deserializing) { }
    153     protected NSGA2(NSGA2 original, Cloner cloner) : base (original, cloner) {
     158    protected NSGA2(NSGA2 original, Cloner cloner)
     159      : base(original, cloner) {
    154160      paretoFrontAnalyzer = (RankBasedParetoFrontAnalyzer)cloner.Clone(original.paretoFrontAnalyzer);
    155161      AttachEventHandlers();
     
    170176      RandomCreator randomCreator = new RandomCreator();
    171177      SolutionsCreator solutionsCreator = new SolutionsCreator();
     178      SubScopesCounter subScopesCounter = new SubScopesCounter();
    172179      RankAndCrowdingSorter rankAndCrowdingSorter = new RankAndCrowdingSorter();
     180      ResultsCollector resultsCollector = new ResultsCollector();
    173181      NSGA2MainLoop mainLoop = new NSGA2MainLoop();
    174      
     182
    175183      OperatorGraph.InitialOperator = randomCreator;
    176184
     
    183191
    184192      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
    185       solutionsCreator.Successor = rankAndCrowdingSorter;
     193      solutionsCreator.Successor = subScopesCounter;
     194
     195      subScopesCounter.Name = "Initialize EvaluatedSolutions";
     196      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
     197      subScopesCounter.Successor = rankAndCrowdingSorter;
    186198
    187199      rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance";
    188200      rankAndCrowdingSorter.RankParameter.ActualName = "Rank";
    189       rankAndCrowdingSorter.Successor = mainLoop;
     201      rankAndCrowdingSorter.Successor = resultsCollector;
     202
     203      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
     204      resultsCollector.ResultsParameter.ActualName = "Results";
     205      resultsCollector.Successor = mainLoop;
    190206
    191207      mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;
     
    199215      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
    200216      mainLoop.ResultsParameter.ActualName = "Results";
     217      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    201218
    202219      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is ISingleObjectiveSelector)).OrderBy(x => x.Name))
     
    218235
    219236    public override IDeepCloneable Clone(Cloner cloner) {
    220       return new NSGA2(this, cloner);     
     237      return new NSGA2(this, cloner);
    221238    }
    222239
  • 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;
  • 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
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r5208 r5356  
    123123    public ValueLookupParameter<IOperator> IslandAnalyzerParameter {
    124124      get { return (ValueLookupParameter<IOperator>)Parameters["IslandAnalyzer"]; }
     125    }
     126    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
     127      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    125128    }
    126129    #endregion
     
    166169      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the islands."));
    167170      Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
     171      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    168172      #endregion
    169173
     
    177181      Placeholder analyzer1 = new Placeholder();
    178182      ResultsCollector resultsCollector1 = new ResultsCollector();
    179       ResultsCollector resultsCollector2 = new ResultsCollector();
    180183      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
    181184      ConditionalBranch islandTerminatedBySelectionPressure1 = new ConditionalBranch();
     
    183186      Placeholder islandAnalyzer2 = new Placeholder();
    184187      ResultsCollector islandResultsCollector2 = new ResultsCollector();
    185       IntCounter islandEvaluatedSolutionsCounter = new IntCounter();
    186       Assigner islandEvaluatedSolutionsAssigner = new Assigner();
    187188      Comparator islandSelectionPressureComparator = new Comparator();
    188189      ConditionalBranch islandTerminatedBySelectionPressure2 = new ConditionalBranch();
     
    206207      Placeholder comparisonFactorModifier = new Placeholder();
    207208      Placeholder analyzer2 = new Placeholder();
    208       ResultsCollector resultsCollector3 = new ResultsCollector();
    209209      ConditionalBranch generationsTerminationCondition = new ConditionalBranch();
    210210      ConditionalBranch terminatedIslandsCondition = new ConditionalBranch();
     
    215215      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastMigration", new IntValue(0)));
    216216      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TerminatedIslands", new IntValue(0)));
    217       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
    218217
    219218      islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>(ResultsParameter.Name, new ResultCollection()));
    220       islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("IslandEvaluatedSolutions", new IntValue(0)));
    221219      islandVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false)));
    222220      islandVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
     
    243241      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    244242
    245       resultsCollector2.CopyValue = new BoolValue(true);
    246       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    247       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    248 
    249243      islandTerminatedBySelectionPressure1.Name = "Island Terminated ?";
    250244      islandTerminatedBySelectionPressure1.ConditionParameter.ActualName = "TerminateSelectionPressure";
     
    254248      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
    255249      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    256       mainOperator.EvaluatedSolutionsParameter.ActualName = "IslandEvaluatedSolutions";
     250      mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name;
    257251      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    258252      mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name;
     
    274268      islandResultsCollector2.ResultsParameter.ActualName = "Results";
    275269
    276       islandEvaluatedSolutionsCounter.Name = "Update EvaluatedSolutions";
    277       islandEvaluatedSolutionsCounter.ValueParameter.ActualName = "EvaluatedSolutions";
    278       islandEvaluatedSolutionsCounter.Increment = null;
    279       islandEvaluatedSolutionsCounter.IncrementParameter.ActualName = "IslandEvaluatedSolutions";
    280 
    281       islandEvaluatedSolutionsAssigner.Name = "Reset EvaluatedSolutions";
    282       islandEvaluatedSolutionsAssigner.LeftSideParameter.ActualName = "IslandEvaluatedSolutions";
    283       islandEvaluatedSolutionsAssigner.RightSideParameter.Value = new IntValue(0);
    284 
    285270      islandSelectionPressureComparator.Name = "SelectionPressure >= MaximumSelectionPressure ?";
    286271      islandSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";
     
    352337      maxEvaluatedSolutionsComparator.Name = "EvaluatedSolutions >= MaximumEvaluatedSolutions ?";
    353338      maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    354       maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";
     339      maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name;
    355340      maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";
    356341      maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";
     
    361346      analyzer2.Name = "Analyzer (placeholder)";
    362347      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    363 
    364       resultsCollector3.CopyValue = new BoolValue(true);
    365       resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    366       resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
    367348
    368349      generationsTerminationCondition.Name = "Terminate (MaxGenerations) ?";
     
    386367      comparisonFactorInitializer.Successor = analyzer1;
    387368      analyzer1.Successor = resultsCollector1;
    388       resultsCollector1.Successor = resultsCollector2;
    389       resultsCollector2.Successor = uniformSubScopesProcessor1;
     369      resultsCollector1.Successor = uniformSubScopesProcessor1;
    390370      uniformSubScopesProcessor1.Operator = islandTerminatedBySelectionPressure1;
    391371      uniformSubScopesProcessor1.Successor = generationsCounter;
     
    395375      mainOperator.Successor = islandAnalyzer2;
    396376      islandAnalyzer2.Successor = islandResultsCollector2;
    397       islandResultsCollector2.Successor = islandEvaluatedSolutionsCounter;
    398       islandEvaluatedSolutionsCounter.Successor = islandEvaluatedSolutionsAssigner;
    399       islandEvaluatedSolutionsAssigner.Successor = islandSelectionPressureComparator;
     377      islandResultsCollector2.Successor = islandSelectionPressureComparator;
    400378      islandSelectionPressureComparator.Successor = islandTerminatedBySelectionPressure2;
    401379      islandTerminatedBySelectionPressure2.TrueBranch = terminatedIslandsCounter;
     
    423401      maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier;
    424402      comparisonFactorModifier.Successor = analyzer2;
    425       analyzer2.Successor = resultsCollector3;
    426       resultsCollector3.Successor = generationsTerminationCondition;
     403      analyzer2.Successor = generationsTerminationCondition;
    427404      generationsTerminationCondition.TrueBranch = null;
    428405      generationsTerminationCondition.FalseBranch = terminatedIslandsCondition;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r4722 r5356  
    2626using HeuristicLab.Core;
    2727using HeuristicLab.Data;
     28using HeuristicLab.Operators;
    2829using HeuristicLab.Optimization;
    2930using HeuristicLab.Optimization.Operators;
     
    190191    }
    191192    private OffspringSelectionGeneticAlgorithmMainLoop MainLoop {
    192       get { return (OffspringSelectionGeneticAlgorithmMainLoop)SolutionsCreator.Successor; }
     193      get {
     194        return (OffspringSelectionGeneticAlgorithmMainLoop)(
     195          (ResultsCollector)(
     196            (SubScopesCounter)SolutionsCreator.Successor
     197          ).Successor
     198        ).Successor;
     199      }
    193200    }
    194201    [Storable]
     
    236243      RandomCreator randomCreator = new RandomCreator();
    237244      SolutionsCreator solutionsCreator = new SolutionsCreator();
     245      SubScopesCounter subScopesCounter = new SubScopesCounter();
     246      ResultsCollector resultsCollector = new ResultsCollector();
    238247      OffspringSelectionGeneticAlgorithmMainLoop mainLoop = new OffspringSelectionGeneticAlgorithmMainLoop();
    239248      OperatorGraph.InitialOperator = randomCreator;
     
    247256
    248257      solutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
    249       solutionsCreator.Successor = mainLoop;
     258      solutionsCreator.Successor = subScopesCounter;
     259
     260      subScopesCounter.Name = "Initialize EvaluatedSolutions";
     261      subScopesCounter.ValueParameter.ActualName = "EvaluatedSolutions";
     262      subScopesCounter.Successor = resultsCollector;
     263
     264      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", "", "EvaluatedSolutions"));
     265      resultsCollector.ResultsParameter.ActualName = "Results";
     266      resultsCollector.Successor = mainLoop;
    250267
    251268      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     
    255272      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    256273      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
     274      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    257275      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    258276      mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r5208 r5356  
    8989    public ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
    9090      get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
     91    }
     92    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
     93      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    9194    }
    9295    #endregion
     
    126129      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm."));
    127130      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
     131      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    128132      #endregion
    129133
     
    133137      Placeholder analyzer1 = new Placeholder();
    134138      ResultsCollector resultsCollector1 = new ResultsCollector();
    135       ResultsCollector resultsCollector2 = new ResultsCollector();
    136139      OffspringSelectionGeneticAlgorithmMainOperator mainOperator = new OffspringSelectionGeneticAlgorithmMainOperator();
    137140      IntCounter generationsCounter = new IntCounter();
     
    141144      Placeholder comparisonFactorModifier = new Placeholder();
    142145      Placeholder analyzer2 = new Placeholder();
    143       ResultsCollector resultsCollector3 = new ResultsCollector();
    144146      ConditionalBranch conditionalBranch1 = new ConditionalBranch();
    145147      ConditionalBranch conditionalBranch2 = new ConditionalBranch();
     
    147149
    148150      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations
    149       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
    150151      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
    151152      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0)));
     
    165166      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    166167
    167       resultsCollector2.CopyValue = new BoolValue(true);
    168       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    169       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    170 
    171168      mainOperator.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
    172169      mainOperator.CrossoverParameter.ActualName = CrossoverParameter.Name;
    173170      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
    174171      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    175       mainOperator.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     172      mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name;
    176173      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    177174      mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name;
     
    200197
    201198      maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    202       maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";
     199      maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name;
    203200      maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";
    204201      maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";
     
    209206      analyzer2.Name = "Analyzer (placeholder)";
    210207      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    211 
    212       resultsCollector3.CopyValue = new BoolValue(true);
    213       resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    214       resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
    215208
    216209      conditionalBranch1.Name = "MaximumSelectionPressure reached?";
     
    229222      comparisonFactorInitializer.Successor = analyzer1;
    230223      analyzer1.Successor = resultsCollector1;
    231       resultsCollector1.Successor = resultsCollector2;
    232       resultsCollector2.Successor = mainOperator;
     224      resultsCollector1.Successor = mainOperator;
    233225      mainOperator.Successor = generationsCounter;
    234226      generationsCounter.Successor = maxGenerationsComparator;
     
    237229      maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier;
    238230      comparisonFactorModifier.Successor = analyzer2;
    239       analyzer2.Successor = resultsCollector3;
    240       resultsCollector3.Successor = conditionalBranch1;
     231      analyzer2.Successor = conditionalBranch1;
    241232      conditionalBranch1.FalseBranch = conditionalBranch2;
    242233      conditionalBranch1.TrueBranch = null;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs

    r5208 r5356  
    129129      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
    130130      Placeholder evaluator1 = new Placeholder();
    131       IntCounter evaluationCounter1 = new IntCounter();
     131      SubScopesCounter subScopesCounter1 = new SubScopesCounter();
    132132      WeightedParentsQualityComparator qualityComparer1 = new WeightedParentsQualityComparator();
    133133      SubScopesRemover subScopesRemover1 = new SubScopesRemover();
     
    141141      UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
    142142      Placeholder evaluator2 = new Placeholder();
    143       IntCounter evaluationCounter2 = new IntCounter();
     143      SubScopesCounter subScopesCounter2 = new SubScopesCounter();
    144144      MergingReducer mergingReducer1 = new MergingReducer();
    145145      UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor();
     
    149149      UniformSubScopesProcessor uniformSubScopesProcessor6 = new UniformSubScopesProcessor();
    150150      Placeholder evaluator3 = new Placeholder();
    151       IntCounter evaluationCounter3 = new IntCounter();
     151      SubScopesCounter subScopesCounter3 = new SubScopesCounter();
    152152      WeightedParentsQualityComparator qualityComparer2 = new WeightedParentsQualityComparator();
    153153      SubScopesRemover subScopesRemover2 = new SubScopesRemover();
     
    176176      evaluator1.OperatorParameter.ActualName = EvaluatorParameter.Name;
    177177
    178       evaluationCounter1.Name = "EvaluatedSolutions++";
    179       evaluationCounter1.Increment = new IntValue(1);
    180       evaluationCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
     178      subScopesCounter1.Name = "Increment EvaluatedSolutions";
     179      subScopesCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    181180
    182181      qualityComparer1.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
     
    209208      evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name;
    210209
    211       evaluationCounter2.Name = "EvaluatedSolutions++";
    212       evaluationCounter2.Increment = new IntValue(1);
    213       evaluationCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
     210      subScopesCounter2.Name = "Increment EvaluatedSolutions";
     211      subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    214212
    215213      crossover2.Name = "Crossover (placeholder)";
     
    227225      evaluator3.OperatorParameter.ActualName = EvaluatorParameter.Name;
    228226
    229       evaluationCounter3.Name = "EvaluatedSolutions++";
    230       evaluationCounter3.Increment = new IntValue(1);
    231       evaluationCounter3.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
     227      subScopesCounter3.Name = "Increment EvaluatedSolutions";
     228      subScopesCounter3.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    232229
    233230      qualityComparer2.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
     
    272269      crossover1.Successor = null;
    273270      uniformSubScopesProcessor2.Operator = evaluator1;
    274       uniformSubScopesProcessor2.Successor = uniformSubScopesProcessor3;
    275       evaluator1.Successor = evaluationCounter1;
    276       evaluationCounter1.Successor = qualityComparer1;
     271      uniformSubScopesProcessor2.Successor = subScopesCounter1;
     272      evaluator1.Successor = qualityComparer1;
    277273      qualityComparer1.Successor = subScopesRemover1;
    278274      subScopesRemover1.Successor = null;
     275      subScopesCounter1.Successor = uniformSubScopesProcessor3;
    279276      uniformSubScopesProcessor3.Operator = mutationBranch1;
    280277      uniformSubScopesProcessor3.Successor = conditionalSelector;
     
    290287      subScopesProcessor2.Successor = mergingReducer1;
    291288      uniformSubScopesProcessor4.Operator = evaluator2;
    292       uniformSubScopesProcessor4.Successor = null;
    293       evaluator2.Successor = evaluationCounter2;
    294       evaluationCounter2.Successor = null;
     289      uniformSubScopesProcessor4.Successor = subScopesCounter2;
     290      evaluator2.Successor = null;
     291      subScopesCounter2.Successor = null;
    295292      mergingReducer1.Successor = null;
    296293      uniformSubScopesProcessor5.Operator = crossover2;
     
    302299      mutator2.Successor = null;
    303300      uniformSubScopesProcessor6.Operator = evaluator3;
    304       uniformSubScopesProcessor6.Successor = null;
    305       evaluator3.Successor = evaluationCounter3;
    306       evaluationCounter3.Successor = qualityComparer2;
     301      uniformSubScopesProcessor6.Successor = subScopesCounter3;
     302      evaluator3.Successor = qualityComparer2;
    307303      qualityComparer2.Successor = subScopesRemover2;
    308304      subScopesRemover2.Successor = null;
     305      subScopesCounter3.Successor = null;
    309306      offspringSelector.OffspringCreator = selector;
    310307      offspringSelector.Successor = subScopesProcessor3;
  • 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
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r5208 r5356  
    105105    public ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
    106106      get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
     107    }
     108    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
     109      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    107110    }
    108111    #endregion
     
    142145      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum genreation that terminates the algorithm."));
    143146      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
     147      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    144148      #endregion
    145149
     
    155159      Placeholder analyzer1 = new Placeholder();
    156160      ResultsCollector resultsCollector1 = new ResultsCollector();
    157       ResultsCollector resultsCollector2 = new ResultsCollector();
    158161      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
    159162      ConditionalBranch villageTerminatedBySelectionPressure1 = new ConditionalBranch();
     
    161164      Placeholder villageAnalyzer2 = new Placeholder();
    162165      ResultsCollector villageResultsCollector2 = new ResultsCollector();
    163       IntCounter evaluatedSolutionsCounter = new IntCounter();
    164       Assigner villageEvaluatedSolutionsAssigner = new Assigner();
    165166      Comparator villageSelectionPressureComparator = new Comparator();
    166167      ConditionalBranch villageTerminatedBySelectionPressure2 = new ConditionalBranch();
     
    187188      Comparator maximumEvaluatedSolutionsComparator = new Comparator();
    188189      Placeholder analyzer2 = new Placeholder();
    189       ResultsCollector resultsCollector3 = new ResultsCollector();
    190190      ConditionalBranch terminationCondition = new ConditionalBranch();
    191191      ConditionalBranch maximumGenerationsTerminationCondition = new ConditionalBranch();
     
    195195      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class SASEGASA expects this to be called Generations
    196196      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastReunification", new IntValue(0)));
    197       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
    198197      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TerminatedVillages", new IntValue(0)));
    199198
     
    208207
    209208      villageVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));
    210       villageVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("VillageEvaluatedSolutions", new IntValue(0)));
    211209      villageVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false)));
    212210      villageVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
     
    231229      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    232230
    233       resultsCollector2.CopyValue = new BoolValue(true);
    234       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    235       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    236 
    237231      villageTerminatedBySelectionPressure1.Name = "Village Terminated ?";
    238232      villageTerminatedBySelectionPressure1.ConditionParameter.ActualName = "TerminateSelectionPressure";
     
    242236      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
    243237      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    244       mainOperator.EvaluatedSolutionsParameter.ActualName = "VillageEvaluatedSolutions";
     238      mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name;
    245239      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    246240      mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name;
     
    262256      villageResultsCollector2.ResultsParameter.ActualName = "Results";
    263257
    264       evaluatedSolutionsCounter.Name = "Update EvaluatedSolutions";
    265       evaluatedSolutionsCounter.ValueParameter.ActualName = "EvaluatedSolutions";
    266       evaluatedSolutionsCounter.Increment = null;
    267       evaluatedSolutionsCounter.IncrementParameter.ActualName = "VillageEvaluatedSolutions";
    268 
    269       villageEvaluatedSolutionsAssigner.Name = "Reset EvaluatedSolutions";
    270       villageEvaluatedSolutionsAssigner.LeftSideParameter.ActualName = "VillageEvaluatedSolutions";
    271       villageEvaluatedSolutionsAssigner.RightSideParameter.Value = new IntValue(0);
    272 
    273258      villageSelectionPressureComparator.Name = "SelectionPressure >= MaximumSelectionPressure ?";
    274259      villageSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";
     
    360345      maximumEvaluatedSolutionsComparator.Name = "EvaluatedSolutions >= MaximumEvaluatedSolutions";
    361346      maximumEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    362       maximumEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions";
     347      maximumEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name;
    363348      maximumEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";
    364349      maximumEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";
     
    366351      analyzer2.Name = "Analyzer (placeholder)";
    367352      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    368 
    369       resultsCollector3.CopyValue = new BoolValue(true);
    370       resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    371       resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
    372353
    373354      terminationCondition.ConditionParameter.ActualName = "TerminateSASEGASA";
     
    387368      villageAnalyzer1.Successor = villageResultsCollector1;
    388369      analyzer1.Successor = resultsCollector1;
    389       resultsCollector1.Successor = resultsCollector2;
    390       resultsCollector2.Successor = uniformSubScopesProcessor1;
     370      resultsCollector1.Successor = uniformSubScopesProcessor1;
    391371      uniformSubScopesProcessor1.Operator = villageTerminatedBySelectionPressure1;
    392372      uniformSubScopesProcessor1.Successor = generationsCounter;
     
    396376      mainOperator.Successor = villageAnalyzer2;
    397377      villageAnalyzer2.Successor = villageResultsCollector2;
    398       villageResultsCollector2.Successor = evaluatedSolutionsCounter;
    399       evaluatedSolutionsCounter.Successor = villageEvaluatedSolutionsAssigner;
    400       villageEvaluatedSolutionsAssigner.Successor = villageSelectionPressureComparator;
     378      villageResultsCollector2.Successor = villageSelectionPressureComparator;
    401379      villageSelectionPressureComparator.Successor = villageTerminatedBySelectionPressure2;
    402380      villageTerminatedBySelectionPressure2.TrueBranch = terminatedVillagesCounter;
     
    433411      maximumGenerationsComparator.Successor = maximumEvaluatedSolutionsComparator;
    434412      maximumEvaluatedSolutionsComparator.Successor = analyzer2;
    435       analyzer2.Successor = resultsCollector3;
    436       resultsCollector3.Successor = terminationCondition;
     413      analyzer2.Successor = terminationCondition;
    437414      terminationCondition.TrueBranch = null;
    438415      terminationCondition.FalseBranch = maximumGenerationsTerminationCondition;
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs

    r4722 r5356  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Operators;
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Optimization.Operators;
     
    135136    }
    136137    private SimulatedAnnealingMainLoop MainLoop {
    137       get { return (SimulatedAnnealingMainLoop)SolutionsCreator.Successor; }
     138      get {
     139        return (SimulatedAnnealingMainLoop)(
     140          (ResultsCollector)(
     141            (VariableCreator)SolutionsCreator.Successor
     142          ).Successor
     143        ).Successor;
     144      }
    138145    }
    139146    [Storable]
     
    171178      RandomCreator randomCreator = new RandomCreator();
    172179      SolutionsCreator solutionsCreator = new SolutionsCreator();
     180      VariableCreator variableCreator = new VariableCreator();
     181      ResultsCollector resultsCollector = new ResultsCollector();
    173182      SimulatedAnnealingMainLoop mainLoop = new SimulatedAnnealingMainLoop();
    174183      OperatorGraph.InitialOperator = randomCreator;
     
    182191
    183192      solutionsCreator.NumberOfSolutions = new IntValue(1);
    184       solutionsCreator.Successor = mainLoop;
     193      solutionsCreator.Successor = variableCreator;
     194
     195      variableCreator.Name = "Initialize EvaluatedMoves";
     196      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue()));
     197      variableCreator.Successor = resultsCollector;
     198
     199      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     200      resultsCollector.ResultsParameter.ActualName = "Results";
     201      resultsCollector.Successor = mainLoop;
    185202
    186203      mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name;
     
    194211      mainLoop.ResultsParameter.ActualName = "Results";
    195212      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     213      mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves";
    196214
    197215      foreach (IDiscreteDoubleValueModifier op in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name))
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs

    r4722 r5356  
    8080    public ValueLookupParameter<VariableCollection> ResultsParameter {
    8181      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
     82    }
     83    public LookupParameter<IntValue> EvaluatedMovesParameter {
     84      get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; }
    8285    }
    8386    #endregion
     
    115118      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
    116119      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
     120      Parameters.Add(new LookupParameter<IntValue>("EvaluatedMoves", "The number of evaluated moves."));
    117121      #endregion
    118122
     
    129133      UniformSubScopesProcessor moveEvaluationProcessor = new UniformSubScopesProcessor();
    130134      Placeholder moveEvaluator = new Placeholder();
     135      SubScopesCounter subScopesCounter = new SubScopesCounter();
    131136      ProbabilisticQualityComparator qualityComparator = new ProbabilisticQualityComparator();
    132137      ConditionalBranch improvesQualityBranch = new ConditionalBranch();
     
    135140      IntCounter iterationsCounter = new IntCounter();
    136141      Comparator iterationsComparator = new Comparator();
    137       ResultsCollector resultsCollector2 = new ResultsCollector();
    138142      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
    139143      Placeholder analyzer2 = new Placeholder();
     
    158162      moveEvaluator.Name = "Move evaluator (placeholder)";
    159163      moveEvaluator.OperatorParameter.ActualName = MoveEvaluatorParameter.Name;
     164
     165      subScopesCounter.Name = "Increment EvaluatedMoves";
     166      subScopesCounter.ValueParameter.ActualName = EvaluatedMovesParameter.Name;
    160167
    161168      qualityComparator.LeftSideParameter.ActualName = MoveQualityParameter.Name;
     
    180187      iterationsComparator.ResultParameter.ActualName = "Terminate";
    181188      iterationsComparator.Comparison.Value = ComparisonType.GreaterOrEqual;
    182 
    183       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    184       resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Temperature"));
    185       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    186189
    187190      analyzer2.Name = "Analyzer (placeholder)";
     
    198201      subScopesProcessor0.Operators.Add(analyzer1);
    199202      subScopesProcessor0.Successor = sssp;
     203      analyzer1.Successor = null;
    200204      sssp.Operators.Add(resultsCollector);
     205      sssp.Successor = annealingOperator;
    201206      resultsCollector.Successor = null;
    202       sssp.Successor = annealingOperator;
    203207      annealingOperator.Successor = mainProcessor;
    204208      mainProcessor.Operator = moveGenerator;
     
    206210      moveGenerator.Successor = moveEvaluationProcessor;
    207211      moveEvaluationProcessor.Operator = moveEvaluator;
    208       moveEvaluationProcessor.Successor = subScopesRemover;
     212      moveEvaluationProcessor.Successor = subScopesCounter;
    209213      moveEvaluator.Successor = qualityComparator;
    210214      qualityComparator.Successor = improvesQualityBranch;
    211215      improvesQualityBranch.TrueBranch = moveMaker;
     216      improvesQualityBranch.FalseBranch = null;
     217      improvesQualityBranch.Successor = null;
     218      moveMaker.Successor = null;
     219      subScopesCounter.Successor = subScopesRemover;
     220      subScopesRemover.Successor = null;
    212221      iterationsCounter.Successor = iterationsComparator;
    213       iterationsComparator.Successor = resultsCollector2;
    214       resultsCollector2.Successor = subScopesProcessor1;
     222      iterationsComparator.Successor = subScopesProcessor1;
    215223      subScopesProcessor1.Operators.Add(analyzer2);
    216224      subScopesProcessor1.Successor = iterationsTermination;
  • trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs

    r4722 r5356  
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Operators;
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Optimization.Operators;
     
    134135    }
    135136    private TabuSearchMainLoop MainLoop {
    136       get { return (TabuSearchMainLoop)SolutionsCreator.Successor; }
     137      get {
     138        return (TabuSearchMainLoop)(
     139          (ResultsCollector)(
     140            (VariableCreator)SolutionsCreator.Successor
     141          ).Successor
     142        ).Successor;
     143      }
    137144    }
    138145    [Storable]
     
    158165      RandomCreator randomCreator = new RandomCreator();
    159166      SolutionsCreator solutionsCreator = new SolutionsCreator();
    160       TabuSearchMainLoop tsMainLoop = new TabuSearchMainLoop();
     167      VariableCreator variableCreator = new VariableCreator();
     168      ResultsCollector resultsCollector = new ResultsCollector();
     169      TabuSearchMainLoop mainLoop = new TabuSearchMainLoop();
    161170      OperatorGraph.InitialOperator = randomCreator;
    162171
     
    169178
    170179      solutionsCreator.NumberOfSolutions = new IntValue(1);
    171       solutionsCreator.Successor = tsMainLoop;
    172 
    173       tsMainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name;
    174       tsMainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name;
    175       tsMainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name;
    176       tsMainLoop.TabuCheckerParameter.ActualName = TabuCheckerParameter.Name;
    177       tsMainLoop.TabuMakerParameter.ActualName = TabuMakerParameter.Name;
    178       tsMainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
    179       tsMainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
    180       tsMainLoop.ResultsParameter.ActualName = "Results";
    181       tsMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     180      solutionsCreator.Successor = variableCreator;
     181
     182      variableCreator.Name = "Initialize EvaluatedMoves";
     183      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue()));
     184      variableCreator.Successor = resultsCollector;
     185
     186      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     187      resultsCollector.ResultsParameter.ActualName = "Results";
     188      resultsCollector.Successor = mainLoop;
     189
     190      mainLoop.MoveGeneratorParameter.ActualName = MoveGeneratorParameter.Name;
     191      mainLoop.MoveMakerParameter.ActualName = MoveMakerParameter.Name;
     192      mainLoop.MoveEvaluatorParameter.ActualName = MoveEvaluatorParameter.Name;
     193      mainLoop.TabuCheckerParameter.ActualName = TabuCheckerParameter.Name;
     194      mainLoop.TabuMakerParameter.ActualName = TabuMakerParameter.Name;
     195      mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     196      mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     197      mainLoop.ResultsParameter.ActualName = "Results";
     198      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     199      mainLoop.EvaluatedMovesParameter.ActualName = "EvaluatedMoves";
    182200
    183201      moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
  • trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs

    r5354 r5356  
    8383      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
    8484    }
     85    public LookupParameter<IntValue> EvaluatedMovesParameter {
     86      get { return (LookupParameter<IntValue>)Parameters["EvaluatedMoves"]; }
     87    }
    8588    #endregion
    8689
     
    131134      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution and moves."));
    132135      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
     136      Parameters.Add(new LookupParameter<IntValue>("EvaluatedMoves", "The number of evaluated moves."));
    133137      #endregion
    134138
     
    162166
    163167      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0))); // Class TabuSearch expects this to be called Iterations
    164       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0)));
    165168      variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("EmptyNeighborhood", new BoolValue(false)));
    166169      variableCreator.CollectedValues.Add(new ValueParameter<ItemList<IItem>>("TabuList", new ItemList<IItem>()));
     
    178181      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    179182      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    180       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    181183      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    182184
     
    193195
    194196      subScopesCounter.Name = "Increment EvaluatedMoves";
    195       subScopesCounter.ValueParameter.ActualName = "EvaluatedMoves";
     197      subScopesCounter.ValueParameter.ActualName = EvaluatedMovesParameter.Name;
    196198
    197199      moveQualitySorter.DescendingParameter.ActualName = MaximizationParameter.Name;
Note: See TracChangeset for help on using the changeset viewer.