Changeset 9352 for branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionList.cs
- Timestamp:
- 04/10/13 15:15:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionList.cs
r9342 r9352 109 109 #region IGAssistIndividual Members 110 110 111 public IGAssistNiche Niche { 112 get { return defaultAction; } 113 } 114 115 public void SetNiche(IRandom random, IGAssistNiche niche) { 116 var action = niche as IAction; 117 if (action == null) { 118 throw new ArgumentException("Niche has to be an action"); 119 } 120 if (Niche != null) { 121 throw new ArgumentException("Niche has already been set. It cannot be set again."); 122 } 123 defaultAction = action; 124 var except = new List<IAction>() { action }; 125 foreach (var rule in rules.Where(x => x.Action.SameNiche(niche))) { 126 rule.Action.Randomize(random, except); 127 } 128 } 129 111 130 public void ApplySplit(IRandom random, double probability) { 112 131 foreach (var rule in rules) { … … 126 145 } 127 146 } 128 129 147 #endregion 130 148 }
Note: See TracChangeset
for help on using the changeset viewer.