Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/25/13 12:37:18 (12 years ago)
Author:
sforsten
Message:

#1980:

  • fixed several bugs (crossover, subsumption, serialization etc.)
  • added ModuloOperator
  • CombinedIntegerVectorClassificationProblem\Data and VariableVectorClassificationProblem\Data inherit from ConditionActionClassificationProblem\Data
  • it can now be set how often the analyzers have to be executed
  • VariableVectorAction, VariableVectorCondition and VariableVectorInput now inherit from Item
Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3

    • Property svn:ignore
      •  

        old new  
        11obj
         2Plugin.cs
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Covering/VariableVectorCoveringCreator.cs

    r9226 r9242  
    3434  public class VariableVectorCoveringCreator : CoveringSolutionCreator, IVariableVectorCoveringCreator {
    3535
    36     public IValueLookupParameter<VariableVector> SampleVariableVectorParameter {
    37       get { return (IValueLookupParameter<VariableVector>)Parameters["SampleVariableVector"]; }
     36    public IValueLookupParameter<IVariableVectorClassificationProblemData> ProblemDataParameter {
     37      get { return (IValueLookupParameter<IVariableVectorClassificationProblemData>)Parameters["ProblemData"]; }
     38    }
     39
     40    private IVariableVectorClassificationProblemData ProblemData {
     41      get { return ProblemDataParameter.ActualValue; }
    3842    }
    3943
     
    4549    public VariableVectorCoveringCreator()
    4650      : base() {
    47       Parameters.Add(new ValueLookupParameter<VariableVector>("SampleVariableVector"));
     51      Parameters.Add(new ValueLookupParameter<IVariableVectorClassificationProblemData>("ProblemData"));
    4852    }
    4953    public override IDeepCloneable Clone(Cloner cloner) {
     
    5559      var actionCast = action as VariableVectorAction;
    5660
    57       VariableVectorCondition sampleVariableVectorCondition = SampleVariableVectorParameter.ActualValue.Condition;
     61      VariableVectorCondition sampleVariableVectorCondition = ProblemData.SampleVariableVectorParameter.Value.Condition;
    5862      IEnumerable<IVariable> newCondition = CoverInput(inputCast, sampleVariableVectorCondition, random, changeSymbolProbability);
    5963
    60       return new VariableVector(newCondition, actionCast.Values);
     64      return new VariableVector(newCondition, actionCast.VariableDictionary.Values);
    6165    }
    6266
    6367    private IEnumerable<IVariable> CoverInput(VariableVectorInput input, VariableVectorCondition sample, IRandom random, double changeSymbolProbability) {
    64       var conditionVariables = new List<IVariable>();
    65       if (!sample.Keys.All(x => input.ContainsKey(x))) {
     68      List<IVariable> conditionVariables = new List<IVariable>();
     69      if (!sample.VariableDictionary.Keys.All(x => input.InputDictionary.ContainsKey(x))) {
    6670        throw new ArgumentException("Input does not contain all variable names from sample");
    6771      }
    68       foreach (var keyValuePair in sample) {
     72      foreach (var keyValuePair in sample.VariableDictionary) {
    6973        IVariable variable = keyValuePair.Value.GetEmptyCopy();
    70         variable.Cover(random, input[keyValuePair.Key], changeSymbolProbability);
     74        variable.Cover(random, input.InputDictionary[keyValuePair.Key], changeSymbolProbability);
    7175        conditionVariables.Add(variable);
    7276      }
Note: See TracChangeset for help on using the changeset viewer.