Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/29/12 20:15:48 (12 years ago)
Author:
sforsten
Message:

#1980: implemented covering and changed SinglePointCrossover for CombinedIntegerVectorEncoding

Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3
Files:
2 edited

Legend:

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

    • Property svn:ignore
      •  

        old new  
        11*.user
        22Plugin.cs
         3obj
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/Covering/CombinedIntegerVectorCoveringCreator.cs

    r9089 r9090  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929
    30 namespace HeuristicLab.Encodings.CombinedIntegerVectorEncoding.Covering {
     30namespace HeuristicLab.Encodings.CombinedIntegerVectorEncoding {
    3131  [Item("CombinedIntegerVectorCoveringCreator", "Description missing")]
    3232  [StorableClass]
     
    4343      get { return (IValueLookupParameter<IClassifier>)Parameters["CreatedClassifier"]; }
    4444    }
    45     public IValueLookupParameter<PercentValue> ChangeSymbolProbabilityParameter {
    46       get { return (IValueLookupParameter<PercentValue>)Parameters["ChangeSymbolProbability"]; }
     45    public ILookupParameter<PercentValue> ChangeSymbolProbabilityParameter {
     46      get { return (ILookupParameter<PercentValue>)Parameters["ChangeSymbolProbability"]; }
    4747    }
     48    public ILookupParameter<IRandom> RandomParameter {
     49      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     50    }
     51
    4852    #endregion
    4953
     
    6165      Parameters.Add(new LookupParameter<IClassifier>("Action"));
    6266      Parameters.Add(new ValueLookupParameter<IClassifier>("CreatedClassifier"));
    63       Parameters.Add(new ValueLookupParameter<PercentValue>("ChangeSymbolProbability"));
     67      Parameters.Add(new LookupParameter<PercentValue>("ChangeSymbolProbability"));
     68      Parameters.Add(new LookupParameter<IRandom>("Random"));
    6469    }
    6570
    6671    public override IOperation Apply() {
     72      CombinedIntegerVector newCondition = (CombinedIntegerVector)CoverClassifierParameter.ActualValue.Condition.Clone();
     73
    6774      CombinedIntegerVector condition = (CombinedIntegerVector)CoverClassifierParameter.ActualValue.Condition;
    6875      CombinedIntegerVector action = (CombinedIntegerVector)ActionParameter.ActualValue.Action;
    6976
    70       //TODO: manipulation
     77      newCondition = UniformSomePositionInConditionManipulator.ManipulateCondition(RandomParameter.ActualValue, condition, newCondition, ChangeSymbolProbabilityParameter.ActualValue.Value);
    7178
    72       CreatedClassifierParameter.ActualValue = new CombinedIntegerVector(condition, condition.Bounds, action, action.Bounds);
     79      CreatedClassifierParameter.ActualValue = new CombinedIntegerVector(newCondition, newCondition.Bounds, action, action.Bounds);
    7380      return base.Apply();
    7481    }
Note: See TracChangeset for help on using the changeset viewer.