Changeset 3626


Ignore:
Timestamp:
05/05/10 11:34:35 (12 years ago)
Author:
abeham
Message:

Fixed build break in ES, LS, and SA due to Analyzer changes #999

Location:
trunk/sources
Files:
4 edited

Legend:

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

    r3621 r3626  
    7272      get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; }
    7373    }
    74     private ValueParameter<MultiAnalyzer> MoveAnalyzerParameter {
    75       get { return (ValueParameter<MultiAnalyzer>)Parameters["MoveAnalyzer"]; }
    76     }
    77     private ValueParameter<MultiAnalyzer> AnalyzerParameter {
    78       get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     74    private ValueParameter<MultiAnalyzer<IPopulationAnalyzer>> MoveAnalyzerParameter {
     75      get { return (ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>)Parameters["MoveAnalyzer"]; }
     76    }
     77    private ValueParameter<MultiAnalyzer<ISolutionAnalyzer>> AnalyzerParameter {
     78      get { return (ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>)Parameters["Analyzer"]; }
    7979    }
    8080    #endregion
     
    109109      set { SampleSizeParameter.Value = value; }
    110110    }
    111     public MultiAnalyzer MoveAnalyzer {
     111    public MultiAnalyzer<IPopulationAnalyzer> MoveAnalyzer {
    112112      get { return MoveAnalyzerParameter.Value; }
    113113      set { MoveAnalyzerParameter.Value = value; }
    114114    }
    115     public MultiAnalyzer Analyzer {
     115    public MultiAnalyzer<ISolutionAnalyzer> Analyzer {
    116116      get { return AnalyzerParameter.Value; }
    117117      set { AnalyzerParameter.Value = value; }
     
    126126      get { return (LocalSearchMainLoop)SolutionsCreator.Successor; }
    127127    }
    128     private BestAverageWorstQualityAnalyzer moveQualityAnalyzer;
     128    private PopulationBestAverageWorstQualityAnalyzer moveQualityAnalyzer;
    129129    #endregion
    130130
     
    140140      Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(1000)));
    141141      Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators.", new IntValue(100)));
    142       Parameters.Add(new ValueParameter<MultiAnalyzer>("MoveAnalyzer", "The operator used to analyze the moves in each iteration.", new MultiAnalyzer()));
    143       Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each iteration.", new MultiAnalyzer()));
     142      Parameters.Add(new ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>("MoveAnalyzer", "The operator used to analyze the moves in each iteration.", new MultiAnalyzer<IPopulationAnalyzer>()));
     143      Parameters.Add(new ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>("Analyzer", "The operator used to analyze each iteration.", new MultiAnalyzer<ISolutionAnalyzer>()));
    144144     
    145145      RandomCreator randomCreator = new RandomCreator();
     
    268268    }
    269269    private void InitializeAnalyzers() {
    270       moveQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
     270      moveQualityAnalyzer = new PopulationBestAverageWorstQualityAnalyzer();
    271271      ParameterizeAnalyzers();
    272272    }
     
    317317      MoveAnalyzer.Operators.Clear();
    318318      MoveAnalyzer.Operators.Add(moveQualityAnalyzer);
    319       /*if (Problem != null) {
     319      if (Problem != null) {
    320320        foreach (ISolutionAnalyzer analyzer in Problem.Operators.OfType<ISolutionAnalyzer>().OrderBy(x => x.Name))
    321321          Analyzer.Operators.Add(analyzer);
    322       }*/
     322      }
    323323    }
    324324    private void ClearMoveParameters() {
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs

    r3622 r3626  
    8181      get { return (ValueParameter<DoubleValue>)Parameters["EndTemperature"]; }
    8282    }
    83     private ValueParameter<MultiAnalyzer> AnalyzerParameter {
    84       get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     83    private ValueParameter<MultiAnalyzer<ISolutionAnalyzer>> AnalyzerParameter {
     84      get { return (ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>)Parameters["Analyzer"]; }
    8585    }
    8686    #endregion
     
    123123      set { EndTemperatureParameter.Value = value; }
    124124    }
    125     public MultiAnalyzer Analyzer {
     125    public MultiAnalyzer<ISolutionAnalyzer> Analyzer {
    126126      get { return AnalyzerParameter.Value; }
    127127      set { AnalyzerParameter.Value = value; }
     
    141141      get { return annealingOperators; }
    142142    }
    143     private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     143    private SolutionQualityAnalyzer qualityAnalyzer;
    144144    #endregion
    145145
     
    158158      Parameters.Add(new ValueParameter<DoubleValue>("StartTemperature", "The initial temperature.", new DoubleValue(100)));
    159159      Parameters.Add(new ValueParameter<DoubleValue>("EndTemperature", "The final temperature which should be reached when iterations reaches maximum iterations.", new DoubleValue(1e-6)));
    160       Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
     160      Parameters.Add(new ValueParameter<MultiAnalyzer<ISolutionAnalyzer>>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer<ISolutionAnalyzer>()));
    161161     
    162162      RandomCreator randomCreator = new RandomCreator();
     
    297297    }
    298298    private void InitializeAnalyzers() {
    299       qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
     299      qualityAnalyzer = new SolutionQualityAnalyzer();
    300300      ParameterizeAnalyzers();
    301301    }
     
    401401      Analyzer.Operators.Add(qualityAnalyzer);
    402402      if (Problem != null) {
    403         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>().OrderBy(x => x.Name))
     403        foreach (ISolutionAnalyzer analyzer in Problem.Operators.OfType<ISolutionAnalyzer>().OrderBy(x => x.Name))
    404404          Analyzer.Operators.Add(analyzer);
    405405      }
  • trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealingMainLoop.cs

    r3622 r3626  
    116116      VariableCreator variableCreator = new VariableCreator();
    117117      ResultsCollector resultsCollector1 = new ResultsCollector();
     118      SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor();
    118119      Placeholder analyzer1 = new Placeholder();
    119120      SubScopesProcessor sssp = new SubScopesProcessor();
     
    131132      Comparator iterationsComparator = new Comparator();
    132133      ResultsCollector resultsCollector2 = new ResultsCollector();
     134      SubScopesProcessor subScopesProcessor1 = new SubScopesProcessor();
    133135      Placeholder analyzer2 = new Placeholder();
    134136      ConditionalBranch iterationsTermination = new ConditionalBranch();
     
    189191      OperatorGraph.InitialOperator = variableCreator;
    190192      variableCreator.Successor = resultsCollector1;
    191       resultsCollector1.Successor = analyzer1;
    192       analyzer1.Successor = sssp;
     193      resultsCollector1.Successor = subScopesProcessor0;
     194      subScopesProcessor0.Operators.Add(analyzer1);
     195      subScopesProcessor0.Successor = sssp;
    193196      sssp.Operators.Add(resultsCollector);
    194197      resultsCollector.Successor = null;
     
    205208      iterationsCounter.Successor = iterationsComparator;
    206209      iterationsComparator.Successor = resultsCollector2;
    207       resultsCollector2.Successor = analyzer2;
    208       analyzer2.Successor = iterationsTermination;
     210      resultsCollector2.Successor = subScopesProcessor1;
     211      subScopesProcessor1.Operators.Add(analyzer2);
     212      subScopesProcessor1.Successor = iterationsTermination;
    209213      iterationsTermination.TrueBranch = null;
    210214      iterationsTermination.FalseBranch = annealingOperator;
Note: See TracChangeset for help on using the changeset viewer.