Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/06/10 17:23:31 (15 years ago)
Author:
abeham
Message:

#840, #921

  • fixed counting of evaluated moves slowing down execution
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearchMainLoop.cs

    r3636 r3679  
    123123      Placeholder analyzer1 = new Placeholder();
    124124      ResultsCollector resultsCollector1 = new ResultsCollector();
     125      ResultsCollector resultsCollector2 = new ResultsCollector();
    125126      SubScopesProcessor solutionProcessor = new SubScopesProcessor();
    126127      Placeholder moveGenerator = new Placeholder();
     
    144145      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
    145146      Placeholder analyzer2 = new Placeholder();
    146       ResultsCollector resultsCollector2 = new ResultsCollector();
     147      ResultsCollector resultsCollector3 = new ResultsCollector();
    147148      ConditionalBranch iterationsTermination = new ConditionalBranch();
    148149
     
    159160      analyzer1.Name = "Analyzer (placeholder)";
    160161      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
    161      
     162
     163      resultsCollector1.CopyValue = new BoolValue(false);
    162164      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    163165      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    164       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    165166      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
     167
     168      resultsCollector2.CopyValue = new BoolValue(true);
     169      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     170      resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    166171
    167172      moveGenerator.Name = "MoveGenerator (placeholder)";
     
    222227      analyzer2.Name = "Analyzer (placeholder)";
    223228      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    224      
    225       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    226       resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    227       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    228       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
     229
     230      resultsCollector3.CopyValue = new BoolValue(true);
     231      resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     232      resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
    229233
    230234      emptyNeighborhoodBranch2.Name = "Neighborhood empty?";
     
    240244      subScopesProcessor0.Operators.Add(bestQualityInitializer);
    241245      subScopesProcessor0.Successor = resultsCollector1;
    242       resultsCollector1.Successor = solutionProcessor;
     246      resultsCollector1.Successor = resultsCollector2;
     247      resultsCollector2.Successor = solutionProcessor;
    243248      solutionProcessor.Operators.Add(moveGenerator);
    244249      solutionProcessor.Successor = iterationsCounter;
     
    264269      iterationsComparator.Successor = subScopesProcessor1;
    265270      subScopesProcessor1.Operators.Add(analyzer2);
    266       subScopesProcessor1.Successor = resultsCollector2;
    267       resultsCollector2.Successor = emptyNeighborhoodBranch2;
     271      subScopesProcessor1.Successor = resultsCollector3;
     272      resultsCollector3.Successor = emptyNeighborhoodBranch2;
    268273      emptyNeighborhoodBranch2.TrueBranch = null;
    269274      emptyNeighborhoodBranch2.FalseBranch = iterationsTermination;
Note: See TracChangeset for help on using the changeset viewer.