Changeset 3679


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

#840, #921

  • fixed counting of evaluated moves slowing down execution
Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs

    r3636 r3679  
    115115      Placeholder analyzer1 = new Placeholder();
    116116      ResultsCollector resultsCollector1 = new ResultsCollector();
     117      ResultsCollector resultsCollector2 = new ResultsCollector();
    117118      SubScopesProcessor mainProcessor = new SubScopesProcessor();
    118119      Placeholder moveGenerator = new Placeholder();
     
    133134      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
    134135      Placeholder analyzer2 = new Placeholder();
    135       ResultsCollector resultsCollector2 = new ResultsCollector();
     136      ResultsCollector resultsCollector3 = new ResultsCollector();
    136137      ConditionalBranch iterationsTermination = new ConditionalBranch();
    137138
     
    147148      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
    148149
     150      resultsCollector1.CopyValue = new BoolValue(false);
    149151      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    150152      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    151       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    152153      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
     154
     155      resultsCollector2.CopyValue = new BoolValue(true);
     156      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     157      resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    153158
    154159      moveGenerator.Name = "MoveGenerator (placeholder)";
     
    198203      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    199204
    200       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    201       resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    202       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    203       resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
     205      resultsCollector3.CopyValue = new BoolValue(true);
     206      resultsCollector3.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     207      resultsCollector3.ResultsParameter.ActualName = ResultsParameter.Name;
    204208
    205209      iterationsTermination.Name = "Iterations Termination Condition";
     
    214218      bestQualityInitializer.Successor = analyzer1;
    215219      analyzer1.Successor = null;
    216       resultsCollector1.Successor = mainProcessor;
     220      resultsCollector1.Successor = resultsCollector2;
     221      resultsCollector2.Successor = mainProcessor;
    217222      mainProcessor.Operators.Add(moveGenerator);
    218223      mainProcessor.Successor = iterationsCounter;
     
    237242      iterationsComparator.Successor = subScopesProcessor1;
    238243      subScopesProcessor1.Operators.Add(analyzer2);
    239       subScopesProcessor1.Successor = resultsCollector2;
     244      subScopesProcessor1.Successor = resultsCollector3;
    240245      analyzer2.Successor = null;
    241       resultsCollector2.Successor = iterationsTermination;
     246      resultsCollector3.Successor = iterationsTermination;
    242247      iterationsTermination.TrueBranch = null;
    243248      iterationsTermination.FalseBranch = mainProcessor;
  • 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.