Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/23/16 19:31:18 (8 years ago)
Author:
bburlacu
Message:

#2685: Add correction step for values miscalculated due to cyclical symbol dependencies in the grammar. Updated unit test.

File:
1 edited

Legend:

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

    r14185 r14353  
    162162      Comparator maxSelectionPressureComparator = new Comparator();
    163163      Comparator maxEvaluatedSolutionsComparator = new Comparator();
     164      Comparator maxSolutionQualityComparator = new Comparator();
    164165      Placeholder comparisonFactorModifier = new Placeholder();
    165166      Placeholder analyzer2 = new Placeholder();
     
    167168      ConditionalBranch conditionalBranch2 = new ConditionalBranch();
    168169      ConditionalBranch conditionalBranch3 = new ConditionalBranch();
     170      ConditionalBranch conditionalBranch4 = new ConditionalBranch();
    169171
    170172      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations
     
    223225      maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";
    224226
     227      maxSolutionQualityComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
     228      maxSolutionQualityComparator.LeftSideParameter.ActualName = "MaximumQuality";
     229      maxSolutionQualityComparator.ResultParameter.ActualName = "TerminateMaximumQuality";
     230      maxSolutionQualityComparator.RightSideParameter.ActualName = "BestQuality";
     231
    225232      comparisonFactorModifier.Name = "Update ComparisonFactor (placeholder)";
    226233      comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name;
     
    237244      conditionalBranch3.Name = "MaximumEvaluatedSolutions reached?";
    238245      conditionalBranch3.ConditionParameter.ActualName = "TerminateEvaluatedSolutions";
     246
     247      conditionalBranch4.Name = "MaximumQuality reached?";
     248      conditionalBranch3.ConditionParameter.ActualName = "TerminateMaximumQuality";
    239249      #endregion
    240250
     
    249259      maxGenerationsComparator.Successor = maxSelectionPressureComparator;
    250260      maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator;
    251       maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier;
     261      maxEvaluatedSolutionsComparator.Successor = maxSolutionQualityComparator;
     262      maxSolutionQualityComparator.Successor = comparisonFactorModifier;
    252263      comparisonFactorModifier.Successor = analyzer2;
    253264      analyzer2.Successor = conditionalBranch1;
     
    258269      conditionalBranch2.TrueBranch = null;
    259270      conditionalBranch2.Successor = null;
    260       conditionalBranch3.FalseBranch = mainOperator;
     271      conditionalBranch3.FalseBranch = conditionalBranch4;
    261272      conditionalBranch3.TrueBranch = null;
    262273      conditionalBranch3.Successor = null;
     274      conditionalBranch4.FalseBranch = mainOperator;
     275      conditionalBranch4.TrueBranch = null;
     276      conditionalBranch4.Successor = null;
    263277      #endregion
    264278    }
Note: See TracChangeset for help on using the changeset viewer.