Ignore:
Timestamp:
03/10/15 10:00:41 (7 years ago)
Author:
pfleck
Message:

#2350 Changed SteadyStateMatingPoolCreator to only select individuals young enough for the current layer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainLoop.cs

    r12162 r12171  
    7979      var incrementNextInit = new IntCounter() { Name = "Incr. NextInit" };
    8080      var checkInitFinished = new Comparator() { Name = "DoInit = NextInit >= PopulationSize" };
    81       var createWorkingScope = new BestSelector();
    82       var workingScopeProcessor = new SubScopesProcessor() { Name = "Working Scope Processor" };
     81      var workingScopeProcessor = new NamedSubScopeProcessor() { Name = "WorkingScope Processor" };
    8382      var createRandomIndividual = new SolutionsCreator() { Name = "Create random Individual" };
    8483      var initializeAgeProcessor = new UniformSubScopesProcessor();
    8584      var initializeAge = new Assigner() { Name = "Initialize Age" };
     85      var removeEmptySubscope = new SubScopesRemover() { Name = "Remove empty subscope (from solutioncreator)" };
    8686      var selectRandomTargetIndex = new RandomIntAssigner();
    8787      var matingPoolCreator = new SteadyStateMatingPoolCreator() { Name = "Create MatingPool" };
     
    9292      var mainOperator = new AlpsSsGeneticAlgorithmMainOperator();
    9393      var reactivateInit = new Assigner() { Name = "DoInit = true" };
    94       var resetNextIndex = new Assigner() { Name = "NextInit = 1" };
     94      var resetNextInit = new Assigner() { Name = "NextInit = 1" };
    9595      var resetTargetIndex = new Assigner() { Name = "TargetIndex = 0" };
    96       var clearMatingPool = new SubScopesRemover() { Name = "Clear WorkingScope" };
    9796      var tryMoveUp = new AlpsSsMover() { Name = "Try Move Up" };
    9897      var incrementEvaluations = new IntCounter() { Name = "incr. EvaluatedSolutions" };
     
    121120
    122121      randomScopeProcessor.Operator = isLayerZeroComperator;
     122      // TODO move to old individuals
    123123      randomScopeProcessor.Successor = incrIterations;
    124124
     
    150150      checkInitFinished.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    151151      checkInitFinished.ResultParameter.ActualName = "DoInit";
    152       checkInitFinished.Successor = createWorkingScope;
    153 
    154       createWorkingScope.NumberOfSelectedSubScopesParameter.Value = new IntValue(0);
    155       createWorkingScope.CopySelected = new BoolValue(false);
    156       createWorkingScope.Successor = workingScopeProcessor;
    157 
    158       workingScopeProcessor.Operators.Add(createRandomIndividual);
    159       workingScopeProcessor.Operators.Add(new EmptyOperator());
     152      checkInitFinished.Successor = workingScopeProcessor;
     153
     154      workingScopeProcessor.Operator = createRandomIndividual;
     155      workingScopeProcessor.TargetScopeParameter.ActualName = "WorkingScope";
    160156
    161157      createRandomIndividual.NumberOfSolutions = new IntValue(1);
     
    163159
    164160      initializeAgeProcessor.Operator = initializeAge;
     161      initializeAgeProcessor.Successor = removeEmptySubscope;
    165162
    166163      initializeAge.LeftSideParameter.ActualName = "EvalsCreated";
     
    192189      validParentsBranch.FalseBranch = reactivateInit;
    193190
    194       reactivateInit.Successor = resetNextIndex;
     191      reactivateInit.Successor = resetNextInit;
    195192      reactivateInit.LeftSideParameter.ActualName = "DoInit";
    196193      reactivateInit.RightSideParameter.Value = new BoolValue(true);
    197194
    198       resetNextIndex.Successor = resetTargetIndex;
    199       resetNextIndex.LeftSideParameter.ActualName = "NextIndex";
    200       resetNextIndex.RightSideParameter.Value = new IntValue(1);
    201 
    202       resetTargetIndex.Successor = clearMatingPool;
     195      resetNextInit.Successor = resetTargetIndex;
     196      resetNextInit.LeftSideParameter.ActualName = "NextInit";
     197      resetNextInit.RightSideParameter.Value = new IntValue(1);
     198
    203199      resetTargetIndex.LeftSideParameter.ActualName = "TargetIndex";
    204200      resetTargetIndex.RightSideParameter.Value = new IntValue(0);
    205 
    206       clearMatingPool.Successor = createRandomIndividual;
     201      resetTargetIndex.Successor = createRandomIndividual;
    207202
    208203      tryMoveUp.Successor = incrementEvaluations;
Note: See TracChangeset for help on using the changeset viewer.