Changeset 9569 for trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs
- Timestamp:
- 06/03/13 14:39:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs
r9456 r9569 94 94 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 95 95 } 96 private IFixedValueParameter<BoolValue> ReevaluateElitesParameter { 97 get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; } 98 } 96 99 private ValueParameter<MultiAnalyzer> AnalyzerParameter { 97 100 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } … … 157 160 get { return ElitesParameter.Value; } 158 161 set { ElitesParameter.Value = value; } 162 } 163 public bool ReevaluteElites { 164 get { return ReevaluateElitesParameter.Value.Value; } 165 set { ReevaluateElitesParameter.Value.Value = value; } 159 166 } 160 167 public MultiAnalyzer Analyzer { … … 192 199 private RAPGA(bool deserializing) : base(deserializing) { } 193 200 [StorableHook(HookType.AfterDeserialization)] 194 private void AfterDeserialization() { Initialize(); } 201 private void AfterDeserialization() { 202 if (!Parameters.ContainsKey("ReevaluateElites")) { 203 Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true }); 204 } 205 Initialize(); 206 } 195 207 private RAPGA(RAPGA original, Cloner cloner) 196 208 : base(original, cloner) { … … 216 228 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 217 229 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 230 Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true }); 218 231 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer())); 219 232 Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000))); … … 248 261 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 249 262 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 263 mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 250 264 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 251 265 mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
Note: See TracChangeset
for help on using the changeset viewer.