Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/13 16:16:38 (12 years ago)
Author:
sforsten
Message:

#1980:

  • deleted not needed interface IMatching
  • finished VariableVector encoding
  • the algorithm LearningClassifierSystem is now independent of a specific encoding. It still needs the ConditionActionEncoding.
  • merged r9191:9203 HeuristicLab.Core from trunk to branch
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/Covering/CombinedIntegerVectorCoveringCreator.cs

    r9194 r9204  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Encodings.ConditionActionEncoding;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Parameters;
    2825using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
     
    3128  [Item("CombinedIntegerVectorCoveringCreator", "Description missing")]
    3229  [StorableClass]
    33   public class CombinedIntegerVectorCoveringCreator : SingleSuccessorOperator, ICoveringSolutionCreator {
    34 
    35     #region Parameter Properties
    36     public ILookupParameter<IInput> CoverInputParameter {
    37       get { return (ILookupParameter<IInput>)Parameters["CoverInput"]; }
    38     }
    39     public ILookupParameter<IAction> ActionParameter {
    40       get { return (ILookupParameter<IAction>)Parameters["Action"]; }
    41     }
    42     public IValueLookupParameter<IClassifier> CreatedClassifierParameter {
    43       get { return (IValueLookupParameter<IClassifier>)Parameters["CreatedClassifier"]; }
    44     }
    45     public ILookupParameter<PercentValue> ChangeSymbolProbabilityParameter {
    46       get { return (ILookupParameter<PercentValue>)Parameters["ChangeSymbolProbability"]; }
    47     }
    48     public ILookupParameter<IRandom> RandomParameter {
    49       get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    50     }
    51 
    52     #endregion
     30  public class CombinedIntegerVectorCoveringCreator : CoveringSolutionCreator, ICombinedIntegerVectorOperator {
    5331
    5432    [StorableConstructor]
     
    6240    public CombinedIntegerVectorCoveringCreator()
    6341      : base() {
    64       Parameters.Add(new LookupParameter<IInput>("CoverInput"));
    65       Parameters.Add(new LookupParameter<IAction>("Action"));
    66       Parameters.Add(new ValueLookupParameter<IClassifier>("CreatedClassifier"));
    67       Parameters.Add(new LookupParameter<PercentValue>("ChangeSymbolProbability"));
    68       Parameters.Add(new LookupParameter<IRandom>("Random"));
    6942    }
    7043
    71     public override IOperation Apply() {
    72       CombinedIntegerVector newCondition = (CombinedIntegerVector)CoverInputParameter.ActualValue.Clone();
     44    protected override IClassifier CreateCoveredClassifier(IInput input, IAction action, IRandom random, double changeSymbolProbability) {
     45      CombinedIntegerVector newCondition = (CombinedIntegerVector)input.Clone();
    7346
    74       CombinedIntegerVector condition = (CombinedIntegerVector)CoverInputParameter.ActualValue;
    75       CombinedIntegerVector action = (CombinedIntegerVector)ActionParameter.ActualValue;
     47      CombinedIntegerVector condition = (CombinedIntegerVector)input;
     48      CombinedIntegerVector newAction = (CombinedIntegerVector)action;
    7649
    77       newCondition = UniformSomePositionManipulator.ManipulateCondition(RandomParameter.ActualValue, condition, newCondition, ChangeSymbolProbabilityParameter.ActualValue.Value);
     50      newCondition = UniformSomePositionManipulator.ManipulateCondition(random, condition, newCondition, changeSymbolProbability);
    7851
    79       CreatedClassifierParameter.ActualValue = new CombinedIntegerVector(newCondition, newCondition.Bounds, action, action.Bounds);
    80       return base.Apply();
     52      return new CombinedIntegerVector(newCondition, newCondition.Bounds, newAction, newAction.Bounds);
    8153    }
    8254  }
Note: See TracChangeset for help on using the changeset viewer.