Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13109


Ignore:
Timestamp:
11/03/15 15:17:13 (9 years ago)
Author:
pfleck
Message:

#2495

  • Renamed ClockwiseMigrationDirection ClockwiseMigration.
  • Removed access property.
  • Updated documentation comments.
Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs

    r13094 r13109  
    343343        // Set the migration direction to counterclockwise
    344344        var unidirectionalRing = migrator as UnidirectionalRingMigrator;
    345         if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigrationDirection = new BoolValue(false);
     345        if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigrationParameter.Value = new BoolValue(false);
    346346        MigratorParameter.ValidValues.Add(migrator);
    347347      }
  • trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r13094 r13109  
    409409        // Set the migration direction to counterclockwise
    410410        var unidirectionalRing = migrator as UnidirectionalRingMigrator;
    411         if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigrationDirection = new BoolValue(false);
     411        if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigrationParameter.Value = new BoolValue(false);
    412412        MigratorParameter.ValidValues.Add(migrator);
    413413      }
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/UnidirectionalRingMigrator.cs

    r13094 r13109  
    3535  [StorableClass]
    3636  public class UnidirectionalRingMigrator : SingleSuccessorOperator, IMigrator {
    37     public IValueLookupParameter<BoolValue> ClockwiseMigrationDirectionParameter {
    38       get { return (IValueLookupParameter<BoolValue>)Parameters["ClockwiseMigrationDirection"]; }
    39     }
    40 
    41     public BoolValue ClockwiseMigrationDirection
    42     {
    43       get { return ClockwiseMigrationDirectionParameter.Value; }
    44       set { ClockwiseMigrationDirectionParameter.Value = value; }
     37    public IValueLookupParameter<BoolValue> ClockwiseMigrationParameter {
     38      get { return (IValueLookupParameter<BoolValue>)Parameters["ClockwiseMigration"]; }
    4539    }
    4640
     
    5145    public UnidirectionalRingMigrator()
    5246      : base() {
    53       Parameters.Add(new ValueLookupParameter<BoolValue>("ClockwiseMigrationDirection", "True to migrate individuals clockwise, otherwise migrate individuals counterclockwise.", new BoolValue(true)));
     47      Parameters.Add(new ValueLookupParameter<BoolValue>("ClockwiseMigration", "True to migrate individuals clockwise, false to migrate individuals counterclockwise.", new BoolValue(true)));
    5448    }
    5549
     
    5852      // BackwardsCompatibility3.3
    5953      #region Backwards compatible code (remove with 3.4)
    60       if (!Parameters.ContainsKey("ClockwiseMigrationDirection")) {
    61         Parameters.Add(new ValueLookupParameter<BoolValue>("ClockwiseMigrationDirection", "True to migrate individuals clockwise, otherwise migrate individuals counterclockwise.", new BoolValue(false)));
     54      if (!Parameters.ContainsKey("ClockwiseMigration")) {
     55        Parameters.Add(new ValueLookupParameter<BoolValue>("ClockwiseMigration", "True to migrate individuals clockwise, false to migrate individuals counterclockwise.", new BoolValue(false)));
    6256      }
    6357      #endregion
     
    6862
    6963    /// <summary>
    70     /// Migrates every first sub scope of each child to its left neighbour (like a ring).
    71     /// <pre>                                                               
     64    /// Migrates every first sub scope of each child to its right or left neighbour (like a ring).
     65    /// If clockwise migration (default) is used the selected scopes A D G becomes G A D, contrary to counterclockwise where A D G becomes D G A.
     66    /// <pre>
    7267    ///          __ scope __              __ scope __
    7368    ///         /     |     \            /     |     \
     
    8176    /// <returns>The next operation.</returns>
    8277    public override IOperation Apply() {
    83       bool clockwise = ClockwiseMigrationDirectionParameter.ActualValue.Value;
     78      bool clockwise = ClockwiseMigrationParameter.ActualValue.Value;
    8479      IScope scope = ExecutionContext.Scope;
    8580      List<IScope> emigrantsList = new List<IScope>();
Note: See TracChangeset for help on using the changeset viewer.