Changeset 15334 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/SolutionCreator/PlushCreator.cs
- Timestamp:
- 08/21/17 11:33:53 (7 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP
- Property svn:ignore
-
old new 1 1 *.user 2 packages 3 TestResults
-
- Property svn:ignore
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/SolutionCreator/PlushCreator.cs
r15289 r15334 24 24 Parameters.Add(new ValueLookupParameter<IntValue>("MinLength", "The min length of the vector.")); 25 25 Parameters.Add(new ValueLookupParameter<IntValue>("MaxLength", "The max length of the vector.")); 26 Parameters.Add(new ValueLookupParameter<IntValue>("MinClose", "The min close variable for a plush genome entry."));27 26 Parameters.Add(new ValueLookupParameter<IntValue>("MaxClose", "The max close variable for a plush genome entry.")); 28 27 Parameters.Add(new ValueLookupParameter<DoubleValue>("CloseBiasLevel", "Determines how strongly the random close variable is biased towards 0.")); … … 69 68 get { return (IValueLookupParameter<PercentValue>)Parameters["InInstructionProbability"]; } 70 69 } 71 public IValueLookupParameter<IntValue> MinCloseParameter72 {73 get { return (IValueLookupParameter<IntValue>)Parameters["MinClose"]; }74 }75 70 public IValueLookupParameter<IntValue> MaxCloseParameter 76 71 { … … 97 92 var instructions = InstructionsParameter.ActualValue; 98 93 var inInstructionProbability = InInstructionProbabilityParameter.ActualValue.Value; 99 var minClose = MinCloseParameter.ActualValue.Value;100 94 var maxClose = MaxCloseParameter.ActualValue.Value; 101 95 var biasLevel = CloseBiasLevelParameter.ActualValue.Value; … … 103 97 if (minLength > maxLength) 104 98 throw new InvalidOperationException("MinLength > MaxLength"); 105 106 if (minClose > maxClose)107 throw new InvalidOperationException("MinClose > MaxClose");108 99 109 100 var length = random.Next(minLength, maxLength); … … 117 108 inInstructionProbability); 118 109 119 var close = random.NextBiased(minClose, maxClose, biasLevel);110 var close = maxClose == 0 ? 1 : random.NextBiased(0, maxClose, biasLevel); 120 111 121 112 result.Add(new PlushEntry {
Note: See TracChangeset
for help on using the changeset viewer.