Changeset 8385 for branches/RAPGA
- Timestamp:
- 08/02/12 13:22:47 (12 years ago)
- Location:
- branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/HeuristicLab.Algorithms.RAPGA-3.3.csproj
r8378 r8385 97 97 </ItemGroup> 98 98 <ItemGroup> 99 <Compile Include="Analyzers\SelectionPressureAnalyzer.cs" /> 99 100 <Compile Include="Analyzers\OffspringSuccessAnalyzer.cs" /> 100 101 <Compile Include="Analyzers\PopulationSizeAnalyzer.cs" /> 101 102 <Compile Include="DuplicatesSelector.cs" /> 103 <Compile Include="ExpressionEvaluator.cs" /> 102 104 <Compile Include="OffspringRestorer.cs" /> 103 105 <Compile Include="ProgressiveOffspringPreserver.cs" /> -
branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGA.cs
r8378 r8385 185 185 [Storable] 186 186 private OffspringSuccessAnalyzer offspringSuccessAnalyzer; 187 [Storable] 188 private SelectionPressureAnalyzer selectionPressureAnalyzer; 187 189 #endregion 188 190 … … 196 198 populationSizeAnalyzer = cloner.Clone(original.populationSizeAnalyzer); 197 199 offspringSuccessAnalyzer = cloner.Clone(original.offspringSuccessAnalyzer); 200 selectionPressureAnalyzer = cloner.Clone(original.selectionPressureAnalyzer); 198 201 Initialize(); 199 202 } … … 263 266 populationSizeAnalyzer = new PopulationSizeAnalyzer(); 264 267 offspringSuccessAnalyzer = new OffspringSuccessAnalyzer(); 268 selectionPressureAnalyzer = new SelectionPressureAnalyzer(); 265 269 ParameterizeAnalyzers(); 266 270 UpdateAnalyzers(); … … 401 405 offspringSuccessAnalyzer.ResultsParameter.ActualName = "Results"; 402 406 offspringSuccessAnalyzer.ResultsParameter.Hidden = true; 407 selectionPressureAnalyzer.ResultsParameter.ActualName = "Results"; 408 selectionPressureAnalyzer.ResultsParameter.Hidden = true; 403 409 if (Problem != null) { 404 410 qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; … … 459 465 Analyzer.Operators.Add(populationSizeAnalyzer, populationSizeAnalyzer.EnabledByDefault); 460 466 Analyzer.Operators.Add(offspringSuccessAnalyzer, offspringSuccessAnalyzer.EnabledByDefault); 467 Analyzer.Operators.Add(selectionPressureAnalyzer, selectionPressureAnalyzer.EnabledByDefault); 461 468 } 462 469 private void UpdateSimilarityCalculators() { -
branches/RAPGA/HeuristicLab.Algorithms.RAPGA/3.3/RAPGAMainLoop.cs
r8379 r8385 158 158 WeightedParentsQualityComparator weightedParentsQualityComparator = new WeightedParentsQualityComparator(); 159 159 SubScopesRemover subScopesRemover = new SubScopesRemover(); 160 SubScopesCounter subScopesCounter1 = new SubScopesCounter();161 160 IntCounter intCounter1 = new IntCounter(); 161 IntCounter intCounter2 = new IntCounter(); 162 162 ConditionalSelector conditionalSelector = new ConditionalSelector(); 163 163 RightReducer rightReducer1 = new RightReducer(); … … 177 177 OffspringRestorer offspringRestorer = new OffspringRestorer(); 178 178 MergingReducer mergingReducer = new MergingReducer(); 179 IntCounter intCounter2 = new IntCounter(); 179 Assigner assigner2 = new Assigner(); 180 IntCounter intCounter3 = new IntCounter(); 180 181 SubScopesCounter subScopesCounter3 = new SubScopesCounter(); 182 ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator(); 183 Placeholder analyzer2 = new Placeholder(); 181 184 Comparator comparator3 = new Comparator(); 182 Placeholder analyzer2 = new Placeholder();183 185 ConditionalBranch conditionalBranch3 = new ConditionalBranch(); 184 186 Comparator comparator4 = new Comparator(); 185 187 ConditionalBranch conditionalBranch4 = new ConditionalBranch(); 186 Assigner assigner2 = new Assigner();187 188 Assigner assigner3 = new Assigner(); 188 189 Assigner assigner4 = new Assigner(); 190 Assigner assigner5 = new Assigner(); 189 191 190 192 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class RAPGA expects this to be called Generations 191 193 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("CurrentPopulationSize", new IntValue(0))); 194 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("LastPopulationSize", new IntValue(0))); 192 195 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("NumberOfCreatedOffspring", new IntValue(0))); 193 196 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("NumberOfSuccessfulOffspring", new IntValue(0))); … … 232 235 subScopesRemover.RemoveAllSubScopes = true; 233 236 234 subScopesCounter1.Name = "Increment NumberOfCreatedOffspring"; 235 subScopesCounter1.ValueParameter.ActualName = "NumberOfCreatedOffspring"; 236 237 intCounter1.Name = "Increment EvaluatedSolutions"; 238 intCounter1.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 237 intCounter1.Name = "Increment NumberOfCreatedOffspring"; 238 intCounter1.ValueParameter.ActualName = "NumberOfCreatedOffspring"; 239 239 intCounter1.Increment = null; 240 intCounter1.IncrementParameter.ActualName = "NumberOfCreatedOffspring"; 240 intCounter1.IncrementParameter.ActualName = BatchSizeParameter.Name; 241 242 intCounter2.Name = "Increment EvaluatedSolutions"; 243 intCounter2.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name; 244 intCounter2.Increment = null; 245 intCounter2.IncrementParameter.ActualName = BatchSizeParameter.Name; 241 246 242 247 conditionalSelector.ConditionParameter.ActualName = "SuccessfulOffspring"; … … 276 281 bestSelector.QualityParameter.ActualName = QualityParameter.Name; 277 282 278 intCounter2.Name = "Increment Generations"; 279 intCounter2.Increment = new IntValue(1); 280 intCounter2.ValueParameter.ActualName = "Generations"; 281 subScopesCounter3.Name = "Set CurrentPopulationSize"; 282 283 assigner2.Name = "Update LastPopulationSize"; 284 assigner2.LeftSideParameter.ActualName = "LastPopulationSize"; 285 assigner2.RightSideParameter.ActualName = "CurrentPopulationSize"; 286 287 intCounter3.Name = "Increment Generations"; 288 intCounter3.Increment = new IntValue(1); 289 intCounter3.ValueParameter.ActualName = "Generations"; 290 291 subScopesCounter3.Name = "Update CurrentPopulationSize"; 283 292 subScopesCounter3.ValueParameter.ActualName = "CurrentPopulationSize"; 284 293 subScopesCounter3.AccumulateParameter.Value = new BoolValue(false); 294 295 expressionEvaluator.Name = "Evaluate ActualSelectionPressure"; 296 expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("CurrentPopulationSize")); 297 expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("LastPopulationSize")); 298 expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("NumberOfCreatedOffspring")); 299 expressionEvaluator.CollectedValues.Add(new ValueLookupParameter<IntValue>("NumberOfSuccessfulOffspring")); 300 expressionEvaluator.ExpressionParameter.Value = new StringValue("CurrentPopulationSize NumberOfCreatedOffspring NumberOfSuccessfulOffspring - + LastPopulationSize /"); 301 expressionEvaluator.ExpressionResultParameter.ActualName = "ActualSelectionPressure"; 302 303 analyzer2.Name = "Analyzer"; 304 analyzer2.OperatorParameter.ActualName = "Analyzer"; 285 305 286 306 comparator3.Name = "Generations >= MaximumGenerations"; … … 290 310 comparator3.RightSideParameter.ActualName = MaximumGenerationsParameter.Name; 291 311 292 analyzer2.Name = "Analyzer";293 analyzer2.OperatorParameter.ActualName = "Analyzer";294 295 312 conditionalBranch3.Name = "Terminate?"; 296 313 conditionalBranch3.ConditionParameter.ActualName = "Terminate"; … … 305 322 conditionalBranch4.ConditionParameter.ActualName = "Terminate"; 306 323 307 assigner2.Name = "Reset NumberOfCreatedOffspring"; 308 assigner2.LeftSideParameter.ActualName = "NumberOfCreatedOffspring"; 309 assigner2.RightSideParameter.Value = new IntValue(0); 310 311 assigner3.Name = "Reset NumberOfSuccessfulOffspring"; 312 assigner3.LeftSideParameter.ActualName = "NumberOfSuccessfulOffspring"; 324 assigner3.Name = "Reset NumberOfCreatedOffspring"; 325 assigner3.LeftSideParameter.ActualName = "NumberOfCreatedOffspring"; 313 326 assigner3.RightSideParameter.Value = new IntValue(0); 314 327 315 assigner4.Name = "Reset OffspringList"; 316 assigner4.LeftSideParameter.ActualName = "OffspringList"; 317 assigner4.RightSideParameter.Value = new ScopeList(); 328 assigner4.Name = "Reset NumberOfSuccessfulOffspring"; 329 assigner4.LeftSideParameter.ActualName = "NumberOfSuccessfulOffspring"; 330 assigner4.RightSideParameter.Value = new IntValue(0); 331 332 assigner5.Name = "Reset OffspringList"; 333 assigner5.LeftSideParameter.ActualName = "OffspringList"; 334 assigner5.RightSideParameter.Value = new ScopeList(); 318 335 #endregion 319 336 … … 330 347 childrenCreator.Successor = uniformSubScopesProcessor; 331 348 uniformSubScopesProcessor.Operator = crossover; 332 uniformSubScopesProcessor.Successor = subScopesCounter1;349 uniformSubScopesProcessor.Successor = intCounter1; 333 350 crossover.Successor = stochasticBranch; 334 351 stochasticBranch.FirstBranch = mutator; … … 338 355 evaluator.Successor = weightedParentsQualityComparator; 339 356 weightedParentsQualityComparator.Successor = subScopesRemover; 340 subScopesCounter1.Successor = intCounter1;341 intCounter 1.Successor = conditionalSelector;357 intCounter1.Successor = intCounter2; 358 intCounter2.Successor = conditionalSelector; 342 359 conditionalSelector.Successor = rightReducer1; 343 360 rightReducer1.Successor = duplicateSelector; … … 358 375 rightReducer2.Successor = null; 359 376 scopeCleaner.Successor = offspringRestorer; 360 mergingReducer.Successor = intCounter2; 361 intCounter2.Successor = subScopesCounter3; 362 subScopesCounter3.Successor = analyzer2; 377 mergingReducer.Successor = assigner2; 378 assigner2.Successor = intCounter3; 379 intCounter3.Successor = subScopesCounter3; 380 subScopesCounter3.Successor = expressionEvaluator; 381 expressionEvaluator.Successor = analyzer2; 363 382 analyzer2.Successor = comparator3; 364 383 comparator3.Successor = conditionalBranch3; … … 367 386 conditionalBranch3.Successor = null; 368 387 comparator4.Successor = conditionalBranch4; 369 conditionalBranch4.FalseBranch = assigner 2;388 conditionalBranch4.FalseBranch = assigner3; 370 389 conditionalBranch4.TrueBranch = null; 371 390 conditionalBranch4.Successor = null; 372 assigner2.Successor = assigner3;373 391 assigner3.Successor = assigner4; 374 assigner4.Successor = selector; 392 assigner4.Successor = assigner5; 393 assigner5.Successor = selector; 375 394 376 395 #endregion
Note: See TracChangeset
for help on using the changeset viewer.