Changeset 13781


Ignore:
Timestamp:
04/21/16 15:30:02 (5 years ago)
Author:
pkuelzer
Message:

#2558 migration bug fixed, hopefully

Location:
branches/IslandALPS/IslandALPS/3.3
Files:
2 edited

Legend:

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

    r13777 r13781  
    576576    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
    577577      ParameterizeSelectors();
     578      ParametrizeMigration();
    578579    }
    579580
     
    604605
    605606    private void MigrationRate_ValueChanged(object sender, EventArgs e) {
    606       var migrationSize = (int)Math.Ceiling(MigrationRateParameter.Value.Value * PopulationSize.Value);
    607       foreach (var selector in EmigrantsSelectorParameter.ValidValues) {
    608         selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(migrationSize);
    609       }
     607      ParametrizeMigration();
    610608    }
    611609
     
    772770
    773771    private void ParametrizeMigration() {
    774       var migrationSize = (int) Math.Ceiling(MigrationRateParameter.Value.Value*PopulationSize.Value);
     772      var migrationSize = (int)Math.Ceiling(MigrationRateParameter.Value.Value * PopulationSize.Value);
     773      EmigrantsSelectorParameter.ValidValues.Clear();
    775774      foreach (var selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) {
    776775        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(migrationSize);
     
    782781      }
    783782
     783      ImmigrationReplacerParameter.ValidValues.Clear();
    784784      foreach (var replacer in ApplicationManager.Manager.GetInstances<IReplacer>().OrderBy(x => x.Name)) {
    785785        ParameterizeStochasticOperatorForLayer(replacer);
     
    787787      }
    788788
     789      MigratorParameter.ValidValues.Clear();
    789790      MigratorParameter.ValidValues.Add(new LayerMigrator());
    790791    }
  • branches/IslandALPS/IslandALPS/3.3/Offspring Selection/IslandAlpsOffspringSelectionAlgorithm.cs

    r13778 r13781  
    546546
    547547    private void MigrationRate_ValueChanged(object sender, EventArgs e) {
    548       var migrationSize = (int)Math.Ceiling(MigrationRateParameter.Value.Value * PopulationSize.Value);
    549       foreach (var selector in EmigrantsSelectorParameter.ValidValues) {
    550         selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(migrationSize);
    551       }
     548      ParametrizeMigration();
    552549    }
    553550
     
    626623    private void PopulationSize_ValueChanged(object sender, EventArgs e) {
    627624      ParameterizeSelectors();
     625      ParametrizeMigration();
    628626    }
    629627
     
    795793    private void ParametrizeMigration() {
    796794      var migrationSize = (int) Math.Ceiling(MigrationRateParameter.Value.Value*PopulationSize.Value);
     795      EmigrantsSelectorParameter.ValidValues.Clear();
    797796      foreach (var selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) {
    798797        selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(migrationSize);
     
    804803      }
    805804
     805      ImmigrationReplacerParameter.ValidValues.Clear();
    806806      foreach (var replacer in ApplicationManager.Manager.GetInstances<IReplacer>().OrderBy(x => x.Name)) {
    807807        ParameterizeStochasticOperatorForLayer(replacer);
     
    809809      }
    810810
     811      MigratorParameter.ValidValues.Clear();
    811812      MigratorParameter.ValidValues.Add(new LayerMigrator());
    812813    }
Note: See TracChangeset for help on using the changeset viewer.