Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7488


Ignore:
Timestamp:
02/20/12 13:03:15 (13 years ago)
Author:
mkommend
Message:

#1683: Minor code improvements in SemanticSimilarityCrossover.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Crossovers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs

    r7481 r7488  
    3030
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    32 
    3332  [Item("SemanticSimilarityCrossover", "An operator which performs subtree swapping based on the semantic similarity between subtrees.")]
    3433  public sealed class SymbolicDataAnalysisExpressionSemanticSimilarityCrossover<T> : SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
     
    5352      : base() {
    5453      Parameters.Add(new ValueLookupParameter<DoubleRange>(SemanticSimilarityRangeParameterName, "Semantic similarity interval.", new DoubleRange(0.0001, 10)));
    55       Name = "SemanticSimilarityCrossover";
    5654    }
    57     public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicDataAnalysisExpressionSemanticSimilarityCrossover<T>(this, cloner); }
     55    public override IDeepCloneable Clone(Cloner cloner) {
     56      return new SymbolicDataAnalysisExpressionSemanticSimilarityCrossover<T>(this, cloner);
     57    }
    5858
    5959    public override ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {
     
    109109        double ssd = OnlineMeanAbsoluteErrorCalculator.Calculate(estimatedValues0, estimatedValues1, out errorState);
    110110
    111         if (range.Start > ssd || range.End < ssd)
    112           continue;
    113 
    114         selectedBranch = node;
    115         break;
     111        if (range.Start <= ssd && ssd <= range.End) {
     112          selectedBranch = node;
     113          break;
     114        }
    116115      }
    117116
Note: See TracChangeset for help on using the changeset viewer.