Changeset 1239


Ignore:
Timestamp:
03/02/09 17:32:39 (11 years ago)
Author:
gkronber
Message:

Reintoduced MaxEvaluatedSolutions stopping criterion for hard-coded OffspringSelectionGP. #224 (Simple frontend for GP for non-expert users (similar to HeurisicLab.SGA))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.GP.StructureIdentification/OffspringSelectionGP.cs

    r1238 r1239  
    3939  public class OffspringSelectionGP : StandardGP {
    4040
     41    private IntData maxEvaluatedSolutions = new IntData();
     42    public int MaxEvaluatedSolutions {
     43      get { return maxEvaluatedSolutions.Data; }
     44      set { maxEvaluatedSolutions.Data = value; }
     45    }
     46
    4147    private DoubleData selectionPressureLimit = new DoubleData();
    4248    public double SelectionPressureLimit {
     
    6066      PopulationSize = 1000;
    6167      Parents = 20;
    62       MaxGenerations = 300;
     68      MaxEvaluatedSolutions = 1000000;
    6369      SelectionPressureLimit = 300;
    6470      ComparisonFactor = 1.0;
     
    6975      VariableInjector injector = (VariableInjector)base.CreateGlobalInjector();
    7076      injector.RemoveVariable("TournamentSize");
     77      injector.RemoveVariable("MaxGenerations");
     78      injector.AddVariable(new HeuristicLab.Core.Variable("MaxEvaluatedSolutions", maxEvaluatedSolutions));
    7179      injector.AddVariable(new HeuristicLab.Core.Variable("ComparisonFactor", comparisonFactor));
    7280      injector.AddVariable(new HeuristicLab.Core.Variable("SelectionPressureLimit", selectionPressureLimit));
     
    183191      seq.Name = "Loop Condition";
    184192      LessThanComparator generationsComparator = new LessThanComparator();
    185       generationsComparator.GetVariableInfo("LeftSide").ActualName = "Generations";
    186       generationsComparator.GetVariableInfo("RightSide").ActualName = "MaxGenerations";
    187       generationsComparator.GetVariableInfo("Result").ActualName = "GenerationsCondition";
     193      generationsComparator.GetVariableInfo("LeftSide").ActualName = "EvaluatedSolutions";
     194      generationsComparator.GetVariableInfo("RightSide").ActualName = "MaxEvaluatedSolutions";
     195      generationsComparator.GetVariableInfo("Result").ActualName = "EvaluatedSolutionsCondition";
    188196
    189197      LessThanComparator selPresComparator = new LessThanComparator();
     
    193201     
    194202      ConditionalBranch generationsCond = new ConditionalBranch();
    195       generationsCond.GetVariableInfo("Condition").ActualName = "GenerationsCondition";
     203      generationsCond.GetVariableInfo("Condition").ActualName = "EvaluatedSolutionsCondition";
    196204
    197205      ConditionalBranch selPresCond = new ConditionalBranch();
Note: See TracChangeset for help on using the changeset viewer.