- Timestamp:
- 06/28/13 16:56:21 (11 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9553-9555,9569,9591-9592,9618
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithmMainLoop.cs
r9456 r9673 63 63 public ValueLookupParameter<IntValue> ElitesParameter { 64 64 get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; } 65 } 66 public IValueLookupParameter<BoolValue> ReevaluateElitesParameter { 67 get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; } 65 68 } 66 69 public ValueLookupParameter<IntValue> MaximumGenerationsParameter { … … 112 115 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization.")); 113 116 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 117 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 114 118 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 115 119 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); … … 143 147 Placeholder analyzer2 = new Placeholder(); 144 148 ConditionalBranch conditionalBranch = new ConditionalBranch(); 149 ConditionalBranch reevaluateElitesBranch = new ConditionalBranch(); 145 150 146 151 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class GeneticAlgorithm expects this to be called Generations … … 193 198 194 199 conditionalBranch.ConditionParameter.ActualName = "Terminate"; 200 201 reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites"; 202 reevaluateElitesBranch.Name = "Reevaluate elites ?"; 195 203 #endregion 196 204 … … 221 229 subScopesProcessor2.Successor = mergingReducer; 222 230 bestSelector.Successor = rightReducer; 223 rightReducer.Successor = null; 231 rightReducer.Successor = reevaluateElitesBranch; 232 reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor2; 233 reevaluateElitesBranch.FalseBranch = null; 234 reevaluateElitesBranch.Successor = null; 224 235 mergingReducer.Successor = intCounter; 225 236 intCounter.Successor = comparator; … … 232 243 } 233 244 245 [StorableHook(HookType.AfterDeserialization)] 246 private void AfterDeserialization() { 247 // BackwardsCompatibility3.3 248 #region Backwards compatible code, remove with 3.4 249 if (!Parameters.ContainsKey("ReevaluateElites")) { 250 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 251 } 252 #endregion 253 } 254 234 255 public override IOperation Apply() { 235 256 if (CrossoverParameter.ActualValue == null)
Note: See TracChangeset
for help on using the changeset viewer.