Changeset 12412


Ignore:
Timestamp:
06/01/15 17:04:25 (4 years ago)
Author:
pfleck
Message:

#2027 Removed the MaximumEvaluatedSolutions-parameter from OSGA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r12411 r12412  
    9999      get { return (IConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ComparisonFactorModifier"]; }
    100100    }
    101     private ValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter {
    102       get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
     101    private IFixedValueParameter<DoubleValue> MaximumSelectionPressureParameter {
     102      get { return (IFixedValueParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; }
    103103    }
    104104    private ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
     
    110110    private ValueParameter<MultiAnalyzer> AnalyzerParameter {
    111111      get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
    112     }
    113     private IFixedValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
    114       get { return (IFixedValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    115112    }
    116113    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
     
    179176      set { ComparisonFactorModifierParameter.Value = value; }
    180177    }
    181     public DoubleValue MaximumSelectionPressure {
    182       get { return MaximumSelectionPressureParameter.Value; }
    183       set { MaximumSelectionPressureParameter.Value = value; }
     178    public double MaximumSelectionPressure {
     179      get { return MaximumSelectionPressureParameter.Value.Value; }
     180      set { MaximumSelectionPressureParameter.Value.Value = value; }
    184181    }
    185182    public BoolValue OffspringSelectionBeforeMutation {
     
    194191      get { return AnalyzerParameter.Value; }
    195192      set { AnalyzerParameter.Value = value; }
    196     }
    197     public int MaximumEvaluatedSolutions {
    198       get { return MaximumEvaluatedSolutionsParameter.Value.Value; }
    199       set { MaximumEvaluatedSolutionsParameter.Value.Value = value; }
    200193    }
    201194    public bool FillPopulationWithParents {
     
    281274      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end).", new DoubleValue(1)));
    282275      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("ComparisonFactorModifier", "The operator used to modify the comparison factor.", new ItemSet<IDiscreteDoubleValueModifier>(new IDiscreteDoubleValueModifier[] { new LinearDiscreteDoubleValueModifier() }), new LinearDiscreteDoubleValueModifier()));
    283       Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100)));
     276      Parameters.Add(new FixedValueParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100)));
    284277      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false)));
    285278      Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "How much parents should be selected each time the offspring selection step is performed until the population is filled. This parameter should be about the same or twice the size of PopulationSize for smaller problems, and less for large problems.", new IntValue(200)));
    286279      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    287       Parameters.Add(new FixedValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
    288280      Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
    289281      Parameters.Add(new ValueParameter<MultiTerminator>("Termination", "The termination criteria which sould be checked.", new MultiTerminator()));
     
    352344
    353345      generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType.Less, MaximumGenerationsParameter) { Name = "Generations" };
    354       evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, MaximumEvaluatedSolutionsParameter) { Name = "Evaluations" };
    355       selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", ComparisonType.Less, MaximumSelectionPressure) { Name = "Selection Pressure" };
     346      selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", ComparisonType.Less, MaximumSelectionPressureParameter) { Name = "Selection Pressure" };
     347      evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" };
    356348      qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" };
    357349      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));
Note: See TracChangeset for help on using the changeset viewer.