Changeset 9605 for branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/Creators
- Timestamp:
- 06/11/13 13:32:32 (12 years ago)
- Location:
- branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/Creators
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/Creators/UniformRandomDecisionListCreator.cs
r9352 r9605 43 43 } 44 44 45 protected override DecisionList Create(IRandom random, Rule sampleRule, int initialNumberOfRules, double oneProbability, ItemCollection<IDiscretizer> discretizers ) {45 protected override DecisionList Create(IRandom random, Rule sampleRule, int initialNumberOfRules, double oneProbability, ItemCollection<IDiscretizer> discretizers, IAction niche) { 46 46 List<Rule> rules = new List<Rule>(); 47 47 for (int i = 0; i < initialNumberOfRules; i++) { 48 48 var newRule = (Rule)sampleRule.Clone(); 49 newRule.Randomize(random, oneProbability, discretizers); 49 if (niche != null) { 50 newRule.Randomize(random, oneProbability, discretizers, new List<IAction>() { niche }); 51 } else { 52 newRule.Randomize(random, oneProbability, discretizers); 53 } 50 54 rules.Add(newRule); 51 55 } 52 56 53 return new DecisionList(rules); 57 if (niche != null) { 58 return new DecisionList(rules, niche); 59 } else { 60 return new DecisionList(rules); 61 } 54 62 } 55 63 }
Note: See TracChangeset
for help on using the changeset viewer.