Changeset 9467 for branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable
- Timestamp:
- 05/08/13 14:12:00 (12 years ago)
- Location:
- branches/LearningClassifierSystems
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems
-
Property
svn:mergeinfo
set to
/trunk/sources/HeuristicLab.Core merged eligible
-
Property
svn:mergeinfo
set to
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/DoubleVariable.cs
r9392 r9467 112 112 } 113 113 114 // Important! If this mehtod is called instead of the more concrete "Randomize(IRandom random, double spreadPercentage)" 115 // spread percentage is 50% 116 public override void Randomize(IRandom random) { 117 Randomize(random, 50); 114 // this method is not implemented on purpose, because it may lead to confusion or errors if the wrong parameter would be used (changeSymbolProbability instead of spreadPercentage) 115 public override void Randomize(IRandom random, double changeSymbolProbability) { 116 throw new NotImplementedException("The method DoubleVariable.Randomize(IRandom, double) should not be used. Use DoubleVariable.Randomize(IRandom, double, double) instead."); 118 117 } 119 118 120 public void Randomize(IRandom random, double spreadPercentage) { 119 // changeSymbolProbability is not used on purpose 120 public void Randomize(IRandom random, double changeSymbolProbability, double spreadPercentage) { 121 121 if (spreadPercentage < 0 || spreadPercentage > 100) { 122 122 throw new ArgumentException("Spread percentage has to be between 0 and 100."); -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/IActionVariable.cs
r9226 r9467 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Core; 23 24 24 25 namespace HeuristicLab.Encodings.VariableVector { … … 30 31 void SetTo(string value); 31 32 IEnumerable<string> GetAllPossibleActions(); 33 34 void RandomizeAction(IRandom random); 32 35 } 33 36 } -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/IVariable.cs
r9242 r9467 33 33 IVariable GetSetCopy(); 34 34 35 void Randomize(IRandom random );35 void Randomize(IRandom random, double changeSymbolProbability); 36 36 bool MatchInput(string target); 37 37 bool MatchVariable(IVariable target); -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/IntVariable.cs
r9392 r9467 122 122 } 123 123 124 public override void Randomize(IRandom random) { 124 public void RandomizeAction(IRandom random) { 125 int index = random.Next(possibleFeatures.Count()); 126 currentValue = possibleFeatures.ElementAt(index); 127 } 128 129 public override void Randomize(IRandom random, double changeSymbolProbability) { 130 Wildcard = random.NextDouble() < changeSymbolProbability; 125 131 int index = random.Next(possibleFeatures.Count()); 126 132 currentValue = possibleFeatures.ElementAt(index); -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/StringVariable.cs
r9392 r9467 167 167 } 168 168 169 public override void Randomize(IRandom random) { 169 public void RandomizeAction(IRandom random) { 170 int index = random.Next(possibleFeatures.Count()); 171 currentValue = possibleFeatures.ElementAt(index); 172 } 173 174 public override void Randomize(IRandom random, double changeSymbolProbability) { 175 Wildcard = random.NextDouble() < changeSymbolProbability; 170 176 int index = random.Next(possibleFeatures.Count()); 171 177 currentValue = possibleFeatures.ElementAt(index); -
branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/Variable.cs
r9242 r9467 55 55 public abstract IVariable GetSetCopy(); 56 56 57 public abstract void Randomize(IRandom random );57 public abstract void Randomize(IRandom random, double changeSymbolProbability); 58 58 59 59 public virtual bool MatchVariable(IVariable target) { throw new NotSupportedException("This method is not supported by this kind of Variable."); }
Note: See TracChangeset
for help on using the changeset viewer.