- Timestamp:
- 06/28/13 16:56:21 (12 years ago)
- Location:
- stable
- Files:
-
- 8 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.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r9456 r9673 100 100 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 101 101 } 102 private IFixedValueParameter<BoolValue> ReevaluateElitesParameter { 103 get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; } 104 } 102 105 private ValueLookupParameter<DoubleValue> SuccessRatioParameter { 103 106 get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; } … … 192 195 get { return ElitesParameter.Value; } 193 196 set { ElitesParameter.Value = value; } 197 } 198 public bool ReevaluteElites { 199 get { return ReevaluateElitesParameter.Value.Value; } 200 set { ReevaluateElitesParameter.Value.Value = value; } 194 201 } 195 202 private DoubleValue SuccessRatio { … … 257 264 [StorableHook(HookType.AfterDeserialization)] 258 265 private void AfterDeserialization() { 259 #region Backwards Compatibility 266 // BackwardsCompatibility3.3 267 #region Backwards compatible code, remove with 3.4 260 268 if (successfulOffspringAnalyzer == null) 261 269 successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer(); 270 if (!Parameters.ContainsKey("ReevaluateElites")) { 271 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 }); 272 } 262 273 #endregion 263 274 … … 293 304 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 294 305 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 306 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 }); 295 307 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1))); 296 308 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0))); … … 355 367 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 356 368 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 369 mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 357 370 mainLoop.MutatorParameter.ActualName = MutatorParameter.Name; 358 371 mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name; -
stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r9456 r9673 90 90 public ValueLookupParameter<IntValue> ElitesParameter { 91 91 get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; } 92 } 93 public IValueLookupParameter<BoolValue> ReevaluateElitesParameter { 94 get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; } 92 95 } 93 96 public ValueLookupParameter<ResultCollection> ResultsParameter { … … 158 161 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.")); 159 162 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 163 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 160 164 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results.")); 161 165 Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions.")); … … 248 252 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; 249 253 mainOperator.ElitesParameter.ActualName = ElitesParameter.Name; 254 mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 250 255 mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name; 251 256 mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name; … … 414 419 } 415 420 421 [StorableHook(HookType.AfterDeserialization)] 422 private void AfterDeserialization() { 423 // BackwardsCompatibility3.3 424 #region Backwards compatible code, remove with 3.4 425 if (!Parameters.ContainsKey("ReevaluateElites")) { 426 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 427 } 428 #endregion 429 } 430 416 431 public override IOperation Apply() { 417 432 if (CrossoverParameter.ActualValue == null) -
stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r9456 r9673 79 79 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 80 80 } 81 private IFixedValueParameter<BoolValue> ReevaluateElitesParameter { 82 get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; } 83 } 81 84 private ValueParameter<IntValue> MaximumGenerationsParameter { 82 85 get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; } … … 143 146 get { return ElitesParameter.Value; } 144 147 set { ElitesParameter.Value = value; } 148 } 149 public bool ReevaluteElites { 150 get { return ReevaluateElitesParameter.Value.Value; } 151 set { ReevaluateElitesParameter.Value.Value = value; } 145 152 } 146 153 public IntValue MaximumGenerations { … … 205 212 [StorableHook(HookType.AfterDeserialization)] 206 213 private void AfterDeserialization() { 207 #region Backwards Compatibility 214 // BackwardsCompatibility3.3 215 #region Backwards compatible code, remove with 3.4 208 216 if (successfulOffspringAnalyzer == null) 209 217 successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer(); 218 if (!Parameters.ContainsKey("ReevaluateElites")) { 219 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 }); 220 } 210 221 #endregion 211 222 … … 232 243 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 233 244 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 245 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 }); 234 246 Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000))); 235 247 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1))); … … 274 286 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 275 287 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 288 mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 276 289 mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions"; 277 290 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; -
stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r9456 r9673 63 63 get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; } 64 64 } 65 public IValueLookupParameter<BoolValue> ReevaluateElitesParameter { 66 get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; } 67 } 65 68 public ValueLookupParameter<IntValue> MaximumGenerationsParameter { 66 69 get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; } … … 106 109 : base() { 107 110 Initialize(); 111 } 112 113 [StorableHook(HookType.AfterDeserialization)] 114 private void AfterDeserialization() { 115 // BackwardsCompatibility3.3 116 #region Backwards compatible code, remove with 3.4 117 if (!Parameters.ContainsKey("ReevaluateElites")) { 118 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 119 } 120 #endregion 108 121 } 109 122 … … 120 133 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.")); 121 134 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 135 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 122 136 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 123 137 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); … … 170 184 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; 171 185 mainOperator.ElitesParameter.ActualName = ElitesParameter.Name; 186 mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 172 187 mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name; 173 188 mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name; -
stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs
r9456 r9673 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 // BackwardsCompatibility3.3 108 #region Backwards compatible code, remove with 3.4 109 if (!Parameters.ContainsKey("ReevaluateElites")) { 110 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 111 } 112 #endregion 100 113 } 101 114 … … 112 125 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions.")); 113 126 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 127 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 114 128 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 129 Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio.")); … … 159 173 LeftReducer leftReducer = new LeftReducer(); 160 174 MergingReducer mergingReducer2 = new MergingReducer(); 175 ConditionalBranch reevaluateElitesBranch = new ConditionalBranch(); 176 UniformSubScopesProcessor uniformSubScopesProcessor7 = new UniformSubScopesProcessor(); 177 Placeholder evaluator4 = new Placeholder(); 178 SubScopesCounter subScopesCounter4 = new SubScopesCounter(); 161 179 162 180 selector.Name = "Selector (placeholder)"; … … 253 271 worstSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name; 254 272 worstSelector.QualityParameter.ActualName = QualityParameter.Name; 273 274 reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites"; 275 reevaluateElitesBranch.Name = "Reevaluate elites ?"; 276 277 uniformSubScopesProcessor7.Parallel.Value = true; 278 279 evaluator4.Name = "Evaluator (placeholder)"; 280 evaluator4.OperatorParameter.ActualName = EvaluatorParameter.Name; 281 282 subScopesCounter4.Name = "Increment EvaluatedSolutions"; 283 subScopesCounter4.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 255 284 #endregion 256 285 … … 310 339 subScopesProcessor3.Successor = mergingReducer2; 311 340 bestSelector.Successor = rightReducer; 312 rightReducer.Successor = null; 341 rightReducer.Successor = reevaluateElitesBranch; 342 reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor7; 343 uniformSubScopesProcessor7.Operator = evaluator4; 344 uniformSubScopesProcessor7.Successor = subScopesCounter4; 345 subScopesCounter4.Successor = null; 346 reevaluateElitesBranch.FalseBranch = null; 347 reevaluateElitesBranch.Successor = null; 313 348 worstSelector.Successor = leftReducer; 314 349 leftReducer.Successor = null; -
stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r9456 r9673 85 85 get { return (ValueParameter<IntValue>)Parameters["Elites"]; } 86 86 } 87 private IFixedValueParameter<BoolValue> ReevaluateElitesParameter { 88 get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; } 89 } 87 90 private ValueLookupParameter<DoubleValue> SuccessRatioParameter { 88 91 get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; } … … 160 163 get { return ElitesParameter.Value; } 161 164 set { ElitesParameter.Value = value; } 165 } 166 public bool ReevaluteElites { 167 get { return ReevaluateElitesParameter.Value.Value; } 168 set { ReevaluateElitesParameter.Value.Value = value; } 162 169 } 163 170 public DoubleValue SuccessRatio { … … 233 240 [StorableHook(HookType.AfterDeserialization)] 234 241 private void AfterDeserialization() { 235 #region Backwards Compatibility 242 // BackwardsCompatibility3.3 243 #region Backwards compatible code, remove with 3.4 236 244 if (successfulOffspringAnalyzer == null) 237 245 successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer(); 246 if (!Parameters.ContainsKey("ReevaluateElites")) { 247 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 }); 248 } 238 249 #endregion 239 250 … … 264 275 Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 265 276 Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1))); 277 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 }); 266 278 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1))); 267 279 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0.3))); … … 321 333 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 322 334 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 335 mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 323 336 mainLoop.MutatorParameter.ActualName = MutatorParameter.Name; 324 337 mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name; -
stable/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r9456 r9673 73 73 get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; } 74 74 } 75 public IValueLookupParameter<BoolValue> ReevaluateElitesParameter { 76 get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; } 77 } 75 78 public ValueLookupParameter<ResultCollection> ResultsParameter { 76 79 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } … … 134 137 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.")); 135 138 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 139 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 136 140 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results.")); 137 141 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the villages.")); … … 236 240 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; 237 241 mainOperator.ElitesParameter.ActualName = ElitesParameter.Name; 242 mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name; 238 243 mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name; 239 244 mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name; … … 424 429 } 425 430 431 [StorableHook(HookType.AfterDeserialization)] 432 private void AfterDeserialization() { 433 // BackwardsCompatibility3.3 434 #region Backwards compatible code, remove with 3.4 435 if (!Parameters.ContainsKey("ReevaluateElites")) { 436 Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)")); 437 } 438 #endregion 439 } 440 426 441 public override IOperation Apply() { 427 442 if (CrossoverParameter.ActualValue == null)
Note: See TracChangeset
for help on using the changeset viewer.