Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/25/15 19:25:30 (9 years ago)
Author:
bburlacu
Message:

#1772: Fix plugin dependencies. Small changes to the SchemaEvaluator: require a minimum of 2 matches for each schema (regardless of the MinimumSchemaFrequency) and use Math.Floor instead of Math.Round when determining the number of individuals to be replaced according to the ReplacementRatio.

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame

    r12891 r12970  
    3535  [PluginDependency("HeuristicLab.Core", "3.3")]
    3636  [PluginDependency("HeuristicLab.Data", "3.3")]
     37  [PluginDependency("HeuristicLab.EvolutionTracking", "3.4")]
    3738  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
    3839  [PluginDependency("HeuristicLab.Operators", "3.3")]
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs

    r12966 r12970  
    190190      }
    191191
    192       if (matchingIndividuals.Count < MinimumSchemaFrequency.Value * individuals.Count) {
     192      if (matchingIndividuals.Count < (int)Math.Max(2, Math.Round(MinimumSchemaFrequency.Value * individuals.Count))) {
    193193        ChangedTreesParameter.ActualValue = new IntValue(0);
    194194        return base.Apply();
     
    202202
    203203      var oc = new OperationCollection();
    204       int n = (int)Math.Round(matchingIndividuals.Count * ReplacementRatio.Value);
     204      int n = (int)Math.Floor(matchingIndividuals.Count * ReplacementRatio.Value);
    205205      var individualsToReplace = RandomReplacement.Value ? matchingIndividuals.SampleRandomWithoutRepetition(random, n).ToList()
    206206                                                         : matchingIndividuals.OrderBy(x => (DoubleValue)x.Variables["Quality"].Value).Take(n).ToList();
Note: See TracChangeset for help on using the changeset viewer.