Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/27/15 14:30:56 (10 years ago)
Author:
pfleck
Message:

#2027

  • Uses FixedValueParameters and added some properties.
  • Added the comparison-symbol in the string-representation of Terminators.
  • Renamed Terminator parameter to Termination to use a more neutral term.
  • Used Red-Flag as Termination-Icon.
File:
1 edited

Legend:

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

    r12404 r12405  
    116116      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    117117    }
    118     private IValueParameter<MultiTerminator> TerminatorsParameter {
    119       get { return (IValueParameter<MultiTerminator>)Parameters["Terminator"]; }
     118    private IValueParameter<MultiTerminator> TerminationParameter {
     119      get { return (IValueParameter<MultiTerminator>)Parameters["Termination"]; }
    120120    }
    121121    #endregion
     
    204204    }
    205205    private MultiTerminator Terminators {
    206       get { return TerminatorsParameter.Value; }
     206      get { return TerminationParameter.Value; }
    207207    }
    208208    private RandomCreator RandomCreator {
     
    287287      Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
    288288      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 });
    289       Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria which sould be checked.", new MultiTerminator()));
     289      Parameters.Add(new ValueParameter<MultiTerminator>("Termination", "The termination criteria which sould be checked.", new MultiTerminator()));
    290290
    291291      RandomCreator randomCreator = new RandomCreator();
     
    351351      UpdateAnalyzers();
    352352
    353       generationsTerminator = new ComparisonTerminator<IntValue>("Generations", new IntValue(50), ComparisonType.GreaterOrEqual) { Name = "Generations" };
    354       evaluatedSolutionsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", "MaximumEvaluatedSolutions", ComparisonType.GreaterOrEqual) { Name = "Evaluations" };
    355       selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", "MaximumSelectionPressure", ComparisonType.GreaterOrEqual) { Name = "Selection Pressure" };
    356       qualityTerminator = new ComparisonTerminator<DoubleValue>() { Name = "Quality" };
    357       executionTimeTerminator = new ExecutionTimeTerminator(this, TimeSpan.FromMinutes(5)) { Name = "Execution Time" };
     353      generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType.GreaterOrEqual, new IntValue(50)) { Name = "Generations" };
     354      evaluatedSolutionsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.GreaterOrEqual, new IntValue(int.MaxValue)) { Name = "Evaluations" };
     355      selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", ComparisonType.GreaterOrEqual, new DoubleValue(200)) { Name = "Selection Pressure" };
     356      qualityTerminator = new ComparisonTerminator<DoubleValue>(threshold: new DoubleValue()) { Name = "Quality" };
     357      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5))) { Name = "Execution Time" };
    358358      ParameterizeTerminators();
    359359      UpdateTerminators();
     
    508508        if (maximizationParameter != null) {
    509509          bool maximization = maximizationParameter.Value.Value;
    510           qualityTerminator.Comparison = new Comparison(maximization ? ComparisonType.GreaterOrEqual : ComparisonType.LessOrEqual);
    511           qualityTerminator.ThresholdParameter.Value = new DoubleValue(maximization ? double.MaxValue : double.MinValue);
     510          qualityTerminator.Comparison = maximization ? ComparisonType.GreaterOrEqual : ComparisonType.LessOrEqual;
     511          qualityTerminator.Threshold.Value = maximization ? double.MaxValue : double.MinValue;
    512512        }
    513513      }
    514       qualityTerminator.ValueParameter.ActualName = qualityAnalyzer.CurrentBestQualityParameter.Name;
     514      qualityTerminator.ComparisonValueParameter.ActualName = qualityAnalyzer.CurrentBestQualityParameter.Name;
    515515    }
    516516    private void ParameterizeComparisonFactorModifiers() {
Note: See TracChangeset for help on using the changeset viewer.