- Timestamp:
- 06/02/10 17:20:06 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r3816 r3891 127 127 get { return (ValueParameter<MultiAnalyzer>)Parameters["IslandAnalyzer"]; } 128 128 } 129 private ValueParameter<IntValue> MaximumEvaluatedSolutionsParameter { 130 get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; } 131 } 129 132 #endregion 130 133 … … 221 224 get { return IslandAnalyzerParameter.Value; } 222 225 set { IslandAnalyzerParameter.Value = value; } 226 } 227 public IntValue MaximumEvaluatedSolutions { 228 get { return MaximumEvaluatedSolutionsParameter.Value; } 229 set { MaximumEvaluatedSolutionsParameter.Value = value; } 223 230 } 224 231 private RandomCreator RandomCreator { … … 272 279 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the islands.", new MultiAnalyzer())); 273 280 Parameters.Add(new ValueParameter<MultiAnalyzer>("IslandAnalyzer", "The operator used to analyze each island.", new MultiAnalyzer())); 274 281 Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue))); 282 275 283 RandomCreator randomCreator = new RandomCreator(); 276 284 SubScopesCreator populationCreator = new SubScopesCreator(); -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r3750 r3891 203 203 Comparator generationsComparator = new Comparator(); 204 204 Comparator terminatedIslandsComparator = new Comparator(); 205 Comparator maxEvaluatedSolutionsComparator = new Comparator(); 205 206 Placeholder comparisonFactorModifier = new Placeholder(); 206 207 Placeholder analyzer2 = new Placeholder(); … … 208 209 ConditionalBranch generationsTerminationCondition = new ConditionalBranch(); 209 210 ConditionalBranch terminatedIslandsCondition = new ConditionalBranch(); 211 ConditionalBranch evaluatedSolutionsTerminationCondition = new ConditionalBranch(); 210 212 211 213 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Migrations", new IntValue(0))); … … 348 350 terminatedIslandsComparator.ResultParameter.ActualName = "TerminateTerminatedIslands"; 349 351 352 maxEvaluatedSolutionsComparator.Name = "EvaluatedSolutions >= MaximumEvaluatedSolutions ?"; 353 maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 354 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions"; 355 maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 356 maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; 357 350 358 comparisonFactorModifier.Name = "Update Comparison Factor (Placeholder)"; 351 359 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; … … 363 371 terminatedIslandsCondition.Name = "Terminate (TerminatedIslands) ?"; 364 372 terminatedIslandsCondition.ConditionParameter.ActualName = "TerminateTerminatedIslands"; 373 374 evaluatedSolutionsTerminationCondition.Name = "Terminate (EvaluatedSolutions) ?"; 375 evaluatedSolutionsTerminationCondition.ConditionParameter.ActualName = "TerminateEvaluatedSolutions"; 365 376 #endregion 366 377 … … 409 420 immigrationReplacer.Successor = null; 410 421 generationsComparator.Successor = terminatedIslandsComparator; 411 terminatedIslandsComparator.Successor = comparisonFactorModifier; 422 terminatedIslandsComparator.Successor = maxEvaluatedSolutionsComparator; 423 maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier; 412 424 comparisonFactorModifier.Successor = analyzer2; 413 425 analyzer2.Successor = resultsCollector3; … … 417 429 generationsTerminationCondition.Successor = null; 418 430 terminatedIslandsCondition.TrueBranch = null; 419 terminatedIslandsCondition.FalseBranch = uniformSubScopesProcessor1;431 terminatedIslandsCondition.FalseBranch = evaluatedSolutionsTerminationCondition; 420 432 terminatedIslandsCondition.Successor = null; 433 evaluatedSolutionsTerminationCondition.TrueBranch = null; 434 evaluatedSolutionsTerminationCondition.FalseBranch = uniformSubScopesProcessor1; 435 evaluatedSolutionsTerminationCondition.Successor = null; 421 436 #endregion 422 437 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r3816 r3891 104 104 get { return (ValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 105 105 } 106 private ValueParameter<IntValue> MaximumEvaluatedSolutionsParameter { 107 get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; } 108 } 106 109 #endregion 107 110 … … 174 177 get { return AnalyzerParameter.Value; } 175 178 set { AnalyzerParameter.Value = value; } 179 } 180 public IntValue MaximumEvaluatedSolutions { 181 get { return MaximumEvaluatedSolutionsParameter.Value; } 182 set { MaximumEvaluatedSolutionsParameter.Value = value; } 176 183 } 177 184 private RandomCreator RandomCreator { … … 211 218 Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "How much parents should be selected each time the offspring selection step is performed until the population is filled. This parameter should be about the same or twice the size of PopulationSize for smaller problems, and less for large problems.", new IntValue(200))); 212 219 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer())); 213 220 Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue))); 221 214 222 RandomCreator randomCreator = new RandomCreator(); 215 223 SolutionsCreator solutionsCreator = new SolutionsCreator(); -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r3750 r3891 133 133 Comparator maxGenerationsComparator = new Comparator(); 134 134 Comparator maxSelectionPressureComparator = new Comparator(); 135 Comparator maxEvaluatedSolutionsComparator = new Comparator(); 135 136 Placeholder comparisonFactorModifier = new Placeholder(); 136 137 Placeholder analyzer2 = new Placeholder(); … … 138 139 ConditionalBranch conditionalBranch1 = new ConditionalBranch(); 139 140 ConditionalBranch conditionalBranch2 = new ConditionalBranch(); 141 ConditionalBranch conditionalBranch3 = new ConditionalBranch(); 140 142 141 143 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations … … 192 194 maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name; 193 195 196 maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 197 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions"; 198 maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 199 maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; 200 194 201 comparisonFactorModifier.Name = "Update ComparisonFactor (placeholder)"; 195 202 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; … … 207 214 conditionalBranch2.Name = "MaximumGenerations reached?"; 208 215 conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations"; 216 217 conditionalBranch3.Name = "MaximumEvaluatedSolutions reached?"; 218 conditionalBranch3.ConditionParameter.ActualName = "TerminateEvaluatedSolutions"; 209 219 #endregion 210 220 … … 219 229 generationsCounter.Successor = maxGenerationsComparator; 220 230 maxGenerationsComparator.Successor = maxSelectionPressureComparator; 221 maxSelectionPressureComparator.Successor = comparisonFactorModifier; 231 maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator; 232 maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier; 222 233 comparisonFactorModifier.Successor = analyzer2; 223 234 analyzer2.Successor = resultsCollector3; … … 226 237 conditionalBranch1.TrueBranch = null; 227 238 conditionalBranch1.Successor = null; 228 conditionalBranch2.FalseBranch = mainOperator;239 conditionalBranch2.FalseBranch = conditionalBranch3; 229 240 conditionalBranch2.TrueBranch = null; 230 241 conditionalBranch2.Successor = null; 242 conditionalBranch3.FalseBranch = mainOperator; 243 conditionalBranch3.TrueBranch = null; 244 conditionalBranch3.Successor = null; 231 245 #endregion 232 246 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r3816 r3891 116 116 get { return (ValueParameter<MultiAnalyzer>)Parameters["VillageAnalyzer"]; } 117 117 } 118 private ValueParameter<IntValue> MaximumEvaluatedSolutionsParameter { 119 get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; } 120 } 118 121 #endregion 119 122 … … 198 201 get { return VillageAnalyzerParameter.Value; } 199 202 set { VillageAnalyzerParameter.Value = value; } 203 } 204 public IntValue MaximumEvaluatedSolutions { 205 get { return MaximumEvaluatedSolutionsParameter.Value; } 206 set { MaximumEvaluatedSolutionsParameter.Value = value; } 200 207 } 201 208 private RandomCreator RandomCreator { … … 245 252 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze the villages.", new MultiAnalyzer())); 246 253 Parameters.Add(new ValueParameter<MultiAnalyzer>("VillageAnalyzer", "The operator used to analyze each village.", new MultiAnalyzer())); 247 254 Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue))); 255 248 256 RandomCreator randomCreator = new RandomCreator(); 249 257 SubScopesCreator populationCreator = new SubScopesCreator(); -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r3750 r3891 185 185 Assigner finalMaxSelPressAssigner = new Assigner(); 186 186 Comparator maximumGenerationsComparator = new Comparator(); 187 Comparator maximumEvaluatedSolutionsComparator = new Comparator(); 187 188 Placeholder analyzer2 = new Placeholder(); 188 189 ResultsCollector resultsCollector3 = new ResultsCollector(); 189 190 ConditionalBranch terminationCondition = new ConditionalBranch(); 190 191 ConditionalBranch maximumGenerationsTerminationCondition = new ConditionalBranch(); 192 ConditionalBranch maximumEvaluatedSolutionsTerminationCondition = new ConditionalBranch(); 191 193 192 194 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Reunifications", new IntValue(0))); … … 356 358 maximumGenerationsComparator.ResultParameter.ActualName = "TerminateMaximumGenerations"; 357 359 360 maximumEvaluatedSolutionsComparator.Name = "EvaluatedSolutions >= MaximumEvaluatedSolutions"; 361 maximumEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 362 maximumEvaluatedSolutionsComparator.LeftSideParameter.ActualName = "EvaluatedSolutions"; 363 maximumEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 364 maximumEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; 365 358 366 analyzer2.Name = "Analyzer (placeholder)"; 359 367 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; … … 365 373 terminationCondition.ConditionParameter.ActualName = "TerminateSASEGASA"; 366 374 maximumGenerationsTerminationCondition.ConditionParameter.ActualName = "TerminateMaximumGenerations"; 375 maximumEvaluatedSolutionsTerminationCondition.ConditionParameter.ActualName = "TerminateEvaluatedSolutions"; 367 376 #endregion 368 377 … … 422 431 villageCountConditionalBranch.Successor = null; 423 432 finalMaxSelPressAssigner.Successor = null; 424 maximumGenerationsComparator.Successor = analyzer2; 433 maximumGenerationsComparator.Successor = maximumEvaluatedSolutionsComparator; 434 maximumEvaluatedSolutionsComparator.Successor = analyzer2; 425 435 analyzer2.Successor = resultsCollector3; 426 436 resultsCollector3.Successor = terminationCondition; … … 429 439 terminationCondition.Successor = null; 430 440 maximumGenerationsTerminationCondition.TrueBranch = null; 431 maximumGenerationsTerminationCondition.FalseBranch = uniformSubScopesProcessor1;441 maximumGenerationsTerminationCondition.FalseBranch = maximumEvaluatedSolutionsTerminationCondition; 432 442 maximumGenerationsTerminationCondition.Successor = null; 443 maximumEvaluatedSolutionsTerminationCondition.TrueBranch = null; 444 maximumEvaluatedSolutionsTerminationCondition.FalseBranch = uniformSubScopesProcessor1; 445 maximumEvaluatedSolutionsTerminationCondition.Successor = null; 433 446 #endregion 434 447 }
Note: See TracChangeset
for help on using the changeset viewer.