Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/08/16 15:55:31 (8 years ago)
Author:
pkuelzer
Message:

#2558 Include LayerNumber in GroupResults
Added Migration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/IslandALPS/IslandALPS/3.3/IslandALPSAlgorthmsMainLoop.cs

    r13595 r13604  
    225225      var resultsCollector = new ResultsCollector();
    226226
    227       var processIslandsUssp = new UniformSubScopesProcessor() {Name = "Process Islands"};
     227      var processIslandsUssp = new UniformSubScopesProcessor() {Name = "Process Islands", Parallel = new BoolValue(true)};
    228228      var initIslandGenerationsAss = new Assigner() {Name = "Init Island Generations"};
    229229      var initIslandEvaluationsAss = new Assigner() {Name = "Init Island Evaluations"};
     
    231231      var incrementGenerationDr = new DataReducer() { Name = "Increment Generations" };
    232232      var incrementEvaluatedSolutionDr = new DataReducer() { Name = "Increment Evaluated Solutions" };
    233       //TODO: increase migration count + migrate
    234233
    235234      var elderMigrator = CreateEldersEmigrator();
     
    250249      var groupResultsExtractor = new ResultsExtractor() {Name = "Collect group results into variable"};
    251250      var groupResultsCollector = new ResultsCollector() {Name = "Collect group results into into global results"};
    252 
     251      var groupLayerNumberResultsCollector = new ResultsCollector() {Name = "Add Layernumber to Results"};
    253252
    254253      var matingPoolCreator = new MatingPoolCreator();
    255254      var matingPoolUssp = new UniformSubScopesProcessor() {Name = "Process Mating Pools"};
    256       var alpsMainOperator =new AlpsGeneticAlgorithmMainOperator();
     255      var alpsMainOperator = new AlpsGeneticAlgorithmMainOperator();
    257256
    258257      var incrementIslandGeneration = new IntCounter() {Name = "incrementIslandGeneration" };
    259258      var setIslandEvaluatedSolutions = new DataReducer() {Name = "Set IslandEvaluatedSolutions" };
     259       
     260      var migrationCounter = new IntCounter() {Name = "Increment  Migrations"};
     261      var selectforMigrationUssp = new UniformSubScopesProcessor();
     262      var emigrantSelector = new Placeholder() {Name = "Emigrant Selector (Placeholder)"};
     263      var migrator = new LayerMigrator();
     264      var replaceforMigrationUssp = new UniformSubScopesProcessor();
     265      var immigrantSelector = new Placeholder() { Name = "Immigrant Replacer (Placeholder)" };
    260266
    261267      var migrateComparator = new Comparator();
     
    283289      resultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults","","IslandResults"));
    284290      resultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("GroupResults","","GroupResults"));
     291      resultsCollector.CollectedValues.Add(new ValueLookupParameter<IntValue>("Migrations"));
    285292      resultsCollector.CopyValue = new BoolValue(false);
    286293
     
    314321      migrateCondBranch.ConditionParameter.ActualName = "Migrate";
    315322
     323      migrationCounter.ValueParameter.ActualName = "Migrations";
     324      selectforMigrationUssp.Depth = new IntValue(2);
     325      emigrantSelector.OperatorParameter.ActualName = EmigrantsSelectorParameter.Name;
     326
     327      replaceforMigrationUssp.Depth = new IntValue(2);
     328      immigrantSelector.OperatorParameter.ActualName = ImmigrationReplacerParameter.Name;
     329
    316330      groupAnalyzer.OperatorParameter.ActualName = GroupAnalyzerParameter.Name;
     331      groupLayerNumberResultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("LayerNumber"));
     332      groupLayerNumberResultsCollector.ResultsParameter.ActualName = "GroupResults";
     333
    317334      layerAnalyzerPlaceholder.OperatorParameter.ActualName = LayerAnalyzerParameter.Name;
    318335      layerResultsCollector.ResultsParameter.ActualName = "LayerResults";
     
    384401      processIslandsUssp.Successor = incrementGenerationDr;
    385402      incrementGenerationDr.Successor = incrementEvaluatedSolutionDr;
    386       incrementEvaluatedSolutionDr.Successor = globalAnalyzerPlacerholder;
     403      incrementEvaluatedSolutionDr.Successor = migrationCounter;
     404     
     405      migrationCounter.Successor = selectforMigrationUssp;
     406      selectforMigrationUssp.Operator = emigrantSelector;
     407      emigrantSelector.Successor = null;
     408      selectforMigrationUssp.Successor = migrator;
     409
     410      migrator.Successor = replaceforMigrationUssp;
     411      replaceforMigrationUssp.Operator = immigrantSelector;
     412      immigrantSelector.Successor = null;
     413      replaceforMigrationUssp.Successor = globalAnalyzerPlacerholder;
     414
    387415      globalAnalyzerPlacerholder.Successor = groupingOperator;
    388416      groupingOperator.Operator = groupAnalyzer;
    389       groupAnalyzer.Successor = null;
     417      groupAnalyzer.Successor = groupLayerNumberResultsCollector;
     418      groupLayerNumberResultsCollector.Successor = null;
    390419      groupingOperator.Successor = groupResultsExtractor;
    391420      groupResultsExtractor.Successor = groupResultsCollector;
Note: See TracChangeset for help on using the changeset viewer.