private CombinedOperator CreateReseeder()
        {
            var reseeder = new CombinedOperator()
            {
                Name = "Reseed Layer Zero if needed"
            };
            var reseedingController = new ReseedingController()
            {
                Name = "Reseeding needed (Generation % AgeGap == 0)?"
            };
            var removeIndividuals      = new SubScopesRemover();
            var createIndividuals      = new SolutionsCreator();
            var initializeAgeProsessor = new UniformSubScopesProcessor();
            var initializeAge          = new VariableCreator()
            {
                Name = "Initialize Age"
            };
            var incrEvaluatedSolutionsAfterReseeding = new SubScopesCounter()
            {
                Name = "Update EvaluatedSolutions"
            };

            reseeder.OperatorGraph.InitialOperator = reseedingController;

            reseedingController.GenerationsParameter.ActualName = "Generations";
            reseedingController.AgeGapParameter.ActualName      = AgeGapParameter.Name;
            reseedingController.FirstLayerOperator = removeIndividuals;
            reseedingController.Successor          = null;

            removeIndividuals.Successor = createIndividuals;

            createIndividuals.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
            createIndividuals.Successor = initializeAgeProsessor;

            initializeAgeProsessor.Operator  = initializeAge;
            initializeAgeProsessor.Successor = incrEvaluatedSolutionsAfterReseeding;

            initializeAge.CollectedValues.Add(new ValueParameter <DoubleValue>(AgeParameter.Name, new DoubleValue(0)));

            incrEvaluatedSolutionsAfterReseeding.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
            incrEvaluatedSolutionsAfterReseeding.AccumulateParameter.Value = new BoolValue(true);

            return(reseeder);
        }
        private void Initialize()
        {
            #region Create parameters
            Parameters.Add(new ValueLookupParameter <IRandom>("Random", "A pseudo random number generator."));
            Parameters.Add(new ValueLookupParameter <BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
            Parameters.Add(new LookupParameter <DoubleValue>("Quality", "The value which represents the quality of a solution."));
            Parameters.Add(new ValueLookupParameter <DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
            Parameters.Add(new ValueLookupParameter <IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
            Parameters.Add(new LookupParameter <IntValue>("Iterations", "The iterations to count."));
            Parameters.Add(new ValueLookupParameter <IntValue>("MaximumIterations", "The maximum number of generations which should be processed."));
            Parameters.Add(new ValueLookupParameter <VariableCollection>("Results", "The variable collection where results should be stored."));
            Parameters.Add(new ValueLookupParameter <IOperator>("Analyzer", "The operator used to analyze the solution."));
            Parameters.Add(new LookupParameter <IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
            Parameters.Add(new ValueLookupParameter <ILocalImprovementOperator>("LocalImprovement", "The local improvement operation."));
            Parameters.Add(new ValueLookupParameter <IMultiNeighborhoodShakingOperator>("ShakingOperator", "The shaking operation."));
            Parameters.Add(new LookupParameter <IntValue>("CurrentNeighborhoodIndex", "The index of the current shaking operation that should be applied."));
            Parameters.Add(new LookupParameter <IntValue>("NeighborhoodCount", "The number of neighborhood operators used for shaking."));
            #endregion

            #region Create operators
            VariableCreator    variableCreator        = new VariableCreator();
            SubScopesProcessor subScopesProcessor0    = new SubScopesProcessor();
            Assigner           bestQualityInitializer = new Assigner();
            Placeholder        analyzer1         = new Placeholder();
            ResultsCollector   resultsCollector1 = new ResultsCollector();

            CombinedOperator iteration     = new CombinedOperator();
            Assigner         iterationInit = new Assigner();

            SubScopesCloner    createChild    = new SubScopesCloner();
            SubScopesProcessor childProcessor = new SubScopesProcessor();

            Assigner    qualityAssigner  = new Assigner();
            Placeholder shaking          = new Placeholder();
            Placeholder localImprovement = new Placeholder();
            Placeholder evaluator        = new Placeholder();
            IntCounter  evalCounter      = new IntCounter();

            QualityComparator qualityComparator     = new QualityComparator();
            ConditionalBranch improvesQualityBranch = new ConditionalBranch();

            Assigner bestQualityUpdater = new Assigner();

            BestSelector bestSelector = new BestSelector();
            RightReducer rightReducer = new RightReducer();

            IntCounter indexCounter  = new IntCounter();
            Assigner   indexResetter = new Assigner();

            Placeholder analyzer2 = new Placeholder();

            Comparator        indexComparator  = new Comparator();
            ConditionalBranch indexTermination = new ConditionalBranch();

            IntCounter        iterationsCounter     = new IntCounter();
            Comparator        iterationsComparator  = new Comparator();
            ConditionalBranch iterationsTermination = new ConditionalBranch();

            variableCreator.CollectedValues.Add(new ValueParameter <BoolValue>("IsBetter", new BoolValue(false)));
            variableCreator.CollectedValues.Add(new ValueParameter <DoubleValue>("BestQuality", new DoubleValue(0)));

            bestQualityInitializer.Name = "Initialize BestQuality";
            bestQualityInitializer.LeftSideParameter.ActualName  = "BestQuality";
            bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.Name;

            analyzer1.Name = "Analyzer (placeholder)";
            analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name;

            resultsCollector1.CopyValue = new BoolValue(false);
            resultsCollector1.CollectedValues.Add(new LookupParameter <DoubleValue>("Best Quality", null, "BestQuality"));
            resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;

            iteration.Name = "MainLoop Body";

            iterationInit.Name = "Init k = 0";
            iterationInit.LeftSideParameter.ActualName = CurrentNeighborhoodIndexParameter.Name;
            iterationInit.RightSideParameter.Value     = new IntValue(0);

            createChild.Name = "Clone solution";

            qualityAssigner.Name = "Assign quality";
            qualityAssigner.LeftSideParameter.ActualName  = "OriginalQuality";
            qualityAssigner.RightSideParameter.ActualName = QualityParameter.Name;

            shaking.Name = "Shaking operator (placeholder)";
            shaking.OperatorParameter.ActualName = ShakingOperatorParameter.Name;

            localImprovement.Name = "Local improvement operator (placeholder)";
            localImprovement.OperatorParameter.ActualName = LocalImprovementParameter.Name;

            evaluator.Name = "Evaluation operator (placeholder)";
            evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;

            evalCounter.Name                      = "Count evaluations";
            evalCounter.Increment.Value           = 1;
            evalCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.ActualName;

            qualityComparator.LeftSideParameter.ActualName  = QualityParameter.Name;
            qualityComparator.RightSideParameter.ActualName = "OriginalQuality";
            qualityComparator.ResultParameter.ActualName    = "IsBetter";

            improvesQualityBranch.ConditionParameter.ActualName = "IsBetter";

            bestQualityUpdater.Name = "Update BestQuality";
            bestQualityUpdater.LeftSideParameter.ActualName  = "BestQuality";
            bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name;

            bestSelector.CopySelected = new BoolValue(false);
            bestSelector.MaximizationParameter.ActualName         = MaximizationParameter.Name;
            bestSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(1);
            bestSelector.QualityParameter.ActualName = QualityParameter.Name;

            indexCounter.Name                      = "Count neighborhood index";
            indexCounter.Increment.Value           = 1;
            indexCounter.ValueParameter.ActualName = CurrentNeighborhoodIndexParameter.Name;

            indexResetter.Name = "Reset neighborhood index";
            indexResetter.LeftSideParameter.ActualName = CurrentNeighborhoodIndexParameter.Name;
            indexResetter.RightSideParameter.Value     = new IntValue(0);

            analyzer2.Name = "Analyzer (placeholder)";
            analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;

            iterationsCounter.Name      = "Iterations Counter";
            iterationsCounter.Increment = new IntValue(1);
            iterationsCounter.ValueParameter.ActualName = IterationsParameter.Name;

            iterationsComparator.Name       = "Iterations >= MaximumIterations";
            iterationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
            iterationsComparator.LeftSideParameter.ActualName  = IterationsParameter.Name;
            iterationsComparator.RightSideParameter.ActualName = MaximumIterationsParameter.Name;
            iterationsComparator.ResultParameter.ActualName    = "Terminate";

            iterationsTermination.Name = "Iterations Termination Condition";
            iterationsTermination.ConditionParameter.ActualName = "Terminate";

            indexComparator.Name = "k < k_max (index condition)";
            indexComparator.LeftSideParameter.ActualName  = CurrentNeighborhoodIndexParameter.Name;
            indexComparator.RightSideParameter.ActualName = NeighborhoodCountParameter.Name;
            indexComparator.Comparison = new Comparison(ComparisonType.Less);
            indexComparator.ResultParameter.ActualName = "ContinueIteration";

            indexTermination.Name = "Index Termination Condition";
            indexTermination.ConditionParameter.ActualName = "ContinueIteration";
            #endregion

            #region Create operator graph
            OperatorGraph.InitialOperator = variableCreator;
            variableCreator.Successor     = subScopesProcessor0;
            subScopesProcessor0.Operators.Add(bestQualityInitializer);
            subScopesProcessor0.Successor = analyzer1;
            analyzer1.Successor           = resultsCollector1;
            /////////
            resultsCollector1.Successor = iteration;

            iteration.OperatorGraph.InitialOperator = iterationInit;
            iteration.Successor     = iterationsCounter;
            iterationInit.Successor = createChild;

            createChild.Successor = childProcessor;
            childProcessor.Operators.Add(new EmptyOperator());
            childProcessor.Operators.Add(qualityAssigner);
            childProcessor.Successor = bestSelector;
            /////////
            qualityAssigner.Successor         = shaking;
            shaking.Successor                 = evaluator;
            evaluator.Successor               = evalCounter;
            evalCounter.Successor             = localImprovement;
            localImprovement.Successor        = qualityComparator;
            qualityComparator.Successor       = improvesQualityBranch;
            improvesQualityBranch.TrueBranch  = bestQualityUpdater;
            improvesQualityBranch.FalseBranch = indexCounter;

            bestQualityUpdater.Successor = indexResetter;
            indexResetter.Successor      = null;

            indexCounter.Successor = null;
            /////////
            bestSelector.Successor       = rightReducer;
            rightReducer.Successor       = analyzer2;
            analyzer2.Successor          = indexComparator;
            indexComparator.Successor    = indexTermination;
            indexTermination.TrueBranch  = createChild;
            indexTermination.FalseBranch = null;

            iterationsCounter.Successor       = iterationsComparator;
            iterationsComparator.Successor    = iterationsTermination;
            iterationsTermination.TrueBranch  = null;
            iterationsTermination.FalseBranch = iteration;
            #endregion
        }
        private CombinedOperator CreateEldersEmigrator()
        {
            var eldersEmigrator = new CombinedOperator()
            {
                Name = "Emigrate Elders"
            };
            var selectorProsessor    = new UniformSubScopesProcessor();
            var eldersSelector       = new EldersSelector();
            var shiftToRightMigrator = new UnidirectionalRingMigrator()
            {
                Name = "Shift elders to next layer"
            };
            var mergingProsessor             = new UniformSubScopesProcessor();
            var mergingReducer               = new MergingReducer();
            var subScopesCounter             = new SubScopesCounter();
            var reduceToPopulationSizeBranch = new ConditionalBranch()
            {
                Name = "ReduceToPopulationSize?"
            };
            var countCalculator = new ExpressionCalculator()
            {
                Name = "CurrentPopulationSize = Min(CurrentPopulationSize, PopulationSize)"
            };
            var bestSelector = new BestSelector();
            var rightReducer = new RightReducer();

            eldersEmigrator.OperatorGraph.InitialOperator = selectorProsessor;

            selectorProsessor.Operator  = eldersSelector;
            selectorProsessor.Successor = shiftToRightMigrator;

            eldersSelector.AgeParameter.ActualName            = AgeParameter.Name;
            eldersSelector.AgeLimitsParameter.ActualName      = AgeLimitsParameter.Name;
            eldersSelector.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name;
            eldersSelector.LayerParameter.ActualName          = "Layer";
            eldersSelector.Successor = null;

            shiftToRightMigrator.ClockwiseMigrationParameter.Value = new BoolValue(true);
            shiftToRightMigrator.Successor = mergingProsessor;

            mergingProsessor.Operator = mergingReducer;

            mergingReducer.Successor = subScopesCounter;

            subScopesCounter.ValueParameter.ActualName = CurrentPopulationSizeParameter.Name;
            subScopesCounter.AccumulateParameter.Value = new BoolValue(false);
            subScopesCounter.Successor = reduceToPopulationSizeBranch;

            reduceToPopulationSizeBranch.ConditionParameter.ActualName = ReduceToPopulationSizeParameter.Name;
            reduceToPopulationSizeBranch.TrueBranch = countCalculator;

            countCalculator.CollectedValues.Add(new LookupParameter <IntValue>(PopulationSizeParameter.Name));
            countCalculator.CollectedValues.Add(new LookupParameter <IntValue>(CurrentPopulationSizeParameter.Name));
            countCalculator.ExpressionParameter.Value            = new StringValue("CurrentPopulationSize PopulationSize CurrentPopulationSize PopulationSize < if toint");
            countCalculator.ExpressionResultParameter.ActualName = CurrentPopulationSizeParameter.Name;
            countCalculator.Successor = bestSelector;

            bestSelector.NumberOfSelectedSubScopesParameter.ActualName = CurrentPopulationSizeParameter.Name;
            bestSelector.CopySelected = new BoolValue(false);
            bestSelector.Successor    = rightReducer;

            return(eldersEmigrator);
        }
        private CombinedOperator CreateLayerOpener()
        {
            var layerOpener = new CombinedOperator()
            {
                Name = "Open new Layer if needed"
            };
            var maxLayerReached = new Comparator()
            {
                Name = "MaxLayersReached = OpenLayers >= NumberOfLayers"
            };
            var maxLayerReachedBranch = new ConditionalBranch()
            {
                Name = "MaxLayersReached?"
            };
            var openNewLayerCalculator = new ExpressionCalculator()
            {
                Name = "OpenNewLayer = Generations >= AgeLimits[OpenLayers - 1]"
            };
            var openNewLayerBranch = new ConditionalBranch()
            {
                Name = "OpenNewLayer?"
            };
            var layerCreator = new LastLayerCloner()
            {
                Name = "Create Layer"
            };
            var updateLayerNumber = new Assigner()
            {
                Name = "Layer = OpenLayers"
            };
            var historyWiper = new ResultsHistoryWiper()
            {
                Name = "Clear History in Results"
            };
            var createChildrenViaCrossover        = new AlpsGeneticAlgorithmMainOperator();
            var incrEvaluatedSolutionsForNewLayer = new SubScopesCounter()
            {
                Name = "Update EvaluatedSolutions"
            };
            var incrOpenLayers = new IntCounter()
            {
                Name = "Incr. OpenLayers"
            };
            var newLayerResultsCollector = new ResultsCollector()
            {
                Name = "Collect new Layer Results"
            };

            layerOpener.OperatorGraph.InitialOperator = maxLayerReached;

            maxLayerReached.LeftSideParameter.ActualName  = "OpenLayers";
            maxLayerReached.RightSideParameter.ActualName = NumberOfLayersParameter.Name;
            maxLayerReached.ResultParameter.ActualName    = "MaxLayerReached";
            maxLayerReached.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
            maxLayerReached.Successor  = maxLayerReachedBranch;

            maxLayerReachedBranch.ConditionParameter.ActualName = "MaxLayerReached";
            maxLayerReachedBranch.FalseBranch = openNewLayerCalculator;

            openNewLayerCalculator.CollectedValues.Add(new LookupParameter <IntArray>(AgeLimitsParameter.Name));
            openNewLayerCalculator.CollectedValues.Add(new LookupParameter <IntValue>("Generations"));
            openNewLayerCalculator.CollectedValues.Add(new LookupParameter <IntValue>(NumberOfLayersParameter.Name));
            openNewLayerCalculator.CollectedValues.Add(new LookupParameter <IntValue>("OpenLayers"));
            openNewLayerCalculator.ExpressionResultParameter.ActualName = "OpenNewLayer";
            openNewLayerCalculator.ExpressionParameter.Value            = new StringValue("Generations 1 + AgeLimits OpenLayers 1 - [] >");
            openNewLayerCalculator.Successor = openNewLayerBranch;

            openNewLayerBranch.ConditionParameter.ActualName = "OpenNewLayer";
            openNewLayerBranch.TrueBranch = layerCreator;

            layerCreator.NewLayerOperator = updateLayerNumber;
            layerCreator.Successor        = incrOpenLayers;

            updateLayerNumber.LeftSideParameter.ActualName  = "Layer";
            updateLayerNumber.RightSideParameter.ActualName = "OpenLayers";
            updateLayerNumber.Successor = historyWiper;

            historyWiper.ResultsParameter.ActualName = "LayerResults";
            historyWiper.Successor = createChildrenViaCrossover;

            // Maybe use only crossover and no elitism instead of "default operator"
            createChildrenViaCrossover.RandomParameter.ActualName              = LocalRandomParameter.Name;
            createChildrenViaCrossover.EvaluatorParameter.ActualName           = EvaluatorParameter.Name;
            createChildrenViaCrossover.EvaluatedSolutionsParameter.ActualName  = "LayerEvaluatedSolutions";
            createChildrenViaCrossover.QualityParameter.ActualName             = QualityParameter.Name;
            createChildrenViaCrossover.MaximizationParameter.ActualName        = MaximizationParameter.Name;
            createChildrenViaCrossover.PopulationSizeParameter.ActualName      = PopulationSizeParameter.Name;
            createChildrenViaCrossover.SelectorParameter.ActualName            = SelectorParameter.Name;
            createChildrenViaCrossover.CrossoverParameter.ActualName           = CrossoverParameter.Name;
            createChildrenViaCrossover.MutatorParameter.ActualName             = MutatorParameter.Name;
            createChildrenViaCrossover.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
            createChildrenViaCrossover.ElitesParameter.ActualName              = ElitesParameter.Name;
            createChildrenViaCrossover.ReevaluateElitesParameter.ActualName    = ReevaluateElitesParameter.Name;
            createChildrenViaCrossover.PlusSelectionParameter.ActualName       = PlusSelectionParameter.Name;
            createChildrenViaCrossover.AgeParameter.ActualName            = AgeParameter.Name;
            createChildrenViaCrossover.AgeInheritanceParameter.ActualName = AgeInheritanceParameter.Name;
            createChildrenViaCrossover.AgeIncrementParameter.Value        = new DoubleValue(0.0);
            createChildrenViaCrossover.Successor = incrEvaluatedSolutionsForNewLayer;

            incrEvaluatedSolutionsForNewLayer.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
            incrEvaluatedSolutionsForNewLayer.AccumulateParameter.Value = new BoolValue(true);

            incrOpenLayers.ValueParameter.ActualName = "OpenLayers";
            incrOpenLayers.Increment = new IntValue(1);
            incrOpenLayers.Successor = newLayerResultsCollector;

            newLayerResultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter <ResultCollection>("LayerResults", "Result set for each layer", "LayerResults"));
            newLayerResultsCollector.CopyValue = new BoolValue(false);
            newLayerResultsCollector.Successor = null;

            return(layerOpener);
        }
Beispiel #5
0
        private CombinedOperator CreateEldersEmigrator()
        {
            var eldersEmigrator = new CombinedOperator {
                Name = "Emigrate Elders"
            };
            var selectorProcessor    = new UniformSubScopesProcessor();
            var eldersSelector       = new EldersSelector();
            var shiftToRightMigrator = new UnidirectionalRingMigrator {
                Name = "Shift elders to next layer"
            };
            var mergingProcessor  = new UniformSubScopesProcessor();
            var mergingReducer    = new MergingReducer();
            var subScopesCounter1 = new SubScopesCounter();
            var currentPopulationSizeComparator = new Comparator {
                Name = "Is CurrentPopulationSize greater than 1?"
            };
            var currentPopulationSizeIsGreaterThanOne = new ConditionalBranch {
                Name = "CurrentPopulationSize > 1"
            };
            var reduceToPopulationSizeBranch = new ConditionalBranch {
                Name = "ReduceToPopulationSize?"
            };
            var countCalculator = new ExpressionCalculator {
                Name = "CurrentPopulationSize = Min(CurrentPopulationSize, PopulationSize)"
            };
            var leftSelector          = new LeftSelector();
            var rankAndCrowdingSorter = new RankAndCrowdingSorter();
            var subScopesCounter2     = new SubScopesCounter();
            var rightReducer          = new RightReducer();

            eldersEmigrator.OperatorGraph.InitialOperator = selectorProcessor;

            selectorProcessor.Operator  = eldersSelector;
            selectorProcessor.Successor = shiftToRightMigrator;

            eldersSelector.AgeParameter.ActualName            = AgeParameter.Name;
            eldersSelector.AgeLimitsParameter.ActualName      = AgeLimitsParameter.Name;
            eldersSelector.NumberOfLayersParameter.ActualName = NumberOfLayersParameter.Name;
            eldersSelector.LayerParameter.ActualName          = "Layer";
            eldersSelector.Successor = null;

            shiftToRightMigrator.ClockwiseMigrationParameter.Value = new BoolValue(true);
            shiftToRightMigrator.Successor = mergingProcessor;

            mergingProcessor.Operator = mergingReducer;

            mergingReducer.Successor = subScopesCounter1;

            subScopesCounter1.ValueParameter.ActualName = CurrentPopulationSizeParameter.Name;
            subScopesCounter1.AccumulateParameter.Value = new BoolValue(false);
            subScopesCounter1.Successor = currentPopulationSizeComparator;

            currentPopulationSizeComparator.LeftSideParameter.ActualName  = CurrentPopulationSizeParameter.Name;
            currentPopulationSizeComparator.RightSideParameter.ActualName = OneParameter.Name;
            currentPopulationSizeComparator.ResultParameter.ActualName    = "CurrentPopulationSizeIsGreaterThanOne";
            currentPopulationSizeComparator.Comparison = new Comparison(ComparisonType.Greater);
            currentPopulationSizeComparator.Successor  = currentPopulationSizeIsGreaterThanOne;

            currentPopulationSizeIsGreaterThanOne.ConditionParameter.ActualName = "CurrentPopulationSizeIsGreaterThanOne";
            currentPopulationSizeIsGreaterThanOne.TrueBranch = rankAndCrowdingSorter;

            // We have to sort individuals before reducing, because if we shifted some of them to another layer, it can happen that they are not correctly sorted
            rankAndCrowdingSorter.DominateOnEqualQualitiesParameter.ActualName = DominateOnEqualQualitiesParameter.Name;
            rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName         = "CrowdingDistance";
            rankAndCrowdingSorter.RankParameter.ActualName = "Rank";
            rankAndCrowdingSorter.Successor = reduceToPopulationSizeBranch;

            reduceToPopulationSizeBranch.ConditionParameter.ActualName = ReduceToPopulationSizeParameter.Name;
            reduceToPopulationSizeBranch.TrueBranch = countCalculator;

            countCalculator.CollectedValues.Add(new LookupParameter <IntValue>(PopulationSizeParameter.Name));
            countCalculator.CollectedValues.Add(new LookupParameter <IntValue>(CurrentPopulationSizeParameter.Name));
            countCalculator.ExpressionParameter.Value            = new StringValue("CurrentPopulationSize PopulationSize CurrentPopulationSize PopulationSize < if toint");
            countCalculator.ExpressionResultParameter.ActualName = CurrentPopulationSizeParameter.Name;
            countCalculator.Successor = leftSelector;

            leftSelector.CopySelected = new BoolValue(false);
            leftSelector.NumberOfSelectedSubScopesParameter.ActualName = CurrentPopulationSizeParameter.Name;
            leftSelector.Successor = rightReducer;

            rightReducer.Successor = subScopesCounter2;
            subScopesCounter2.ValueParameter.ActualName = CurrentPopulationSizeParameter.Name;
            subScopesCounter2.AccumulateParameter.Value = new BoolValue(false);

            return(eldersEmigrator);
        }