Changeset 9475 for branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Manipulator
- Timestamp:
- 05/09/13 18:57:22 (12 years ago)
- 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 52 52 } 53 53 54 protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child ) {54 protected override VariableVector Manipulate(IRandom random, VariableVectorInput input, VariableVector child, double spreadpercentage) { 55 55 return Manipulate(random, child, PossibleActionsParameter.ActualValue); 56 56 } -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Manipulator/UniformOnePositionInConditionManipulator.cs
r9392 r9475 45 45 } 46 46 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); 49 49 } 50 50 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) { 52 52 VariableVectorCondition condition = child.Condition; 53 53 if (index >= condition.VirtualLength) { … … 61 61 keyEnumerator.MoveNext(); 62 62 } 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); 64 64 return child; 65 65 } -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Manipulator/UniformSomePositionManipulator.cs
r9204 r9475 55 55 } 56 56 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); 59 59 } 60 60 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); 63 63 return ManipulateAction(random, child, probability, possibleActions); 64 64 } 65 65 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) { 67 67 for (int index = 0; index < child.Condition.VirtualLength; index++) { 68 68 if (random.NextDouble() < probability) { 69 child = UniformOnePositionInConditionManipulator.Manipulate(random, input, child, index );69 child = UniformOnePositionInConditionManipulator.Manipulate(random, input, child, index, spreadPercentage); 70 70 } 71 71 }
Note: See TracChangeset
for help on using the changeset viewer.