Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/11/13 13:32:32 (11 years ago)
Author:
sforsten
Message:

#1980:

  • set plugin dependencies
  • added smart initialization
  • added hierarchical selection
  • fixed major and minor default rule
  • fixed several smaller bugs
  • some refactoring has been done
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/Crossover/SinglePointCrossover.cs

    r9352 r9605  
    4848
    4949    public static DecisionList Apply(IRandom random, DecisionList parent1, DecisionList parent2) {
    50       if (!parent1.DefaultAction.Match(parent2.DefaultAction)) { throw new ArgumentException("Default action of parents have to match!"); }
     50      if (parent1 == null && parent1 != parent2) { throw new ArgumentException("Either both parents have a default action or none does."); }
     51      if (parent1.DefaultAction != null && !parent1.DefaultAction.Match(parent2.DefaultAction)) { throw new ArgumentException("Default action of parents have to match!"); }
    5152
    5253      int rulesP1 = random.Next(0, parent1.Rules.Count());
     
    6465      }
    6566
     67      if (parent1.DefaultAction == null) {
     68        return new DecisionList(rules);
     69      }
    6670      return new DecisionList(rules, parent1.DefaultAction);
    6771    }
Note: See TracChangeset for help on using the changeset viewer.