Changeset 9569 for trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy
- Timestamp:
- 06/03/13 14:39:36 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs
r9456 r9569 61 61 get { return (ValueLookupParameter<BoolValue>)Parameters["PlusSelection"]; } 62 62 } 63 public IValueLookupParameter<BoolValue> ReevaluateElitesParameter { 64 get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; } 65 } 63 66 public ValueLookupParameter<IntValue> MaximumGenerationsParameter { 64 67 get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; } … … 121 124 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 122 125 Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "True for plus selection (elitist population), false for comma selection (non-elitist population).")); 126 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 123 127 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 124 128 Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions.")); … … 162 166 Placeholder analyzer2 = new Placeholder(); 163 167 ConditionalBranch conditionalBranch = new ConditionalBranch(); 168 ConditionalBranch reevaluateElitesBranch = new ConditionalBranch(); 169 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 170 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 171 Placeholder evaluator2 = new Placeholder(); 172 SubScopesCounter subScopesCounter2 = new SubScopesCounter(); 173 164 174 165 175 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class EvolutionStrategy expects this to be called Generations … … 235 245 236 246 conditionalBranch.ConditionParameter.ActualName = "Terminate"; 247 248 reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites"; 249 reevaluateElitesBranch.Name = "Reevaluate elites ?"; 250 251 uniformSubScopesProcessor4.Parallel.Value = true; 252 253 evaluator2.Name = "Evaluator (placeholder)"; 254 evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name; 255 256 subScopesCounter2.Name = "Increment EvaluatedSolutions"; 257 subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 237 258 #endregion 238 259 … … 266 287 evaluator.Successor = null; 267 288 subScopesCounter.Successor = null; 268 plusOrCommaReplacementBranch.TrueBranch = plusReplacement; 289 290 plusOrCommaReplacementBranch.TrueBranch = reevaluateElitesBranch; 291 reevaluateElitesBranch.TrueBranch = subScopesProcessor2; 292 reevaluateElitesBranch.FalseBranch = null; 293 subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4); 294 subScopesProcessor2.Operators.Add(new EmptyOperator()); 295 uniformSubScopesProcessor4.Operator = evaluator2; 296 uniformSubScopesProcessor4.Successor = subScopesCounter2; 297 subScopesCounter2.Successor = null; 298 reevaluateElitesBranch.Successor = plusReplacement; 299 269 300 plusOrCommaReplacementBranch.FalseBranch = commaReplacement; 270 301 plusOrCommaReplacementBranch.Successor = bestSelector;
Note: See TracChangeset
for help on using the changeset viewer.