Changeset 9605 for branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionListCreator.cs
- Timestamp:
- 06/11/13 13:32:32 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionListCreator.cs
r9352 r9605 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 52 53 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 53 54 } 55 public ILookupParameter<IGAssistNiche> GAssistNicheParameter { 56 get { return (ILookupParameter<IGAssistNiche>)Parameters["GAssistNiche"]; } 57 } 54 58 #endregion 55 59 … … 67 71 Parameters.Add(new LookupParameter<DecisionList>("DecisionList", "")); 68 72 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 69 Parameters.Add(new ValueLookupParameter<IAction>("DefaultAction", ""));73 Parameters.Add(new LookupParameter<IGAssistNiche>("GAssistNiche", "")); 70 74 } 71 75 72 76 public override IOperation Apply() { 73 DecisionListParameter.ActualValue = Create(RandomParameter.ActualValue, ProblemDataParameter.ActualValue.SampleRuleParameter.Value, InitialNumberOfRulesParameter.ActualValue.Value, OneProbabilityParameter.ActualValue.Value, DiscretizersParameter.ActualValue); 77 if (GAssistNicheParameter.ActualValue != null && !(GAssistNicheParameter.ActualValue is IAction)) throw new ArgumentException("GAssistNiche has to be a IAction."); 78 DecisionListParameter.ActualValue = Create(RandomParameter.ActualValue, 79 ProblemDataParameter.ActualValue.SampleRuleParameter.Value, 80 InitialNumberOfRulesParameter.ActualValue.Value, 81 OneProbabilityParameter.ActualValue.Value, 82 DiscretizersParameter.ActualValue, 83 (IAction)GAssistNicheParameter.ActualValue); 74 84 return base.Apply(); 75 85 } 76 86 77 protected abstract DecisionList Create(IRandom random, Rule sampleRule, int initialNumberOfRules, double oneProbability, ItemCollection<IDiscretizer> discretizers );87 protected abstract DecisionList Create(IRandom random, Rule sampleRule, int initialNumberOfRules, double oneProbability, ItemCollection<IDiscretizer> discretizers, IAction niche); 78 88 } 79 89 }
Note: See TracChangeset
for help on using the changeset viewer.