Changeset 9569 for trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
- Timestamp:
- 06/03/13 14:39:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
r9456 r9569 67 67 get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; } 68 68 } 69 public IValueLookupParameter<BoolValue> ReevaluateElitesParameter { 70 get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; } 71 } 69 72 public LookupParameter<DoubleValue> ComparisonFactorParameter { 70 73 get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; } … … 98 101 : base() { 99 102 Initialize(); 103 } 104 105 [StorableHook(HookType.AfterDeserialization)] 106 private void AfterDeserialization() { 107 if (!Parameters.ContainsKey("ReevaluateElites")) { 108 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 109 } 100 110 } 101 111 … … 112 122 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions.")); 113 123 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 124 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 114 125 Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1].")); 115 126 Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio.")); … … 159 170 LeftReducer leftReducer = new LeftReducer(); 160 171 MergingReducer mergingReducer2 = new MergingReducer(); 172 ConditionalBranch reevaluateElitesBranch = new ConditionalBranch(); 173 UniformSubScopesProcessor uniformSubScopesProcessor7 = new UniformSubScopesProcessor(); 174 Placeholder evaluator4 = new Placeholder(); 175 SubScopesCounter subScopesCounter4 = new SubScopesCounter(); 161 176 162 177 selector.Name = "Selector (placeholder)"; … … 253 268 worstSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name; 254 269 worstSelector.QualityParameter.ActualName = QualityParameter.Name; 270 271 reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites"; 272 reevaluateElitesBranch.Name = "Reevaluate elites ?"; 273 274 uniformSubScopesProcessor7.Parallel.Value = true; 275 276 evaluator4.Name = "Evaluator (placeholder)"; 277 evaluator4.OperatorParameter.ActualName = EvaluatorParameter.Name; 278 279 subScopesCounter4.Name = "Increment EvaluatedSolutions"; 280 subScopesCounter4.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 255 281 #endregion 256 282 … … 310 336 subScopesProcessor3.Successor = mergingReducer2; 311 337 bestSelector.Successor = rightReducer; 312 rightReducer.Successor = null; 338 rightReducer.Successor = reevaluateElitesBranch; 339 reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor7; 340 uniformSubScopesProcessor7.Operator = evaluator4; 341 uniformSubScopesProcessor7.Successor = subScopesCounter4; 342 subScopesCounter4.Successor = null; 343 reevaluateElitesBranch.FalseBranch = null; 344 reevaluateElitesBranch.Successor = null; 313 345 worstSelector.Successor = leftReducer; 314 346 leftReducer.Successor = null;
Note: See TracChangeset
for help on using the changeset viewer.