- Timestamp:
- 02/09/16 11:14:25 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/IslandALPS/IslandALPS/3.3/IslandALPSAlgorthmsMainLoop.cs
r13604 r13615 116 116 get { return (LookupParameter<IntValue>)Parameters["IslandEvaluatedSolutions"]; } 117 117 } 118 public LookupParameter<IntValue> IslandGenerations { 119 get { return (LookupParameter<IntValue>)Parameters["IslandGenerations"]; } 120 } 118 121 119 #endregion 122 120 … … 204 202 205 203 Parameters.Add(new LookupParameter<IntValue>("LayerEvaluatedSolutions", "The number of times a solution has been evaluated.")); 206 Parameters.Add(new LookupParameter<IntValue>("IslandGenerations", "The number of generations calculated on one island."));207 204 //TODO: make long ? 208 205 Parameters.Add(new LookupParameter<IntValue>("IslandEvaluatedSolutions", "The number of times a solution has been evaluated on one island.")); … … 226 223 227 224 var processIslandsUssp = new UniformSubScopesProcessor() {Name = "Process Islands", Parallel = new BoolValue(true)}; 228 var initIslandGenerationsAss = new Assigner() {Name = "Init Island Generations"};229 225 var initIslandEvaluationsAss = new Assigner() {Name = "Init Island Evaluations"}; 230 226 231 var incrementGenerationDr = new DataReducer() { Name = "Increment Generations" };227 var incrementGenerationDr = new IntCounter() { Name = "Increment Generations" }; 232 228 var incrementEvaluatedSolutionDr = new DataReducer() { Name = "Increment Evaluated Solutions" }; 233 229 … … 255 251 var alpsMainOperator = new AlpsGeneticAlgorithmMainOperator(); 256 252 257 var incrementIslandGeneration = new IntCounter() {Name = "incrementIslandGeneration" };258 253 var setIslandEvaluatedSolutions = new DataReducer() {Name = "Set IslandEvaluatedSolutions" }; 259 254 255 var migrationThresholdCounter = new IntCounter() {Name = "Increment Counter for Migrations"}; 256 var migrationThresholdAss = new Assigner() {Name = "Reset Counter for Migrations"}; 260 257 var migrationCounter = new IntCounter() {Name = "Increment Migrations"}; 261 258 var selectforMigrationUssp = new UniformSubScopesProcessor(); … … 273 270 globalVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Migrations",new IntValue(0))); 274 271 275 islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>(IslandGenerations.Name, new IntValue(0)));276 272 islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OpenLayers", new IntValue(1))); 277 273 islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("IslandResults")); … … 292 288 resultsCollector.CopyValue = new BoolValue(false); 293 289 294 initIslandGenerationsAss.LeftSideParameter.ActualName = IslandGenerations.Name;295 initIslandGenerationsAss.RightSideParameter.Value = new IntValue(0);296 297 290 initIslandEvaluationsAss.LeftSideParameter.ActualName = IslandEvaluatedSolutions.Name; 298 291 initIslandEvaluationsAss.RightSideParameter.Value = new IntValue(0); 299 292 300 incrementGenerationDr.TargetParameter.ActualName = "Generations"; 301 incrementGenerationDr.ParameterToReduce.ActualName = IslandGenerations.Name; 302 incrementGenerationDr.TargetOperation.Value = new ReductionOperation(ReductionOperations.Sum); 303 incrementGenerationDr.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Min); 293 incrementGenerationDr.ValueParameter.ActualName = "Generations"; 304 294 305 295 incrementEvaluatedSolutionDr.ParameterToReduce.ActualName = IslandEvaluatedSolutions.Name; … … 308 298 incrementEvaluatedSolutionDr.TargetOperation.Value = new ReductionOperation(ReductionOperations.Sum); 309 299 310 incrementIslandGeneration.ValueParameter.ActualName = IslandGenerations.Name;311 300 setIslandEvaluatedSolutions.ParameterToReduce.ActualName = LayerEvaluatedSolutionsParameter.Name; 312 301 setIslandEvaluatedSolutions.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); … … 314 303 setIslandEvaluatedSolutions.TargetParameter.ActualName = IslandEvaluatedSolutions.Name; 315 304 305 306 migrationThresholdCounter.ValueParameter.ActualName = "MigrationThreshold"; 307 316 308 migrateComparator.Comparison.Value = ComparisonType.GreaterOrEqual; 317 migrateComparator.LeftSideParameter.ActualName = IslandGenerations.Name;309 migrateComparator.LeftSideParameter.ActualName = "MigrationThreshold"; 318 310 migrateComparator.RightSideParameter.ActualName = MigrationIntervalParameter.Name; 319 311 migrateComparator.ResultParameter.ActualName = "Migrate"; … … 322 314 323 315 migrationCounter.ValueParameter.ActualName = "Migrations"; 316 migrationThresholdAss.LeftSideParameter.ActualName = "MigrationThreshold"; 317 migrationThresholdAss.RightSideParameter.Value = new IntValue(0); 318 324 319 selectforMigrationUssp.Depth = new IntValue(2); 325 320 emigrantSelector.OperatorParameter.ActualName = EmigrantsSelectorParameter.Name; … … 376 371 initGlobalAnalyzerPlacerholder.Successor = resultsCollector; 377 372 resultsCollector.Successor = processIslandsUssp; 378 processIslandsUssp.Operator = initIslandGenerationsAss; 379 initIslandGenerationsAss.Successor = initIslandEvaluationsAss; 373 processIslandsUssp.Operator = initIslandEvaluationsAss; 380 374 initIslandEvaluationsAss.Successor = matingPoolCreator; 381 375 matingPoolCreator.Successor = matingPoolUssp; … … 393 387 islandAnalyzerPlaceholder.Successor = islandResultsCollector; 394 388 islandResultsCollector.Successor = setIslandEvaluatedSolutions; 395 setIslandEvaluatedSolutions.Successor = incrementIslandGeneration; 396 incrementIslandGeneration.Successor = migrateComparator; 397 migrateComparator.Successor = migrateCondBranch; 398 migrateCondBranch.FalseBranch = matingPoolCreator; 399 migrateCondBranch.TrueBranch = null; 389 setIslandEvaluatedSolutions.Successor = null; 400 390 401 391 processIslandsUssp.Successor = incrementGenerationDr; 402 392 incrementGenerationDr.Successor = incrementEvaluatedSolutionDr; 403 incrementEvaluatedSolutionDr.Successor = migrationCounter; 404 393 incrementEvaluatedSolutionDr.Successor = migrationThresholdCounter; 394 395 migrationThresholdCounter.Successor = migrateComparator; 396 397 migrateComparator.Successor = migrateCondBranch; 398 migrateCondBranch.FalseBranch = null; 399 migrateCondBranch.TrueBranch = migrationThresholdAss; 400 migrationThresholdAss.Successor = migrationCounter; 401 405 402 migrationCounter.Successor = selectforMigrationUssp; 406 403 selectforMigrationUssp.Operator = emigrantSelector; … … 411 408 replaceforMigrationUssp.Operator = immigrantSelector; 412 409 immigrantSelector.Successor = null; 413 replaceforMigrationUssp.Successor = globalAnalyzerPlacerholder; 410 replaceforMigrationUssp.Successor = null; 411 412 migrateCondBranch.Successor = globalAnalyzerPlacerholder; 413 414 414 415 415 globalAnalyzerPlacerholder.Successor = groupingOperator;
Note: See TracChangeset
for help on using the changeset viewer.