- Timestamp:
- 06/12/13 15:02:47 (12 years ago)
- Location:
- branches/HivePerformance/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HivePerformance/sources
- Property svn:mergeinfo changed
/trunk/sources merged: 9540,9542-9544,9552-9555,9568-9569,9587,9590-9592,9600,9607-9608,9610-9611,9613
- Property svn:mergeinfo changed
-
branches/HivePerformance/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs
r9539 r9616 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"]; } … … 108 111 : base() { 109 112 Initialize(); 113 } 114 115 [StorableHook(HookType.AfterDeserialization)] 116 private void AfterDeserialization() { 117 // BackwardsCompatibility3.3 118 #region Backwards compatible code, remove with 3.4 119 if (!Parameters.ContainsKey("ReevaluateElites")) { 120 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 121 } 122 #endregion 110 123 } 111 124 … … 121 134 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 122 135 Parameters.Add(new ValueLookupParameter<BoolValue>("PlusSelection", "True for plus selection (elitist population), false for comma selection (non-elitist population).")); 136 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 123 137 Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions.")); 124 138 Parameters.Add(new ValueLookupParameter<IOperator>("Recombinator", "The operator used to cross solutions.")); … … 162 176 Placeholder analyzer2 = new Placeholder(); 163 177 ConditionalBranch conditionalBranch = new ConditionalBranch(); 178 ConditionalBranch reevaluateElitesBranch = new ConditionalBranch(); 179 SubScopesProcessor subScopesProcessor2 = new SubScopesProcessor(); 180 UniformSubScopesProcessor uniformSubScopesProcessor4 = new UniformSubScopesProcessor(); 181 Placeholder evaluator2 = new Placeholder(); 182 SubScopesCounter subScopesCounter2 = new SubScopesCounter(); 183 164 184 165 185 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class EvolutionStrategy expects this to be called Generations … … 235 255 236 256 conditionalBranch.ConditionParameter.ActualName = "Terminate"; 257 258 reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites"; 259 reevaluateElitesBranch.Name = "Reevaluate elites ?"; 260 261 uniformSubScopesProcessor4.Parallel.Value = true; 262 263 evaluator2.Name = "Evaluator (placeholder)"; 264 evaluator2.OperatorParameter.ActualName = EvaluatorParameter.Name; 265 266 subScopesCounter2.Name = "Increment EvaluatedSolutions"; 267 subScopesCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 237 268 #endregion 238 269 … … 266 297 evaluator.Successor = null; 267 298 subScopesCounter.Successor = null; 268 plusOrCommaReplacementBranch.TrueBranch = plusReplacement; 299 300 plusOrCommaReplacementBranch.TrueBranch = reevaluateElitesBranch; 301 reevaluateElitesBranch.TrueBranch = subScopesProcessor2; 302 reevaluateElitesBranch.FalseBranch = null; 303 subScopesProcessor2.Operators.Add(uniformSubScopesProcessor4); 304 subScopesProcessor2.Operators.Add(new EmptyOperator()); 305 uniformSubScopesProcessor4.Operator = evaluator2; 306 uniformSubScopesProcessor4.Successor = subScopesCounter2; 307 subScopesCounter2.Successor = null; 308 reevaluateElitesBranch.Successor = plusReplacement; 309 269 310 plusOrCommaReplacementBranch.FalseBranch = commaReplacement; 270 311 plusOrCommaReplacementBranch.Successor = bestSelector;
Note: See TracChangeset
for help on using the changeset viewer.