Changeset 3510
- Timestamp:
- 04/23/10 14:21:09 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r3479 r3510 98 98 get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; } 99 99 } 100 private ValueLookupParameter<IntValue> SelectedParentsParameter { 101 get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; } 102 } 100 103 #endregion 101 104 … … 137 140 set { MaximumGenerationsParameter.Value = value; } 138 141 } 139 p rivateDoubleValue SuccessRatio {142 public DoubleValue SuccessRatio { 140 143 get { return SuccessRatioParameter.Value; } 141 144 set { SuccessRatioParameter.Value = value; } 142 145 } 143 p rivateDoubleValue ComparisonFactorLowerBound {146 public DoubleValue ComparisonFactorLowerBound { 144 147 get { return ComparisonFactorLowerBoundParameter.Value; } 145 148 set { ComparisonFactorLowerBoundParameter.Value = value; } 146 149 } 147 p rivateDoubleValue ComparisonFactorUpperBound {150 public DoubleValue ComparisonFactorUpperBound { 148 151 get { return ComparisonFactorUpperBoundParameter.Value; } 149 152 set { ComparisonFactorUpperBoundParameter.Value = value; } 150 153 } 151 p rivateIDiscreteDoubleValueModifier ComparisonFactorModifier {154 public IDiscreteDoubleValueModifier ComparisonFactorModifier { 152 155 get { return ComparisonFactorModifierParameter.Value; } 153 156 set { ComparisonFactorModifierParameter.Value = value; } 154 157 } 155 p rivateDoubleValue MaximumSelectionPressure {158 public DoubleValue MaximumSelectionPressure { 156 159 get { return MaximumSelectionPressureParameter.Value; } 157 160 set { MaximumSelectionPressureParameter.Value = value; } 158 161 } 159 p rivateBoolValue OffspringSelectionBeforeMutation {162 public BoolValue OffspringSelectionBeforeMutation { 160 163 get { return OffspringSelectionBeforeMutationParameter.Value; } 161 164 set { OffspringSelectionBeforeMutationParameter.Value = value; } 165 } 166 public IntValue SelectedParents { 167 get { return SelectedParentsParameter.Value; } 168 set { SelectedParentsParameter.Value = value; } 162 169 } 163 170 private RandomCreator RandomCreator { … … 196 203 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100))); 197 204 Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false))); 205 Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "Should be about 2 * PopulationSize, for large problems use a smaller value to decrease memory footprint.", new IntValue(200))); 198 206 199 207 RandomCreator randomCreator = new RandomCreator(); … … 316 324 } 317 325 } 318 319 326 private void ParameterizeSolutionsCreator() { 320 327 SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name; … … 347 354 foreach (ISelector selector in Selectors) { 348 355 selector.CopySelected = new BoolValue(true); 349 selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value)); 356 selector.NumberOfSelectedSubScopesParameter.Value = null; 357 selector.NumberOfSelectedSubScopesParameter.ActualName = SelectedParentsParameter.Name; 350 358 ParameterizeStochasticOperator(selector); 351 359 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r3490 r3510 109 109 get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; } 110 110 } 111 private ValueLookupParameter<IntValue> SelectedParentsParameter { 112 get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; } 113 } 111 114 #endregion 112 115 … … 183 186 get { return OffspringSelectionBeforeMutationParameter.Value; } 184 187 set { OffspringSelectionBeforeMutationParameter.Value = value; } 188 } 189 public IntValue SelectedParents { 190 get { return SelectedParentsParameter.Value; } 191 set { SelectedParentsParameter.Value = value; } 185 192 } 186 193 private List<ISelector> selectors; … … 225 232 Parameters.Add(new ValueLookupParameter<DoubleValue>("FinalMaximumSelectionPressure", "The maximum selection pressure used when there is only one village left.", new DoubleValue(100))); 226 233 Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false))); 234 Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "Should be about 2 * PopulationSize, for large problems use a smaller value to decrease memory footprint.", new IntValue(200))); 227 235 228 236 RandomCreator randomCreator = new RandomCreator(); … … 417 425 foreach (ISelector selector in Selectors) { 418 426 selector.CopySelected = new BoolValue(true); 419 selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSize.Value - Elites.Value)); 427 selector.NumberOfSelectedSubScopesParameter.Value = null; 428 selector.NumberOfSelectedSubScopesParameter.ActualName = SelectedParentsParameter.Name; 420 429 ParameterizeStochasticOperator(selector); 421 430 }
Note: See TracChangeset
for help on using the changeset viewer.