Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/02/16 14:10:53 (9 years ago)
Author:
abeham
Message:

#2457:

  • Added stripped-down version of FLA branch
  • Added appropriate calculators
  • Fixed detecting maximization in RLD view
Location:
branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape
Files:
4 added
7 deleted
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysis.cs

    r8172 r13583  
    2020#endregion
    2121
    22 using System;
    23 using System.Linq;
    2422using HeuristicLab.Common;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Data;
     25using HeuristicLab.Operators;
    2726using HeuristicLab.Optimization;
    2827using HeuristicLab.Optimization.Operators;
    2928using HeuristicLab.Parameters;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.PluginInfrastructure;
    3230using HeuristicLab.Random;
     31using System;
     32using System.Linq;
    3333
    3434namespace HeuristicLab.Analysis.FitnessLandscape {
    3535  [Item("Local Analysis", "A local analysis algorithm.")]
    36   [Creatable("Algorithms")]
    3736  [StorableClass]
    38   public sealed class LocalAnalysis : HeuristicOptimizationEngineAlgorithm, IStorableContent {
     37  public abstract class LocalAnalysis<T> : HeuristicOptimizationEngineAlgorithm, IStorableContent where T : class, IOperator, new() {
    3938    public string Filename { get; set; }
    4039
     
    5049
    5150    #region Parameter Properties
    52     private ValueParameter<IntValue> SeedParameter {
    53       get { return (ValueParameter<IntValue>)Parameters["Seed"]; }
    54     }
    55     private ValueParameter<BoolValue> SetSeedRandomlyParameter {
    56       get { return (ValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
     51    public IFixedValueParameter<IntValue> SeedParameter {
     52      get { return (IFixedValueParameter<IntValue>)Parameters["Seed"]; }
     53    }
     54    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter {
     55      get { return (IFixedValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
    5756    }
    5857    public IConstrainedValueParameter<IManipulator> MutatorParameter {
    5958      get { return (IConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
    6059    }
    61     public IConstrainedValueParameter<ISelector> SelectorParameter {
    62       get { return (IConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
    63     }
    64     private ValueParameter<IntValue> MaximumIterationsParameter {
    65       get { return (ValueParameter<IntValue>)Parameters["MaximumIterations"]; }
    66     }
    67     private ValueParameter<IntValue> SampleSizeParameter {
    68       get { return (ValueParameter<IntValue>)Parameters["SampleSize"]; }
    69     }
    70     private ValueParameter<MultiAnalyzer> AnalyzerParameter {
    71       get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     60    public IFixedValueParameter<IntValue> MaximumIterationsParameter {
     61      get { return (IFixedValueParameter<IntValue>)Parameters["MaximumIterations"]; }
     62    }
     63    public IValueParameter<MultiAnalyzer> AnalyzerParameter {
     64      get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
     65    }
     66    public IFixedValueParameter<T> SelectorParameter {
     67      get { return (IFixedValueParameter<T>)Parameters["Selector"]; }
    7268    }
    7369    #endregion
    7470
    7571    #region Properties
    76     private RandomCreator RandomCreator {
     72    protected RandomCreator RandomCreator {
    7773      get { return (RandomCreator)OperatorGraph.InitialOperator; }
    7874    }
    79     private SolutionsCreator SolutionsCreator {
    80       get { return (SolutionsCreator)RandomCreator.Successor; }
    81     }
    82     private LocalAnalysisMainLoop MainLoop {
     75    protected VariableCreator VariableCreator {
     76      get { return (VariableCreator)RandomCreator.Successor; }
     77    }
     78    protected SolutionsCreator SolutionsCreator {
     79      get { return (SolutionsCreator)VariableCreator.Successor; }
     80    }
     81    protected LocalAnalysisMainLoop MainLoop {
    8382      get { return (LocalAnalysisMainLoop)SolutionsCreator.Successor; }
    8483    }
    85     [Storable]
    86     private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     84
    8785    [Storable]
    8886    private QualityTrailMultiAnalyzer qualityTrailAnalyzer;
     
    9088
    9189    [StorableConstructor]
    92     private LocalAnalysis(bool deserializing) : base(deserializing) { }
    93     private LocalAnalysis(LocalAnalysis original, Cloner cloner)
     90    protected LocalAnalysis(bool deserializing) : base(deserializing) { }
     91    protected LocalAnalysis(LocalAnalysis<T> original, Cloner cloner)
    9492      : base(original, cloner) {
    95       qualityAnalyzer = (BestAverageWorstQualityAnalyzer)cloner.Clone(original.qualityAnalyzer);
    96       qualityTrailAnalyzer = (QualityTrailMultiAnalyzer)cloner.Clone(original.qualityTrailAnalyzer);
    97       Initialize();
    98     }
    99     public LocalAnalysis()
     93      qualityTrailAnalyzer = cloner.Clone(original.qualityTrailAnalyzer);
     94      RegisterEventHandlers();
     95    }
     96    protected LocalAnalysis(T selector)
    10097      : base() {
    101       Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
    102       Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
     98      Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
     99      Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
    103100      Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "Mutation operator."));
    104       Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "Selection operator."));
    105       Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000)));
    106       Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Number of moves that MultiMoveGenerators should create. This is ignored for Exhaustive- and SingleMoveGenerators.", new IntValue(1)));
     101      Parameters.Add(new FixedValueParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(10000)));
    107102      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the solution and moves.", new MultiAnalyzer()));
     103      Parameters.Add(new FixedValueParameter<T>("Selector", "Selection operator.", selector));
    108104
    109105      RandomCreator randomCreator = new RandomCreator();
     106      VariableCreator variableCreator = new VariableCreator();
    110107      SolutionsCreator solutionsCreator = new SolutionsCreator();
    111108      LocalAnalysisMainLoop laMainLoop = new LocalAnalysisMainLoop();
     
    117114      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
    118115      randomCreator.SetSeedRandomlyParameter.Value = null;
    119       randomCreator.Successor = solutionsCreator;
     116      randomCreator.Successor = variableCreator;
     117
     118      variableCreator.Successor = solutionsCreator;
    120119
    121120      solutionsCreator.NumberOfSolutions = new IntValue(1);
     
    129128      laMainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
    130129
    131       qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
    132130      qualityTrailAnalyzer = new QualityTrailMultiAnalyzer();
    133       ParameterizeAnalyzers();
    134       UpdateAnalyzers();
    135 
    136       Initialize();
    137     }
    138 
    139     public override IDeepCloneable Clone(Cloner cloner) {
    140       return new LocalAnalysis(this, cloner);
     131      qualityTrailAnalyzer.UpdateIntervalParameter.Value = null;
     132      qualityTrailAnalyzer.UpdateIntervalParameter.ActualName = "MaximumIterations";
     133      AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer, true);
     134
     135      RegisterEventHandlers();
    141136    }
    142137
    143138    public override void Prepare() {
    144       if (Problem != null)
    145         base.Prepare();
     139      if (Problem != null) base.Prepare();
    146140    }
    147141
    148142    #region Events
    149143    protected override void OnProblemChanged() {
    150       ParameterizeStochasticOperator(Problem.SolutionCreator);
    151       ParameterizeStochasticOperator(Problem.Evaluator);
    152       foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
    153       ParameterizeSolutionsCreator();
    154       ParameterizeMainLoop();
     144      base.OnProblemChanged();
    155145      UpdateMutators();
    156       UpdateSelectors();
    157       UpdateAnalyzers();
    158       ParameterizeSelector();
    159       ParameterizeAnalyzers();
    160       ParameterizeIterationBasedOperators();
    161       Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    162       base.OnProblemChanged();
     146      Parameterize();
     147      Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
    163148    }
    164149    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
    165       ParameterizeStochasticOperator(Problem.SolutionCreator);
    166       ParameterizeSolutionsCreator();
    167150      base.Problem_SolutionCreatorChanged(sender, e);
     151      Parameterize();
    168152    }
    169153    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
    170       ParameterizeStochasticOperator(Problem.Evaluator);
    171       ParameterizeSolutionsCreator();
    172       ParameterizeMainLoop();
    173       ParameterizeSelector();
    174       ParameterizeAnalyzers();
    175       Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    176154      base.Problem_EvaluatorChanged(sender, e);
     155      Parameterize();
     156      Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
    177157    }
    178158    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    179       foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op);
    180159      UpdateMutators();
    181       UpdateSelectors();
    182       UpdateAnalyzers();
    183       ParameterizeMainLoop();
    184       ParameterizeSelector();
    185       ParameterizeAnalyzers();
    186       ParameterizeIterationBasedOperators();
     160      Parameterize();
    187161      base.Problem_OperatorsChanged(sender, e);
    188162    }
    189163    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
    190       ParameterizeMainLoop();
    191       ParameterizeSelector();
    192     }
    193     private void MutatorParameter_ValueChanged(object sender, EventArgs e) {
    194       ParameterizeMainLoop();
    195       ParameterizeSelector();
    196       ParameterizeAnalyzers();
     164      Parameterize();
    197165    }
    198166    #endregion
    199167
    200168    #region Helpers
    201     [StorableHook(HookType.AfterDeserialization)]
    202     private void Initialize() {
     169    private void RegisterEventHandlers() {
    203170      if (Problem != null) {
    204         Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
    205       }
    206       MutatorParameter.ValueChanged += MutatorParameter_ValueChanged;
    207     }
    208     private void UpdateSelectors() {
    209       SelectorParameter.ValidValues.Clear();
    210       foreach (var s in ApplicationManager.Manager.GetInstances<ISelector>())
    211         SelectorParameter.ValidValues.Add(s);
    212     }
     171        Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
     172      }
     173    }
     174
    213175    private void UpdateMutators() {
     176      var selected = MutatorParameter.Value;
    214177      MutatorParameter.ValidValues.Clear();
    215178      foreach (var m in Problem.Operators.OfType<IManipulator>()) {
    216179        MutatorParameter.ValidValues.Add(m);
    217       }
    218     }
    219     private void UpdateAnalyzers() {
    220       AnalyzerParameter.Value.Operators.Clear();
    221       if (Problem != null) {
    222         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
    223           foreach (IScopeTreeLookupParameter param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
    224             param.Depth = 0;
    225           AnalyzerParameter.Value.Operators.Add(analyzer);
    226         }
    227       }
    228       AnalyzerParameter.Value.Operators.Add(qualityAnalyzer);
    229       AnalyzerParameter.Value.Operators.Add(qualityTrailAnalyzer);
    230     }
    231     private void ParameterizeSolutionsCreator() {
    232       SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
    233       SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
    234     }
    235     private void ParameterizeMainLoop() {
     180        if (selected != null && selected.GetType() == m.GetType()) MutatorParameter.Value = m;
     181      }
     182    }
     183
     184    protected virtual void Parameterize() {
     185      if (Problem == null) return;
     186
    236187      MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    237188      MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    238189      MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    239     }
    240     private void ParameterizeStochasticOperator(IOperator op) {
    241       if (op is IStochasticOperator)
    242         ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
    243     }
    244     private void ParameterizeSelector() {
    245       if (Problem != null) {
    246         foreach (var op in SelectorParameter.ValidValues) {
    247           op.NumberOfSelectedSubScopesParameter.Value = new IntValue(1);
    248           op.CopySelected = new BoolValue(false);
    249           ISingleObjectiveSelector sos = op as ISingleObjectiveSelector;
    250           if (sos != null) {
    251             sos.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    252             sos.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    253           }
    254           IStochasticOperator so = op as IStochasticOperator;
    255           if (so != null) {
    256             so.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
    257           }
    258         }
    259       }
    260     }
    261     private void ParameterizeAnalyzers() {
    262       qualityAnalyzer.ResultsParameter.ActualName = "Results";
    263       if (Problem != null) {
    264         qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    265         qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
    266       }
    267     }
    268     private void ParameterizeIterationBasedOperators() {
    269       if (Problem != null) {
    270         foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) {
    271           op.IterationsParameter.ActualName = "Iterations";
    272           op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     190      foreach (var sOp in Problem.Operators.OfType<IStochasticOperator>()) {
     191        sOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     192      }
     193      foreach (var iOp in Problem.Operators.OfType<IIterationBasedOperator>()) {
     194        iOp.IterationsParameter.ActualName = "Iterations";
     195        iOp.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     196      }
     197      var sEval = Problem.Evaluator as IStochasticOperator;
     198      if (sEval != null) sEval.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     199      var sCrea = Problem.SolutionCreator as IStochasticOperator;
     200      if (sCrea != null) sCrea.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     201      var sSel = SelectorParameter.Value as IStochasticOperator;
     202      if (sSel != null) sSel.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName;
     203      var sel = SelectorParameter.Value as ISelector;
     204      if (sel != null) {
     205        sel.NumberOfSelectedSubScopesParameter.Value = new IntValue(1);
     206        sel.CopySelected = new BoolValue(false);
     207        var sos = sel as ISingleObjectiveSelector;
     208        if (sos != null) {
     209          sos.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
     210          sos.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    273211        }
    274212      }
  • branches/PerformanceComparison/HeuristicLab.Analysis.FitnessLandscape/3.3/Algorithms/LocalAnalysisMainLoop.cs

    r7128 r13583  
    101101      #region Create operators
    102102      VariableCreator variableCreator = new VariableCreator();
    103       SubScopesProcessor subScopesProcessor0 = new SubScopesProcessor();
    104       Assigner bestQualityInitializer = new Assigner();
    105103      Placeholder analyzer1 = new Placeholder();
    106       ResultsCollector resultsCollector1 = new ResultsCollector();
     104      SubScopesCounter evaluatedSolutionsCounter1 = new SubScopesCounter();
    107105      LeftSelector leftSelector = new LeftSelector();
    108106      SubScopesProcessor mainProcessor = new SubScopesProcessor();
     
    110108      Placeholder mutator = new Placeholder();
    111109      Placeholder evaluator = new Placeholder();
    112       IntCounter evaluatedMovesCounter = new IntCounter();
     110      SubScopesCounter evaluatedSolutionsCounter2 = new SubScopesCounter();
    113111      Placeholder selector = new Placeholder();
    114       SubScopesProcessor moveMakingProcessor = new SubScopesProcessor();
    115       UniformSubScopesProcessor selectedMoveMakingProcessor = new UniformSubScopesProcessor();
    116       QualityComparator qualityComparator = new QualityComparator();
    117       ConditionalBranch improvesQualityBranch = new ConditionalBranch();
    118       Assigner bestQualityUpdater = new Assigner();
     112      RightReducer rightReducer1 = new RightReducer();
     113      RightReducer rightReducer2 = new RightReducer();
    119114      Placeholder analyzer2 = new Placeholder();
    120       RightReducer rightReducer = new RightReducer();
    121       RightReducer rightReducer2 = new RightReducer();
    122115      IntCounter iterationsCounter = new IntCounter();
    123116      Comparator iterationsComparator = new Comparator();
     
    126119
    127120      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
    128       variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));
    129       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedMoves", new IntValue(0)));
    130 
    131       bestQualityInitializer.Name = "Initialize BestQuality";
    132       bestQualityInitializer.LeftSideParameter.ActualName = "BestQuality";
    133       bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.ActualName;
     121      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
    134122
    135123      analyzer1.Name = "Analyzer (placeholder)";
    136124      analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;
    137125
    138       resultsCollector1.CopyValue = new BoolValue(false);
    139       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
    140       resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    141       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
    142       resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
     126      evaluatedSolutionsCounter1.Name = "EvaluatedSolutions++";
     127      evaluatedSolutionsCounter1.AccumulateParameter.Value = new BoolValue(true);
     128      evaluatedSolutionsCounter1.ValueParameter.ActualName = "EvaluatedSolutions";
    143129
    144130      leftSelector.CopySelected = new BoolValue(true);
    145131      leftSelector.NumberOfSelectedSubScopesParameter.ActualName = SampleSizeParameter.Name;
    146132
    147       mutationProcessor.Parallel = new BoolValue(true);
     133      mainProcessor.Name = "Main Processsor";
     134
     135      mutationProcessor.Parallel = new BoolValue(false);
    148136
    149137      mutator.Name = "(Mutator)";
     
    153141      evaluator.OperatorParameter.ActualName = "Evaluator";
    154142
    155       evaluatedMovesCounter.Name = "EvaluatedMoves++";
    156       evaluatedMovesCounter.ValueParameter.ActualName = "EvaluatedMoves";
    157       evaluatedMovesCounter.Increment = new IntValue(1);
     143      evaluatedSolutionsCounter2.Name = "EvaluatedSolutions++";
     144      evaluatedSolutionsCounter2.AccumulateParameter.Value = new BoolValue(true);
     145      evaluatedSolutionsCounter2.ValueParameter.ActualName = "EvaluatedSolutions";
    158146
    159       selector.Name = "Selector (placeholder)";
     147      selector.Name = "(Selector)";
    160148      selector.OperatorParameter.ActualName = SelectorParameter.Name;
    161149
    162       qualityComparator.LeftSideParameter.ActualName = QualityParameter.Name;
    163       qualityComparator.RightSideParameter.ActualName = "BestQuality";
    164       qualityComparator.ResultParameter.ActualName = "IsBetter";
    165 
    166       improvesQualityBranch.ConditionParameter.ActualName = "IsBetter";
    167 
    168       bestQualityUpdater.Name = "Update BestQuality";
    169       bestQualityUpdater.LeftSideParameter.ActualName = "BestQuality";
    170       bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name;
    171 
    172       analyzer2.Name = "Analyzer (placeholder)";
     150      analyzer2.Name = "(Analyzer)";
    173151      analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
    174152
     
    183161      iterationsComparator.ResultParameter.ActualName = "Terminate";
    184162
    185       resultsCollector2.CopyValue = new BoolValue(false);
    186       resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Moves", null, "EvaluatedMoves"));
     163      resultsCollector2.CopyValue = new BoolValue(true);
     164      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
     165      resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));
    187166      resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    188167
     
    193172      #region Create operator graph
    194173      OperatorGraph.InitialOperator = variableCreator;
    195       variableCreator.Successor = subScopesProcessor0;
    196       subScopesProcessor0.Operators.Add(bestQualityInitializer);
    197       subScopesProcessor0.Successor = resultsCollector1;
    198       bestQualityInitializer.Successor = analyzer1;
    199       analyzer1.Successor = null;
    200       resultsCollector1.Successor = leftSelector;
     174      variableCreator.Successor = evaluatedSolutionsCounter1;
     175      evaluatedSolutionsCounter1.Successor = analyzer1;
     176      analyzer1.Successor = leftSelector;
    201177      leftSelector.Successor = mainProcessor;
    202178      mainProcessor.Operators.Add(new EmptyOperator());
     
    204180      mainProcessor.Successor = rightReducer2;
    205181      mutationProcessor.Operator = mutator;
    206       mutationProcessor.Successor = selector;
     182      mutationProcessor.Successor = evaluatedSolutionsCounter2;
    207183      mutator.Successor = evaluator;
    208       evaluator.Successor = evaluatedMovesCounter;
    209       evaluatedMovesCounter.Successor = null;
    210       selector.Successor = moveMakingProcessor;
    211       moveMakingProcessor.Operators.Add(new EmptyOperator());
    212       moveMakingProcessor.Operators.Add(selectedMoveMakingProcessor);
    213       moveMakingProcessor.Successor = rightReducer;
    214       selectedMoveMakingProcessor.Operator = qualityComparator;
    215       selectedMoveMakingProcessor.Successor = null;
    216       qualityComparator.Successor = improvesQualityBranch;
    217       improvesQualityBranch.TrueBranch = bestQualityUpdater;
    218       improvesQualityBranch.FalseBranch = null;
    219       improvesQualityBranch.Successor = analyzer2;
    220       bestQualityUpdater.Successor = null;
    221       analyzer2.Successor = null;
    222       rightReducer.Successor = null;
     184      evaluator.Successor = null;
     185      evaluatedSolutionsCounter2.Successor = selector;
     186      selector.Successor = rightReducer1;
     187      rightReducer1.Successor = null;
    223188      rightReducer2.Successor = iterationsCounter;
    224       iterationsCounter.Successor = iterationsComparator;
    225       iterationsComparator.Successor = resultsCollector2;
    226       resultsCollector2.Successor = iterationsTermination;
    227       iterationsTermination.TrueBranch = null;
     189      iterationsCounter.Successor = analyzer2;
     190      analyzer2.Successor = iterationsComparator;
     191      iterationsComparator.Successor = iterationsTermination;
     192      iterationsTermination.TrueBranch = resultsCollector2;
    228193      iterationsTermination.FalseBranch = leftSelector;
    229194      #endregion
    230195    }
    231 
    232     public override IOperation Apply() {
    233       return base.Apply();
    234     }
    235196  }
    236197}
Note: See TracChangeset for help on using the changeset viewer.