Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/09/13 18:57:22 (12 years ago)
Author:
sforsten
Message:

#1980: several small bug fixes

Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Manipulator
Files:
3 edited

Legend:

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

    r9242 r9475  
    5252    }
    5353
    54     protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child) {
     54    protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, double spreadpercentage) {
    5555      return Manipulate(random, child, PossibleActionsParameter.ActualValue);
    5656    }
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Manipulator/UniformOnePositionInConditionManipulator.cs

    r9392 r9475  
    4545    }
    4646
    47     protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child) {
    48       return Manipulate(random, input, child, random.Next(child.Condition.VirtualLength));
     47    protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, double spreadPercentage) {
     48      return Manipulate(random, input, child, random.Next(child.Condition.VirtualLength), spreadPercentage);
    4949    }
    5050
    51     public static VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, int index) {
     51    public static VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, int index, double spreadPercentage) {
    5252      VariableVectorCondition condition = child.Condition;
    5353      if (index >= condition.VirtualLength) {
     
    6161        keyEnumerator.MoveNext();
    6262      }
    63       condition.VariableDictionary[keyEnumerator.Current].Manipulate(random, input.InputDictionary[keyEnumerator.Current], index - count);
     63      condition.VariableDictionary[keyEnumerator.Current].Manipulate(random, input.InputDictionary[keyEnumerator.Current], index - count, spreadPercentage);
    6464      return child;
    6565    }
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Manipulator/UniformSomePositionManipulator.cs

    r9204 r9475  
    5555    }
    5656
    57     protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child) {
    58       return Manipulate(random, input, child, ProbabilityParameter.ActualValue.Value, PossibleActionsParameter.ActualValue);
     57    protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, double spreadPercentage) {
     58      return Manipulate(random, input, child, ProbabilityParameter.ActualValue.Value, PossibleActionsParameter.ActualValue, spreadPercentage);
    5959    }
    6060
    61     public static VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, double probability, IItemSet<VariableVectorAction> possibleActions) {
    62       child = ManipulateCondition(random, input, child, probability);
     61    public static VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, double probability, IItemSet<VariableVectorAction> possibleActions, double spreadPercentage) {
     62      child = ManipulateCondition(random, input, child, probability, spreadPercentage);
    6363      return ManipulateAction(random, child, probability, possibleActions);
    6464    }
    6565
    66     public static VariableVector ManipulateCondition(IRandom random, VariableVectorInput input, VariableVector child, double probability) {
     66    public static VariableVector ManipulateCondition(IRandom random, VariableVectorInput input, VariableVector child, double probability, double spreadPercentage) {
    6767      for (int index = 0; index < child.Condition.VirtualLength; index++) {
    6868        if (random.NextDouble() < probability) {
    69           child = UniformOnePositionInConditionManipulator.Manipulate(random, input, child, index);
     69          child = UniformOnePositionInConditionManipulator.Manipulate(random, input, child, index, spreadPercentage);
    7070        }
    7171      }
Note: See TracChangeset for help on using the changeset viewer.