Changeset 9194 for branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Operator
- Timestamp:
- 01/28/13 17:54:46 (12 years ago)
- Location:
- branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Operator
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Operator/CountNumberOfUniqueActions.cs
r9090 r9194 35 35 get { return (ILookupParameter<ItemArray<IClassifier>>)Parameters["Classifiers"]; } 36 36 } 37 public IValueLookupParameter<IItemSet<IClassifier>> UniqueActionsParameter { 38 get { return (IValueLookupParameter<IItemSet<IClassifier>>)Parameters["UniqueActions"]; } 37 public ILookupParameter<IClassifierComparer> ClassifierComparerParameter { 38 get { return (ILookupParameter<IClassifierComparer>)Parameters["ClassifierComparer"]; } 39 } 40 public IValueLookupParameter<IItemSet<IAction>> UniqueActionsParameter { 41 get { return (IValueLookupParameter<IItemSet<IAction>>)Parameters["UniqueActions"]; } 39 42 } 40 43 public IValueLookupParameter<IntValue> NumberOfUniqueActionsParameter { … … 53 56 : base() { 54 57 Parameters.Add(new ScopeTreeLookupParameter<IClassifier>("Classifiers")); 55 Parameters.Add(new ValueLookupParameter<IItemSet<IClassifier>>("UniqueActions")); 58 Parameters.Add(new LookupParameter<IClassifierComparer>("ClassifierComparer")); 59 Parameters.Add(new ValueLookupParameter<IItemSet<IAction>>("UniqueActions")); 56 60 Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfUniqueActions")); 57 61 } 58 62 59 63 public override IOperation Apply() { 60 ItemSet<I Classifier> actions = new ItemSet<IClassifier>();64 ItemSet<IAction> actions = new ItemSet<IAction>(ClassifierComparerParameter.ActualValue); 61 65 foreach (var classifier in ClassifiersParameter.ActualValue) { 62 66 actions.Add(classifier.Action); -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Operator/MatchActionOperator.cs
r9089 r9194 34 34 get { return (ILookupParameter<BoolValue>)Parameters["MatchAction"]; } 35 35 } 36 public ILookupParameter<I Classifier> TargetMatchParameter {37 get { return (ILookupParameter<I Classifier>)Parameters["TargetMatchParameter"]; }36 public ILookupParameter<IAction> TargetMatchParameter { 37 get { return (ILookupParameter<IAction>)Parameters["TargetMatchParameter"]; } 38 38 } 39 39 public ILookupParameter<IClassifier> MatchParameter { … … 49 49 : base() { 50 50 Parameters.Add(new LookupParameter<BoolValue>("MatchAction", "True if the action matches.")); 51 Parameters.Add(new ValueLookupParameter<I Classifier>("TargetMatchParameter", "Target that has to be matched by the match parameter."));51 Parameters.Add(new ValueLookupParameter<IAction>("TargetMatchParameter", "Target that has to be matched by the match parameter.")); 52 52 Parameters.Add(new ValueLookupParameter<IClassifier>("MatchParameter", "The matching encoding contained in each sub-scope which is used for selection.")); 53 53 } … … 57 57 58 58 public override IOperation Apply() { 59 I Classifiertarget = TargetMatchParameter.ActualValue;59 IAction target = TargetMatchParameter.ActualValue; 60 60 IClassifier match = MatchParameter.ActualValue; 61 61 MatchActionParameter.ActualValue = new BoolValue(match.MatchAction(target)); -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Operator/MatchConditionOperator.cs
r9110 r9194 34 34 get { return (ILookupParameter<BoolValue>)Parameters["MatchCondition"]; } 35 35 } 36 public ILookupParameter<I Classifier> TargetMatchParameter {37 get { return (ILookupParameter<I Classifier>)Parameters["TargetMatchParameter"]; }36 public ILookupParameter<IInput> TargetMatchParameter { 37 get { return (ILookupParameter<IInput>)Parameters["TargetMatchParameter"]; } 38 38 } 39 39 public ILookupParameter<IClassifier> MatchParameter { … … 49 49 : base() { 50 50 Parameters.Add(new LookupParameter<BoolValue>("MatchCondition", "True if the condition matches.")); 51 Parameters.Add(new ValueLookupParameter<I Classifier>("TargetMatchParameter", "Target that has to be matched by the match parameter."));51 Parameters.Add(new ValueLookupParameter<IInput>("TargetMatchParameter", "Target that has to be matched by the match parameter.")); 52 52 Parameters.Add(new ValueLookupParameter<IClassifier>("MatchParameter", "The matching encoding contained in each sub-scope which is used for selection.")); 53 53 } … … 57 57 58 58 public override IOperation Apply() { 59 I Classifiertarget = TargetMatchParameter.ActualValue;59 IInput target = TargetMatchParameter.ActualValue; 60 60 IClassifier match = MatchParameter.ActualValue; 61 MatchConditionParameter.ActualValue = new BoolValue(match.Match Condition(target));61 MatchConditionParameter.ActualValue = new BoolValue(match.MatchInput(target)); 62 62 return base.Apply(); 63 63 } -
branches/LearningClassifierSystems/HeuristicLab.Encodings.ConditionActionEncoding/3.3/Operator/PredictionArrayCalculator.cs
r9089 r9194 33 33 public class PredictionArrayCalculator : SingleSuccessorOperator { 34 34 35 public ILookupParameter<IClassifierComparer> ClassifierComparerParameter { 36 get { return (ILookupParameter<IClassifierComparer>)Parameters["ClassifierComparer"]; } 37 } 35 38 public ILookupParameter<ItemArray<DoubleValue>> FitnessParameter { 36 39 get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Fitness"]; } … … 39 42 get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters["Prediction"]; } 40 43 } 41 public IValueParameter<IItemDictionary<I Classifier, DoubleValue>> PredictionArrayParameter {42 get { return (IValueParameter<IItemDictionary<I Classifier, DoubleValue>>)Parameters["PredictionArray"]; }44 public IValueParameter<IItemDictionary<IAction, DoubleValue>> PredictionArrayParameter { 45 get { return (IValueParameter<IItemDictionary<IAction, DoubleValue>>)Parameters["PredictionArray"]; } 43 46 } 44 47 public ILookupParameter<ItemArray<IClassifier>> MatchParameter { … … 53 56 public PredictionArrayCalculator() 54 57 : base() { 58 Parameters.Add(new LookupParameter<IClassifierComparer>("ClassifierComparer")); 55 59 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Fitness")); 56 60 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Prediction")); 57 Parameters.Add(new ValueLookupParameter<IItemDictionary<I Classifier, DoubleValue>>("PredictionArray"));61 Parameters.Add(new ValueLookupParameter<IItemDictionary<IAction, DoubleValue>>("PredictionArray")); 58 62 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which sub-scopes should be selected.")); 59 63 Parameters.Add(new ScopeTreeLookupParameter<IClassifier>("MatchParameter", "The matching encoding contained in each sub-scope which is used for selection.")); … … 64 68 65 69 public sealed override IOperation Apply() { 66 IItemDictionary<I Classifier, DoubleValue> predictionArray = new ItemDictionary<IClassifier, DoubleValue>();67 IDictionary<I Classifier, double> fitnessSumPerAction = new Dictionary<IClassifier, double>();70 IItemDictionary<IAction, DoubleValue> predictionArray = new ItemDictionary<IAction, DoubleValue>(ClassifierComparerParameter.ActualValue); 71 IDictionary<IAction, double> fitnessSumPerAction = new Dictionary<IAction, double>(ClassifierComparerParameter.ActualValue); 68 72 ItemArray<DoubleValue> fitnesses = FitnessParameter.ActualValue; 69 73 ItemArray<DoubleValue> predictions = PredictionParameter.ActualValue;
Note: See TracChangeset
for help on using the changeset viewer.