Changeset 10643 for trunk/sources/HeuristicLab.Selection
- Timestamp:
- 03/21/14 14:20:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Selection/3.3/OffspringSelector.cs
r10639 r10643 57 57 } 58 58 59 public FixedValueParameter<BoolValue> FillPopulationWithParentsParameter {60 get { return ( FixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }59 public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter { 60 get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; } 61 61 } 62 62 … … 64 64 get { return OffspringCreatorParameter.Value; } 65 65 set { OffspringCreatorParameter.Value = value; } 66 }67 68 public bool FillPopulationWithParents {69 get { return FillPopulationWithParentsParameter.Value.Value; }70 set { FillPopulationWithParentsParameter.Value.Value = value; }71 66 } 72 67 … … 77 72 // BackwardsCompatibility3.3 78 73 #region Backwards compatible code, remove with 3.4 74 if (Parameters.ContainsKey("FillPopulationWithParents") && Parameters["FillPopulationWithParents"] is FixedValueParameter<BoolValue>) 75 Parameters.Remove("FillPopulationWithParents"); 79 76 if (!Parameters.ContainsKey("FillPopulationWithParents")) 80 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individuals instead of lucky losers.", new BoolValue(false)));77 Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individuals instead of lucky losers.")); 81 78 #endregion 82 79 } … … 96 93 Parameters.Add(new ScopeTreeLookupParameter<BoolValue>("SuccessfulOffspring", "True if the offspring was more successful than its parents.", 2)); 97 94 Parameters.Add(new OperatorParameter("OffspringCreator", "The operator used to create new offspring.")); 98 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individuals instead of lucky losers.", new BoolValue(false)));95 Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.")); 99 96 } 100 97 … … 102 99 double maxSelPress = MaximumSelectionPressureParameter.ActualValue.Value; 103 100 double successRatio = SuccessRatioParameter.ActualValue.Value; 101 bool fillPopulationWithParents = FillPopulationWithParentsParameter.ActualValue.Value; 104 102 IScope scope = ExecutionContext.Scope; 105 103 IScope parents = scope.SubScopes[0]; … … 153 151 } else if (worseOffspringNeeded > 0 || tmpSelPress >= maxSelPress) { 154 152 IScope currentOffspring; 155 if (! FillPopulationWithParents || worseOffspringNeeded > 0) {153 if (!fillPopulationWithParents || worseOffspringNeeded > 0) { 156 154 currentOffspring = offspring.SubScopes[i]; 157 155 offspring.SubScopes.Remove(currentOffspring);
Note: See TracChangeset
for help on using the changeset viewer.