Changeset 3611


Ignore:
Timestamp:
05/04/10 20:09:14 (11 years ago)
Author:
abeham
Message:

Changed Island OSGA #976

  • removed mainloop
  • added mainoperator
Location:
trunk/sources
Files:
1 added
4 edited

Legend:

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

    r3609 r3611  
    171171      QualityDifferenceCalculator islandQualityDifferenceCalculator2 = new QualityDifferenceCalculator();
    172172      Placeholder islandVisualizer2 = new Placeholder();
    173       // END GA mainloop
     173      IntCounter generationsCounter = new IntCounter();
    174174      IntCounter generationsSinceLastMigrationCounter = new IntCounter();
    175175      Comparator migrationComparator = new Comparator();
     
    182182      UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor();
    183183      Placeholder immigrationReplacer = new Placeholder();
    184       IntCounter generationsCounter = new IntCounter();
    185184      Comparator generationsComparator = new Comparator();
    186185      BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer();
     
    272271      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
    273272
    274       // START GA mainloop
    275273      selector.Name = "Selector (placeholder)";
    276274      selector.OperatorParameter.ActualName = SelectorParameter.Name;
     
    321319      islandVisualizer2.Name = "Visualizer";
    322320      islandVisualizer2.OperatorParameter.ActualName = "Visualizer";
    323       // END GA mainloop
    324 
     321
     322      generationsCounter.Name = "Generations + 1";
     323      generationsCounter.Increment = new IntValue(1);
     324      generationsCounter.ValueParameter.ActualName = "Generations";
     325
     326      generationsSinceLastMigrationCounter.Name = "GenerationsSinceLastMigration + 1";
    325327      generationsSinceLastMigrationCounter.ValueParameter.ActualName = "GenerationsSinceLastMigration";
    326328      generationsSinceLastMigrationCounter.Increment = new IntValue(1);
    327329
     330      migrationComparator.Name = "GenerationsSinceLastMigration = MigrationInterval ?";
    328331      migrationComparator.LeftSideParameter.ActualName = "GenerationsSinceLastMigration";
    329332      migrationComparator.Comparison = new Comparison(ComparisonType.Equal);
     
    331334      migrationComparator.ResultParameter.ActualName = "Migrate";
    332335
     336      migrationBranch.Name = "Migrate?";
    333337      migrationBranch.ConditionParameter.ActualName = "Migrate";
    334338
    335       resetGenerationsSinceLastMigrationAssigner.Name = "Reset Counter";
     339      resetGenerationsSinceLastMigrationAssigner.Name = "Reset GenerationsSinceLastMigration";
    336340      resetGenerationsSinceLastMigrationAssigner.LeftSideParameter.ActualName = "GenerationsSinceLastMigration";
    337341      resetGenerationsSinceLastMigrationAssigner.RightSideParameter.Value = new IntValue(0);
     
    350354      immigrationReplacer.OperatorParameter.ActualName = ImmigrationReplacerParameter.Name;
    351355
    352       generationsCounter.Name = "Generations + 1";
    353       generationsCounter.Increment = new IntValue(1);
    354       generationsCounter.ValueParameter.ActualName = "Generations";
    355 
     356      generationsComparator.Name = "Generations >= MaximumGenerations ?";
    356357      generationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    357358      generationsComparator.LeftSideParameter.ActualName = "Generations";
     
    385386      qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
    386387
     388      generationsTerminationCondition.Name = "Terminate?";
    387389      generationsTerminationCondition.ConditionParameter.ActualName = "TerminateGenerations";
    388390      #endregion
     
    406408      resultsCollector.Successor = uniformSubScopesProcessor1;
    407409      uniformSubScopesProcessor1.Operator = selector;
    408       uniformSubScopesProcessor1.Successor = generationsSinceLastMigrationCounter;
     410      uniformSubScopesProcessor1.Successor = generationsCounter;
    409411      selector.Successor = subScopesProcessor1;
    410412      subScopesProcessor1.Operators.Add(new EmptyOperator());
     
    432434      islandQualityDifferenceCalculator2.Successor = islandVisualizer2;
    433435      islandVisualizer2.Successor = null;
     436      generationsCounter.Successor = generationsSinceLastMigrationCounter;
    434437      generationsSinceLastMigrationCounter.Successor = migrationComparator;
    435438      migrationComparator.Successor = migrationBranch;
    436439      migrationBranch.TrueBranch = resetGenerationsSinceLastMigrationAssigner;
    437440      migrationBranch.FalseBranch = null;
    438       migrationBranch.Successor = generationsCounter;
     441      migrationBranch.Successor = generationsComparator;
    439442      resetGenerationsSinceLastMigrationAssigner.Successor = migrationsCounter;
    440443      migrationsCounter.Successor = uniformSubScopesProcessor3;
     
    444447      uniformSubScopesProcessor4.Operator = immigrationReplacer;
    445448      uniformSubScopesProcessor4.Successor = null;
    446       generationsCounter.Successor = generationsComparator;
    447449      generationsComparator.Successor = bestQualityMemorizer3;
    448450      bestQualityMemorizer3.Successor = bestQualityMemorizer4;
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj

    r3479 r3611  
    8080  </ItemGroup>
    8181  <ItemGroup>
     82    <Compile Include="OffspringSelectionGeneticAlgorithmMainLoop.cs" />
    8283    <Compile Include="SASEGASA.cs" />
    8384    <Compile Include="SASEGASAMainLoop.cs" />
     
    8687    <Compile Include="IslandOffspringSelectionGeneticAlgorithmMainLoop.cs" />
    8788    <Compile Include="OffspringSelectionGeneticAlgorithm.cs" />
    88     <Compile Include="OffspringSelectionGeneticAlgorithmMainLoop.cs" />
     89    <Compile Include="OffspringSelectionGeneticAlgorithmMainOperator.cs" />
    8990    <Compile Include="Properties\AssemblyInfo.cs" />
    9091  </ItemGroup>
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r3479 r3611  
    7676      get { return (ConstrainedValueParameter<ISelector>)Parameters["EmigrantsSelector"]; }
    7777    }
    78     private ConstrainedValueParameter<ISelector> ImmigrationSelectorParameter {
    79       get { return (ConstrainedValueParameter<ISelector>)Parameters["ImmigrationSelector"]; }
     78    private ConstrainedValueParameter<IReplacer> ImmigrationReplacerParameter {
     79      get { return (ConstrainedValueParameter<IReplacer>)Parameters["ImmigrationReplacer"]; }
    8080    }
    8181    private ValueParameter<IntValue> PopulationSizeParameter {
    8282      get { return (ValueParameter<IntValue>)Parameters["PopulationSize"]; }
    8383    }
    84     private ValueParameter<IntValue> MaximumMigrationsParameter {
    85       get { return (ValueParameter<IntValue>)Parameters["MaximumMigrations"]; }
     84    private ValueParameter<IntValue> MaximumGenerationsParameter {
     85      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
    8686    }
    8787    private ConstrainedValueParameter<ISelector> SelectorParameter {
     
    152152      set { EmigrantsSelectorParameter.Value = value; }
    153153    }
    154     public ISelector ImmigrationSelector {
    155       get { return ImmigrationSelectorParameter.Value; }
    156       set { ImmigrationSelectorParameter.Value = value; }
     154    public IReplacer ImmigrationReplacer {
     155      get { return ImmigrationReplacerParameter.Value; }
     156      set { ImmigrationReplacerParameter.Value = value; }
    157157    }
    158158    public IntValue PopulationSize {
     
    160160      set { PopulationSizeParameter.Value = value; }
    161161    }
    162     public IntValue MaximumMigrations {
    163       get { return MaximumMigrationsParameter.Value; }
    164       set { MaximumMigrationsParameter.Value = value; }
     162    public IntValue MaximumGenerations {
     163      get { return MaximumGenerationsParameter.Value; }
     164      set { MaximumGenerationsParameter.Value = value; }
    165165    }
    166166    public ISelector Selector {
     
    218218    private List<IDiscreteDoubleValueModifier> comparisonFactorModifiers;
    219219    private List<ISelector> emigrantsSelectors;
    220     private List<ISelector> immigrationSelectors;
     220    private List<IReplacer> immigrationReplacers;
    221221    private List<IMigrator> migrators;
    222222    private RandomCreator RandomCreator {
     
    245245      Parameters.Add(new ConstrainedValueParameter<IMigrator>("Migrator", "The migration strategy."));
    246246      Parameters.Add(new ConstrainedValueParameter<ISelector>("EmigrantsSelector", "Selects the individuals that will be migrated."));
    247       Parameters.Add(new ConstrainedValueParameter<ISelector>("ImmigrationSelector", "Selects the population from the unification of the original population and the immigrants."));
     247      Parameters.Add(new ConstrainedValueParameter<IReplacer>("ImmigrationReplacer", "Selects the population from the unification of the original population and the immigrants."));
    248248      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions of each island.", new IntValue(100)));
    249       Parameters.Add(new ValueParameter<IntValue>("MaximumMigrations", "The maximum number of migrations that should occur.", new IntValue(100)));
     249      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations that should be processed.", new IntValue(100)));
    250250      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
    251251      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
     
    287287
    288288      mainLoop.EmigrantsSelectorParameter.ActualName = EmigrantsSelectorParameter.Name;
    289       mainLoop.ImmigrationSelectorParameter.ActualName = ImmigrationSelectorParameter.Name;
    290       mainLoop.MaximumMigrationsParameter.ActualName = MaximumMigrationsParameter.Name;
     289      mainLoop.ImmigrationReplacerParameter.ActualName = ImmigrationReplacerParameter.Name;
     290      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
    291291      mainLoop.MigrationIntervalParameter.ActualName = MigrationIntervalParameter.Name;
    292292      mainLoop.MigrationRateParameter.ActualName = MigrationRateParameter.Name;
     
    301301      mainLoop.ResultsParameter.ActualName = "Results";
    302302      mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     303      mainLoop.ComparisonFactorParameter.ActualName = "ComparisonFactor";
    303304      mainLoop.ComparisonFactorLowerBoundParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;
    304305      mainLoop.ComparisonFactorModifierParameter.ActualName = ComparisonFactorModifierParameter.Name;
     
    392393    }
    393394    private void MaximumMigrationsParameter_ValueChanged(object sender, EventArgs e) {
    394       MaximumMigrations.ValueChanged += new EventHandler(MaximumMigrations_ValueChanged);
     395      MaximumGenerations.ValueChanged += new EventHandler(MaximumMigrations_ValueChanged);
    395396      ParameterizeComparisonFactorModifiers();
    396397    }
     
    424425      MigrationIntervalParameter.ValueChanged += new EventHandler(MigrationIntervalParameter_ValueChanged);
    425426      MigrationInterval.ValueChanged += new EventHandler(MigrationInterval_ValueChanged);
    426       MaximumMigrationsParameter.ValueChanged += new EventHandler(MaximumMigrationsParameter_ValueChanged);
    427       MaximumMigrations.ValueChanged += new EventHandler(MaximumMigrations_ValueChanged);
     427      MaximumGenerationsParameter.ValueChanged += new EventHandler(MaximumMigrationsParameter_ValueChanged);
     428      MaximumGenerations.ValueChanged += new EventHandler(MaximumMigrations_ValueChanged);
    428429      if (Problem != null) {
    429430        UpdateCrossovers();
     
    455456      emigrantsSelectors = new List<ISelector>();
    456457      emigrantsSelectors.AddRange(ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name));
    457       immigrationSelectors = new List<ISelector>();
    458       immigrationSelectors.AddRange(ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name));
     458      immigrationReplacers = new List<IReplacer>();
     459      immigrationReplacers.AddRange(ApplicationManager.Manager.GetInstances<IReplacer>().OrderBy(x => x.Name));
    459460      ParameterizeSelectors();
    460461    }
     
    480481        ParameterizeStochasticOperator(selector);
    481482      }
    482       foreach (ISelector selector in immigrationSelectors) {
    483         selector.CopySelected = new BoolValue(false);
    484         selector.NumberOfSelectedSubScopesParameter.Value = PopulationSize;
     483      foreach (IReplacer selector in immigrationReplacers) {
    485484        ParameterizeStochasticOperator(selector);
    486485      }
     
    494493          selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    495494        }
    496         foreach (ISingleObjectiveSelector selector in immigrationSelectors.OfType<ISingleObjectiveSelector>()) {
    497           selector.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    498           selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     495        foreach (ISingleObjectiveReplacer replacer in immigrationReplacers.OfType<ISingleObjectiveReplacer>()) {
     496          replacer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
     497          replacer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    499498        }
    500499      }
     
    503502      foreach (IDiscreteDoubleValueModifier modifier in comparisonFactorModifiers) {
    504503        modifier.IndexParameter.ActualName = "Generations";
    505         modifier.EndIndexParameter.Value = new IntValue(MigrationInterval.Value * MaximumMigrations.Value);
     504        modifier.EndIndexParameter.Value = new IntValue(MigrationInterval.Value * MaximumGenerations.Value);
    506505        modifier.EndValueParameter.ActualName = ComparisonFactorUpperBoundParameter.Name;
    507506        modifier.StartIndexParameter.Value = new IntValue(0);
     
    533532      }
    534533
    535       oldSelector = ImmigrationSelectorParameter.Value;
    536       ImmigrationSelectorParameter.ValidValues.Clear();
    537       foreach (ISelector selector in immigrationSelectors)
    538         ImmigrationSelectorParameter.ValidValues.Add(selector);
     534      IReplacer oldReplacer = ImmigrationReplacerParameter.Value;
     535      ImmigrationReplacerParameter.ValidValues.Clear();
     536      foreach (IReplacer replacer in immigrationReplacers)
     537        ImmigrationReplacerParameter.ValidValues.Add(replacer);
    539538      if (oldSelector != null) {
    540         ISelector selector = ImmigrationSelectorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldSelector.GetType());
    541         if (selector != null) ImmigrationSelectorParameter.Value = selector;
     539        IReplacer replacer = ImmigrationReplacerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldSelector.GetType());
     540        if (replacer != null) ImmigrationReplacerParameter.Value = replacer;
    542541      }
    543542    }
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r3479 r3611  
    7070      get { return (ValueLookupParameter<IOperator>)Parameters["EmigrantsSelector"]; }
    7171    }
    72     public ValueLookupParameter<IOperator> ImmigrationSelectorParameter {
    73       get { return (ValueLookupParameter<IOperator>)Parameters["ImmigrationSelector"]; }
     72    public ValueLookupParameter<IOperator> ImmigrationReplacerParameter {
     73      get { return (ValueLookupParameter<IOperator>)Parameters["ImmigrationReplacer"]; }
    7474    }
    7575    public ValueLookupParameter<IntValue> PopulationSizeParameter {
    7676      get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }
    7777    }
    78     public ValueLookupParameter<IntValue> MaximumMigrationsParameter {
    79       get { return (ValueLookupParameter<IntValue>)Parameters["MaximumMigrations"]; }
     78    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
     79      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
    8080    }
    8181    public ValueLookupParameter<IOperator> SelectorParameter {
     
    108108    public ValueLookupParameter<DoubleValue> SuccessRatioParameter {
    109109      get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
     110    }
     111    public LookupParameter<DoubleValue> ComparisonFactorParameter {
     112      get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
    110113    }
    111114    public ValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter {
     
    140143      Parameters.Add(new ValueLookupParameter<IOperator>("Migrator", "The migration strategy."));
    141144      Parameters.Add(new ValueLookupParameter<IOperator>("EmigrantsSelector", "Selects the individuals that will be migrated."));
    142       Parameters.Add(new ValueLookupParameter<IOperator>("ImmigrationSelector", "Selects the population from the unification of the original population and the immigrants."));
     145      Parameters.Add(new ValueLookupParameter<IOperator>("ImmigrationReplacer", "Replaces part of the original population with the immigrants."));
    143146      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions."));
    144       Parameters.Add(new ValueLookupParameter<IntValue>("MaximumMigrations", "The maximum number of migrations after which the operator should terminate."));
     147      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations that should be processed."));
    145148      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
    146149      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
     
    153156      Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));
    154157      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved."));
     158      Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1]."));
    155159      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start)."));
    156160      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end)."));
     
    162166      #region Create operators
    163167      VariableCreator variableCreator = new VariableCreator();
    164       UniformSubScopesProcessor ussp0 = new UniformSubScopesProcessor();
     168      UniformSubScopesProcessor uniformSubScopesProcessor0 = new UniformSubScopesProcessor();
    165169      VariableCreator islandVariableCreator = new VariableCreator();
    166       Assigner islandVariableAssigner = new Assigner();
     170      BestQualityMemorizer islandBestQualityMemorizer1 = new BestQualityMemorizer();
     171      BestAverageWorstQualityCalculator islandBestAverageWorstQualityCalculator1 = new BestAverageWorstQualityCalculator();
     172      DataTableValuesCollector islandDataTableValuesCollector1 = new DataTableValuesCollector();
     173      DataTableValuesCollector islandDataTableValuesCollector2 = new DataTableValuesCollector();
     174      QualityDifferenceCalculator islandQualityDifferenceCalculator1 = new QualityDifferenceCalculator();
     175      Placeholder islandVisualizer1 = new Placeholder();
     176      ResultsCollector islandResultsCollector = new ResultsCollector();
    167177      BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer();
     178      BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer();
    168179      BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator1 = new BestAverageWorstQualityCalculator();
    169       BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer();
    170       BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator();
    171180      DataTableValuesCollector dataTableValuesCollector1 = new DataTableValuesCollector();
     181      DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector();
    172182      QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator();
    173183      ResultsCollector resultsCollector = new ResultsCollector();
    174       UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor();
    175       OffspringSelectionGeneticAlgorithmMainLoop mainLoop = new OffspringSelectionGeneticAlgorithmMainLoop();
     184      Placeholder comparisonFactorModifier = new Placeholder();
     185      UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor();
     186      ConditionalBranch islandTerminatedBySelectionPressure1 = new ConditionalBranch();
     187      OffspringSelectionGeneticAlgorithmMainOperator mainOperator = new OffspringSelectionGeneticAlgorithmMainOperator();
     188      BestQualityMemorizer islandBestQualityMemorizer2 = new BestQualityMemorizer();
     189      BestAverageWorstQualityCalculator islandBestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator();
     190      DataTableValuesCollector islandDataTableValuesCollector3 = new DataTableValuesCollector();
     191      DataTableValuesCollector islandDataTableValuesCollector4 = new DataTableValuesCollector();
     192      QualityDifferenceCalculator islandQualityDifferenceCalculator2 = new QualityDifferenceCalculator();
     193      Placeholder islandVisualizer2 = new Placeholder();
     194      IntCounter islandEvaluatedSolutionsCounter = new IntCounter();
     195      Comparator islandSelectionPressureComparator = new Comparator();
     196      ConditionalBranch islandTerminatedBySelectionPressure2 = new ConditionalBranch();
     197      IntCounter terminatedIslandsCounter = new IntCounter();
     198      IntCounter generationsCounter = new IntCounter();
     199      IntCounter generationsSinceLastMigrationCounter = new IntCounter();
     200      Comparator migrationComparator = new Comparator();
     201      ConditionalBranch migrationBranch = new ConditionalBranch();
     202      Assigner resetTerminatedIslandsAssigner = new Assigner();
     203      Assigner resetGenerationsSinceLastMigrationAssigner = new Assigner();
     204      IntCounter migrationsCounter = new IntCounter();
     205      UniformSubScopesProcessor uniformSubScopesProcessor2 = new UniformSubScopesProcessor();
     206      Assigner reviveIslandAssigner = new Assigner();
    176207      Placeholder emigrantsSelector = new Placeholder();
    177208      Placeholder migrator = new Placeholder();
    178       UniformSubScopesProcessor ussp2 = new UniformSubScopesProcessor();
    179       IntCounter maximumGenerationsCounter = new IntCounter();
    180       MergingReducer mergingReducer = new MergingReducer();
    181       Placeholder immigrationSelector = new Placeholder();
    182       RightReducer rightReducer = new RightReducer();
    183       IntCounter migrationsCounter = new IntCounter();
    184       Comparator maxMigrationsComparator = new Comparator();
     209      UniformSubScopesProcessor uniformSubScopesProcessor3 = new UniformSubScopesProcessor();
     210      Placeholder immigrationReplacer = new Placeholder();
     211      Comparator generationsComparator = new Comparator();
     212      Comparator terminatedIslandsComparator = new Comparator();
    185213      BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer();
    186       BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator3 = new BestAverageWorstQualityCalculator();
    187       DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector();
     214      BestQualityMemorizer bestQualityMemorizer4 = new BestQualityMemorizer();
     215      BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator();
     216      DataTableValuesCollector dataTableValuesCollector3 = new DataTableValuesCollector();
     217      DataTableValuesCollector dataTableValuesCollector4 = new DataTableValuesCollector();
    188218      QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator();
    189       ConditionalBranch migrationTerminationCondition = new ConditionalBranch();
     219      ConditionalBranch generationsTerminationCondition = new ConditionalBranch();
     220      ConditionalBranch terminatedIslandsCondition = new ConditionalBranch();
    190221
    191222      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Migrations", new IntValue(0)));
     223      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0)));
     224      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("GenerationsSinceLastMigration", new IntValue(0)));
     225      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("TerminatedIslands", new IntValue(0)));
     226      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0)));
     227
     228      islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("IslandResults", new ResultCollection()));
     229      islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("IslandEvaluatedSolutions", new IntValue(0)));
     230      islandVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false)));
     231      islandVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0)));
     232
     233      islandBestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality";
     234      islandBestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name;
     235      islandBestQualityMemorizer1.QualityParameter.ActualName = QualityParameter.Name;
     236
     237      islandBestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageQuality";
     238      islandBestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestQuality";
     239      islandBestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = MaximizationParameter.Name;
     240      islandBestAverageWorstQualityCalculator1.QualityParameter.ActualName = QualityParameter.Name;
     241      islandBestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstQuality";
    192242     
    193       islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("IslandResults", new ResultCollection()));
    194 
    195       islandVariableAssigner.LeftSideParameter.ActualName = "MaximumGenerations";
    196       islandVariableAssigner.RightSideParameter.ActualName = "MigrationInterval";
     243      islandDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality"));
     244      islandDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality"));
     245      islandDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality"));
     246      islandDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
     247      islandDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
     248      islandDataTableValuesCollector1.DataTableParameter.ActualName = "BestQualities";
     249
     250      islandDataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Selection Pressure", null, "SelectionPressure"));
     251      islandDataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, MaximumSelectionPressureParameter.Name));
     252      islandDataTableValuesCollector2.DataTableParameter.ActualName = "SelectionPressures";
     253
     254      islandQualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
     255      islandQualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
     256      islandQualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
     257      islandQualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality";
     258
     259      islandResultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     260      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality"));
     261      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality"));
     262      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality"));
     263      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
     264      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
     265      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest"));
     266      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
     267      islandResultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "IslandEvaluatedSolutions"));
     268      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Curent Comparison Factor", null, "ComparisonFactor"));
     269      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure"));
     270      islandResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio"));
     271      islandResultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, VisualizationParameter.Name));
     272      islandResultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
     273      islandResultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("SelectionPressures"));
     274      islandResultsCollector.ResultsParameter.ActualName = "IslandResults";
    197275
    198276      bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality";
    199277      bestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name;
    200       bestQualityMemorizer1.QualityParameter.ActualName = QualityParameter.Name;
    201 
    202       bestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageQuality";
    203       bestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestQuality";
    204       bestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = MaximizationParameter.Name;
    205       bestAverageWorstQualityCalculator1.QualityParameter.ActualName = QualityParameter.Name;
    206       bestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstQuality";
    207 
    208       bestQualityMemorizer2.BestQualityParameter.ActualName = "BestQuality";
     278      bestQualityMemorizer1.QualityParameter.ActualName = "BestQuality";
     279
     280      bestQualityMemorizer2.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
    209281      bestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name;
    210282      bestQualityMemorizer2.QualityParameter.ActualName = "BestQuality";
    211283
    212       bestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageBestQuality";
    213       bestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestBestQuality";
    214       bestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = MaximizationParameter.Name;
    215       bestAverageWorstQualityCalculator2.QualityParameter.ActualName = "CurrentBestQuality";
    216       bestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstBestQuality";
     284      bestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageBestQuality";
     285      bestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestBestQuality";
     286      bestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = MaximizationParameter.Name;
     287      bestAverageWorstQualityCalculator1.QualityParameter.ActualName = "CurrentBestQuality";
     288      bestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstBestQuality";
    217289
    218290      dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality"));
     
    223295      dataTableValuesCollector1.DataTableParameter.ActualName = "BestQualities";
    224296
     297      dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, MaximumSelectionPressureParameter.Name));
     298      dataTableValuesCollector2.CollectedValues.Add(new SubScopesLookupParameter<DoubleValue>("Selection Pressure Island", null, "SelectionPressure"));
     299      dataTableValuesCollector2.DataTableParameter.ActualName = "SelectionPressures";
     300
    225301      qualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
    226302      qualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
     
    229305
    230306      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Migrations"));
     307      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations"));
     308      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions"));
    231309      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality"));
    232310      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality"));
     
    237315      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
    238316      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("BestQualities"));
     317      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("SelectionPressures"));
    239318      resultsCollector.CollectedValues.Add(new SubScopesLookupParameter<ResultCollection>("IslandResults", "Result set for each island"));
    240319      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
    241320
    242       mainLoop.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
    243       mainLoop.MaximizationParameter.ActualName = MaximizationParameter.Name;
    244       mainLoop.QualityParameter.ActualName = QualityParameter.Name;
    245       mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
    246       mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    247       mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
    248       mainLoop.MaximumGenerationsParameter.ActualName = "MaximumGenerations";
    249       mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
    250       mainLoop.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    251       mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
    252       mainLoop.RandomParameter.ActualName = RandomParameter.Name;
    253       mainLoop.ResultsParameter.ActualName = "IslandResults";
    254       mainLoop.VisualizerParameter.ActualName = VisualizerParameter.Name;
    255       mainLoop.VisualizationParameter.ActualName = VisualizationParameter.Name;
    256       mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    257       mainLoop.ComparisonFactorLowerBoundParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;
    258       mainLoop.ComparisonFactorModifierParameter.ActualName = ComparisonFactorModifierParameter.Name;
    259       mainLoop.ComparisonFactorUpperBoundParameter.ActualName = ComparisonFactorUpperBoundParameter.Name;
    260       mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
    261       mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
    262 
    263       maximumGenerationsCounter.ValueParameter.ActualName = "MaximumGenerations";
    264       maximumGenerationsCounter.Increment = null;
    265       maximumGenerationsCounter.IncrementParameter.ActualName = "MigrationInterval";
    266 
    267       emigrantsSelector.Name = "Emigrants Selector (placeholder)";
    268       emigrantsSelector.OperatorParameter.ActualName = EmigrantsSelectorParameter.Name;
    269 
    270       migrator.Name = "Migrator (placeholder)";
    271       migrator.OperatorParameter.ActualName = MigratorParameter.Name;
    272 
    273       immigrationSelector.Name = "Immigration Selector (placeholder)";
    274       immigrationSelector.OperatorParameter.ActualName = ImmigrationSelectorParameter.Name;
     321      comparisonFactorModifier.Name = "ComparisonFactorModifier (Placeholder)";
     322      comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name;
     323
     324      islandTerminatedBySelectionPressure1.Name = "Island Terminated ?";
     325      islandTerminatedBySelectionPressure1.ConditionParameter.ActualName = "TerminateSelectionPressure";
     326
     327      mainOperator.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name;
     328      mainOperator.CrossoverParameter.ActualName = CrossoverParameter.Name;
     329      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
     330      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
     331      mainOperator.EvaluatedSolutionsParameter.ActualName = "IslandEvaluatedSolutions";
     332      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
     333      mainOperator.MaximizationParameter.ActualName = MaximizationParameter.Name;
     334      mainOperator.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name;
     335      mainOperator.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
     336      mainOperator.MutatorParameter.ActualName = MutatorParameter.Name;
     337      mainOperator.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
     338      mainOperator.QualityParameter.ActualName = QualityParameter.Name;
     339      mainOperator.RandomParameter.ActualName = RandomParameter.Name;
     340      mainOperator.SelectionPressureParameter.ActualName = "SelectionPressure";
     341      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
     342      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     343
     344      islandBestQualityMemorizer2.BestQualityParameter.ActualName = "BestQuality";
     345      islandBestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name;
     346      islandBestQualityMemorizer2.QualityParameter.ActualName = QualityParameter.Name;
     347
     348      islandBestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageQuality";
     349      islandBestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestQuality";
     350      islandBestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = MaximizationParameter.Name;
     351      islandBestAverageWorstQualityCalculator2.QualityParameter.ActualName = QualityParameter.Name;
     352      islandBestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstQuality";
     353
     354      islandDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality"));
     355      islandDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality"));
     356      islandDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality"));
     357      islandDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
     358      islandDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
     359      islandDataTableValuesCollector3.DataTableParameter.ActualName = "BestQualities";
     360
     361      islandDataTableValuesCollector4.CollectedValues.Add(new LookupParameter<DoubleValue>("Selection Pressure", null, "SelectionPressure"));
     362      islandDataTableValuesCollector4.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, MaximumSelectionPressureParameter.Name));
     363      islandDataTableValuesCollector4.DataTableParameter.ActualName = "SelectionPressures";
     364
     365      islandQualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
     366      islandQualityDifferenceCalculator2.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
     367      islandQualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
     368      islandQualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
     369
     370      islandEvaluatedSolutionsCounter.Name = "Update EvaluatedSolutions";
     371      islandEvaluatedSolutionsCounter.ValueParameter.ActualName = "EvaluatedSolutions";
     372      islandEvaluatedSolutionsCounter.Increment = null;
     373      islandEvaluatedSolutionsCounter.IncrementParameter.ActualName = "IslandEvaluatedSolutions";
     374
     375      islandSelectionPressureComparator.Name = "SelectionPressure >= MaximumSelectionPressure ?";
     376      islandSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";
     377      islandSelectionPressureComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
     378      islandSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name;
     379      islandSelectionPressureComparator.ResultParameter.ActualName = "TerminateSelectionPressure";
     380
     381      islandTerminatedBySelectionPressure2.Name = "Island Terminated ?";
     382      islandTerminatedBySelectionPressure2.ConditionParameter.ActualName = "TerminateSelectionPressure";
     383
     384      terminatedIslandsCounter.Name = "TerminatedIslands + 1";
     385      terminatedIslandsCounter.ValueParameter.ActualName = "TerminatedIslands";
     386      terminatedIslandsCounter.Increment = new IntValue(1);
     387
     388      generationsCounter.Name = "Generations + 1";
     389      generationsCounter.ValueParameter.ActualName = "Generations";
     390      generationsCounter.Increment = new IntValue(1);
     391
     392      generationsSinceLastMigrationCounter.Name = "GenerationsSinceLastMigration + 1";
     393      generationsSinceLastMigrationCounter.ValueParameter.ActualName = "GenerationsSinceLastMigration";
     394      generationsSinceLastMigrationCounter.Increment = new IntValue(1);
     395
     396      migrationComparator.Name = "GenerationsSinceLastMigration = MigrationInterval ?";
     397      migrationComparator.LeftSideParameter.ActualName = "GenerationsSinceLastMigration";
     398      migrationComparator.Comparison = new Comparison(ComparisonType.Equal);
     399      migrationComparator.RightSideParameter.ActualName = MigrationIntervalParameter.Name;
     400      migrationComparator.ResultParameter.ActualName = "Migrate";
     401
     402      migrationBranch.Name = "Migrate?";
     403      migrationBranch.ConditionParameter.ActualName = "Migrate";
     404
     405      resetTerminatedIslandsAssigner.Name = "Reset TerminatedIslands";
     406      resetTerminatedIslandsAssigner.LeftSideParameter.ActualName = "TerminatedIslands";
     407      resetTerminatedIslandsAssigner.RightSideParameter.Value = new IntValue(0);
     408
     409      resetGenerationsSinceLastMigrationAssigner.Name = "Reset GenerationsSinceLastMigration";
     410      resetGenerationsSinceLastMigrationAssigner.LeftSideParameter.ActualName = "GenerationsSinceLastMigration";
     411      resetGenerationsSinceLastMigrationAssigner.RightSideParameter.Value = new IntValue(0);
    275412
    276413      migrationsCounter.Name = "Migrations + 1";
     
    278415      migrationsCounter.ValueParameter.ActualName = "Migrations";
    279416
    280       maxMigrationsComparator.Name = "Migrations >= MaximumMigration ?";
    281       maxMigrationsComparator.LeftSideParameter.ActualName = "Migrations";
    282       maxMigrationsComparator.RightSideParameter.ActualName = MaximumMigrationsParameter.Name;
    283       maxMigrationsComparator.Comparison.Value = ComparisonType.GreaterOrEqual;
    284       maxMigrationsComparator.ResultParameter.ActualName = "MigrationTerminate";
    285 
     417      reviveIslandAssigner.Name = "Revive Island";
     418      reviveIslandAssigner.LeftSideParameter.ActualName = "TerminateSelectionPressure";
     419      reviveIslandAssigner.RightSideParameter.Value = new BoolValue(false);
     420
     421      emigrantsSelector.Name = "Emigrants Selector (placeholder)";
     422      emigrantsSelector.OperatorParameter.ActualName = EmigrantsSelectorParameter.Name;
     423
     424      migrator.Name = "Migrator (placeholder)";
     425      migrator.OperatorParameter.ActualName = MigratorParameter.Name;
     426
     427      immigrationReplacer.Name = "Immigration Replacer (placeholder)";
     428      immigrationReplacer.OperatorParameter.ActualName = ImmigrationReplacerParameter.Name;
     429
     430      generationsComparator.Name = "Generations >= MaximumGenerations ?";
     431      generationsComparator.LeftSideParameter.ActualName = "Generations";
     432      generationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
     433      generationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
     434      generationsComparator.ResultParameter.ActualName = "TerminateGenerations";
     435
     436      terminatedIslandsComparator.Name = "All Islands terminated ?";
     437      terminatedIslandsComparator.LeftSideParameter.ActualName = "TerminatedIslands";
     438      terminatedIslandsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
     439      terminatedIslandsComparator.RightSideParameter.ActualName = NumberOfIslandsParameter.Name;
     440      terminatedIslandsComparator.ResultParameter.ActualName = "TerminateTerminatedIslands";
     441     
    286442      bestQualityMemorizer3.BestQualityParameter.ActualName = "BestQuality";
    287443      bestQualityMemorizer3.MaximizationParameter.ActualName = MaximizationParameter.Name;
    288444      bestQualityMemorizer3.QualityParameter.ActualName = "BestQuality";
    289445
    290       bestAverageWorstQualityCalculator3.AverageQualityParameter.ActualName = "CurrentAverageBestQuality";
    291       bestAverageWorstQualityCalculator3.BestQualityParameter.ActualName = "CurrentBestBestQuality";
    292       bestAverageWorstQualityCalculator3.MaximizationParameter.ActualName = MaximizationParameter.Name;
    293       bestAverageWorstQualityCalculator3.QualityParameter.ActualName = "CurrentBestQuality";
    294       bestAverageWorstQualityCalculator3.WorstQualityParameter.ActualName = "CurrentWorstBestQuality";
    295 
    296       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality"));
    297       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality"));
    298       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality"));
    299       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    300       dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
    301       dataTableValuesCollector2.DataTableParameter.ActualName = "BestQualities";
     446      bestQualityMemorizer4.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
     447      bestQualityMemorizer4.MaximizationParameter.ActualName = MaximizationParameter.Name;
     448      bestQualityMemorizer4.QualityParameter.ActualName = "BestQuality";
     449
     450      bestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageBestQuality";
     451      bestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestBestQuality";
     452      bestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = MaximizationParameter.Name;
     453      bestAverageWorstQualityCalculator2.QualityParameter.ActualName = "CurrentBestQuality";
     454      bestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstBestQuality";
     455
     456      dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality"));
     457      dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality"));
     458      dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality"));
     459      dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
     460      dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
     461      dataTableValuesCollector3.DataTableParameter.ActualName = "BestQualities";
     462
     463      dataTableValuesCollector4.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, MaximumSelectionPressureParameter.Name));
     464      dataTableValuesCollector4.CollectedValues.Add(new SubScopesLookupParameter<DoubleValue>("Selection Pressure Island", null, "SelectionPressure"));
     465      dataTableValuesCollector4.DataTableParameter.ActualName = "SelectionPressures";
    302466
    303467      qualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
     
    306470      qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
    307471
    308       migrationTerminationCondition.ConditionParameter.ActualName = "MigrationTerminate";
     472      generationsTerminationCondition.Name = "Terminate (MaxGenerations) ?";
     473      generationsTerminationCondition.ConditionParameter.ActualName = "TerminateGenerations";
     474
     475      terminatedIslandsCondition.Name = "Terminate (TerminatedIslands) ?";
     476      terminatedIslandsCondition.ConditionParameter.ActualName = "TerminateTerminatedIslands";
    309477      #endregion
    310478
    311479      #region Create operator graph
    312480      OperatorGraph.InitialOperator = variableCreator;
    313       variableCreator.Successor = ussp0;
    314       ussp0.Operator = islandVariableCreator;
    315       ussp0.Successor = bestQualityMemorizer2;
    316       islandVariableCreator.Successor = islandVariableAssigner;
    317       islandVariableAssigner.Successor = bestQualityMemorizer1;
    318       bestQualityMemorizer1.Successor = bestAverageWorstQualityCalculator1;
    319       bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator2;
    320       bestAverageWorstQualityCalculator2.Successor = dataTableValuesCollector1;
    321       dataTableValuesCollector1.Successor = qualityDifferenceCalculator1;
     481      variableCreator.Successor = uniformSubScopesProcessor0;
     482      uniformSubScopesProcessor0.Operator = islandVariableCreator;
     483      uniformSubScopesProcessor0.Successor = bestQualityMemorizer1;
     484      islandVariableCreator.Successor = islandBestQualityMemorizer1;
     485      islandBestQualityMemorizer1.Successor = islandBestAverageWorstQualityCalculator1;
     486      islandBestAverageWorstQualityCalculator1.Successor = islandDataTableValuesCollector1;
     487      islandDataTableValuesCollector1.Successor = islandDataTableValuesCollector2;
     488      islandDataTableValuesCollector2.Successor = islandQualityDifferenceCalculator1;
     489      islandQualityDifferenceCalculator1.Successor = islandVisualizer1;
     490      islandVisualizer1.Successor = islandResultsCollector;
     491      islandResultsCollector.Successor = null;
     492      bestQualityMemorizer1.Successor = bestQualityMemorizer2;
     493      bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator1;
     494      bestAverageWorstQualityCalculator1.Successor = dataTableValuesCollector1;
     495      dataTableValuesCollector1.Successor = dataTableValuesCollector2;
     496      dataTableValuesCollector2.Successor = qualityDifferenceCalculator1;
    322497      qualityDifferenceCalculator1.Successor = resultsCollector;
    323       resultsCollector.Successor = ussp1;
    324       ussp1.Operator = mainLoop;
    325       ussp1.Successor = migrator;
    326       mainLoop.Successor = maximumGenerationsCounter;
    327       maximumGenerationsCounter.Successor = emigrantsSelector;
     498      resultsCollector.Successor = comparisonFactorModifier;
     499      comparisonFactorModifier.Successor = uniformSubScopesProcessor1;
     500      uniformSubScopesProcessor1.Operator = islandTerminatedBySelectionPressure1;
     501      uniformSubScopesProcessor1.Successor = generationsCounter;
     502      islandTerminatedBySelectionPressure1.TrueBranch = null;
     503      islandTerminatedBySelectionPressure1.FalseBranch = mainOperator;
     504      islandTerminatedBySelectionPressure1.Successor = null;
     505      mainOperator.Successor = islandBestQualityMemorizer2;
     506      islandBestQualityMemorizer2.Successor = islandBestAverageWorstQualityCalculator2;
     507      islandBestAverageWorstQualityCalculator2.Successor = islandDataTableValuesCollector3;
     508      islandDataTableValuesCollector3.Successor = islandDataTableValuesCollector4;
     509      islandDataTableValuesCollector4.Successor = islandQualityDifferenceCalculator2;
     510      islandQualityDifferenceCalculator2.Successor = islandVisualizer2;
     511      islandVisualizer2.Successor = islandEvaluatedSolutionsCounter;
     512      islandEvaluatedSolutionsCounter.Successor = islandSelectionPressureComparator;
     513      islandSelectionPressureComparator.Successor = islandTerminatedBySelectionPressure2;
     514      islandTerminatedBySelectionPressure2.TrueBranch = terminatedIslandsCounter;
     515      islandTerminatedBySelectionPressure2.FalseBranch = null;
     516      islandTerminatedBySelectionPressure2.Successor = null;
     517      generationsCounter.Successor = generationsSinceLastMigrationCounter;
     518      generationsSinceLastMigrationCounter.Successor = migrationComparator;
     519      migrationComparator.Successor = migrationBranch;
     520      migrationBranch.TrueBranch = resetTerminatedIslandsAssigner;
     521      migrationBranch.FalseBranch = null;
     522      migrationBranch.Successor = generationsComparator;
     523      resetTerminatedIslandsAssigner.Successor = resetGenerationsSinceLastMigrationAssigner;
     524      resetGenerationsSinceLastMigrationAssigner.Successor = migrationsCounter;
     525      migrationsCounter.Successor = uniformSubScopesProcessor2;
     526      uniformSubScopesProcessor2.Operator = reviveIslandAssigner;
     527      uniformSubScopesProcessor2.Successor = migrator;
     528      reviveIslandAssigner.Successor = emigrantsSelector;
    328529      emigrantsSelector.Successor = null;
    329       migrator.Successor = ussp2;
    330       ussp2.Operator = mergingReducer;
    331       ussp2.Successor = migrationsCounter;
    332       mergingReducer.Successor = immigrationSelector;
    333       immigrationSelector.Successor = rightReducer;
    334       rightReducer.Successor = null;
    335       migrationsCounter.Successor = maxMigrationsComparator;
    336       maxMigrationsComparator.Successor = bestQualityMemorizer3;
    337       bestQualityMemorizer3.Successor = bestAverageWorstQualityCalculator3;
    338       bestAverageWorstQualityCalculator3.Successor = dataTableValuesCollector2;
    339       dataTableValuesCollector2.Successor = qualityDifferenceCalculator2;
    340       qualityDifferenceCalculator2.Successor = migrationTerminationCondition;
    341       migrationTerminationCondition.FalseBranch = ussp1;
    342       migrationTerminationCondition.TrueBranch = null;
    343       migrationTerminationCondition.Successor = null;
     530      migrator.Successor = uniformSubScopesProcessor3;
     531      uniformSubScopesProcessor3.Operator = immigrationReplacer;
     532      uniformSubScopesProcessor3.Successor = null;
     533      immigrationReplacer.Successor = null;
     534      generationsComparator.Successor = terminatedIslandsComparator;
     535      terminatedIslandsComparator.Successor = bestQualityMemorizer3;
     536      bestQualityMemorizer3.Successor = bestQualityMemorizer4;
     537      bestQualityMemorizer4.Successor = bestAverageWorstQualityCalculator2;
     538      bestAverageWorstQualityCalculator2.Successor = dataTableValuesCollector3;
     539      dataTableValuesCollector3.Successor = dataTableValuesCollector4;
     540      dataTableValuesCollector4.Successor = qualityDifferenceCalculator2;
     541      qualityDifferenceCalculator2.Successor = generationsTerminationCondition;
     542      generationsTerminationCondition.TrueBranch = null;
     543      generationsTerminationCondition.FalseBranch = terminatedIslandsCondition;
     544      generationsTerminationCondition.Successor = null;
     545      terminatedIslandsCondition.TrueBranch = null;
     546      terminatedIslandsCondition.FalseBranch = comparisonFactorModifier;
     547      terminatedIslandsCondition.Successor = null;
    344548      #endregion
    345549    }
Note: See TracChangeset for help on using the changeset viewer.