Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/10 17:47:49 (14 years ago)
Author:
abeham
Message:

#893

  • fixed BestKnownQuality tracking in tabu search and local search
File:
1 edited

Legend:

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

    r3750 r3809  
    6868      get { return (ValueLookupParameter<IOperator>)Parameters["MoveMaker"]; }
    6969    }
    70     public ValueLookupParameter<IOperator> MoveAnalyzerParameter {
    71       get { return (ValueLookupParameter<IOperator>)Parameters["MoveAnalyzer"]; }
    72     }
    7370    public ValueLookupParameter<IOperator> AnalyzerParameter {
    7471      get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; }
     
    104101      Parameters.Add(new ValueLookupParameter<IOperator>("MoveEvaluator", "The operator that evaluates a move."));
    105102
    106       Parameters.Add(new ValueLookupParameter<IOperator>("MoveAnalyzer", "The operator used to analyze the moves."));
    107       Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution."));
     103      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze the solution and moves."));
    108104      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied."));
    109105      #endregion
     
    123119      Placeholder moveAnalyzer = new Placeholder();
    124120      BestSelector bestSelector = new BestSelector();
    125       RightReducer rightReducer = new RightReducer();
    126121      SubScopesProcessor moveMakingProcessor = new SubScopesProcessor();
     122      UniformSubScopesProcessor selectedMoveMakingProcessor = new UniformSubScopesProcessor();
    127123      QualityComparator qualityComparator = new QualityComparator();
    128124      ConditionalBranch improvesQualityBranch = new ConditionalBranch();
    129125      Placeholder moveMaker = new Placeholder();
    130126      Assigner bestQualityUpdater = new Assigner();
     127      MergingReducer mergingReducer = new MergingReducer();
     128      Placeholder analyzer2 = new Placeholder();
    131129      SubScopesRemover subScopesRemover = new SubScopesRemover();
    132130      IntCounter iterationsCounter = new IntCounter();
    133131      Comparator iterationsComparator = new Comparator();
    134       SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
    135       Placeholder analyzer2 = new Placeholder();
    136132      ResultsCollector resultsCollector3 = new ResultsCollector();
    137133      ConditionalBranch iterationsTermination = new ConditionalBranch();
     
    167163      evaluatedMovesCounter.Increment = new IntValue(1);
    168164
    169       moveAnalyzer.Name = "MoveAnalyzer (placeholder)";
    170       moveAnalyzer.OperatorParameter.ActualName = MoveAnalyzerParameter.Name;
    171 
    172165      bestSelector.CopySelected = new BoolValue(false);
    173166      bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
     
    187180      bestQualityUpdater.LeftSideParameter.ActualName = "BestQuality";
    188181      bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name;
     182
     183      analyzer2.Name = "Analyzer (placeholder)";
     184      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    189185
    190186      subScopesRemover.RemoveAllSubScopes = true;
     
    199195      iterationsComparator.RightSideParameter.ActualName = MaximumIterationsParameter.Name;
    200196      iterationsComparator.ResultParameter.ActualName = "Terminate";
    201 
    202       analyzer2.Name = "Analyzer (placeholder)";
    203       analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    204197
    205198      resultsCollector3.CopyValue = new BoolValue(true);
     
    228221      evaluatedMovesCounter.Successor = null;
    229222      moveAnalyzer.Successor = bestSelector;
    230       bestSelector.Successor = rightReducer;
    231       rightReducer.Successor = moveMakingProcessor;
    232       moveMakingProcessor.Operators.Add(qualityComparator);
    233       moveMakingProcessor.Successor = subScopesRemover;
    234       subScopesRemover.Successor = null;
     223      bestSelector.Successor = moveMakingProcessor;
     224      moveMakingProcessor.Operators.Add(new EmptyOperator());
     225      moveMakingProcessor.Operators.Add(selectedMoveMakingProcessor);
     226      moveMakingProcessor.Successor = mergingReducer;
     227      selectedMoveMakingProcessor.Operator = qualityComparator;
    235228      qualityComparator.Successor = improvesQualityBranch;
    236229      improvesQualityBranch.TrueBranch = moveMaker;
     
    239232      moveMaker.Successor = bestQualityUpdater;
    240233      bestQualityUpdater.Successor = null;
     234      mergingReducer.Successor = analyzer2;
     235      analyzer2.Successor = subScopesRemover;
     236      subScopesRemover.Successor = null;
    241237      iterationsCounter.Successor = iterationsComparator;
    242       iterationsComparator.Successor = subScopesProcessor1;
    243       subScopesProcessor1.Operators.Add(analyzer2);
    244       subScopesProcessor1.Successor = resultsCollector3;
    245       analyzer2.Successor = null;
     238      iterationsComparator.Successor = resultsCollector3;
    246239      resultsCollector3.Successor = iterationsTermination;
    247240      iterationsTermination.TrueBranch = null;
Note: See TracChangeset for help on using the changeset viewer.