Changeset 13109
- Timestamp:
- 11/03/15 15:17:13 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r13094 r13109 343 343 // Set the migration direction to counterclockwise 344 344 var unidirectionalRing = migrator as UnidirectionalRingMigrator; 345 if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigration Direction= new BoolValue(false);345 if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigrationParameter.Value = new BoolValue(false); 346 346 MigratorParameter.ValidValues.Add(migrator); 347 347 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r13094 r13109 409 409 // Set the migration direction to counterclockwise 410 410 var unidirectionalRing = migrator as UnidirectionalRingMigrator; 411 if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigration Direction= new BoolValue(false);411 if (unidirectionalRing != null) unidirectionalRing.ClockwiseMigrationParameter.Value = new BoolValue(false); 412 412 MigratorParameter.ValidValues.Add(migrator); 413 413 } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UnidirectionalRingMigrator.cs
r13094 r13109 35 35 [StorableClass] 36 36 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"]; } 45 39 } 46 40 … … 51 45 public UnidirectionalRingMigrator() 52 46 : base() { 53 Parameters.Add(new ValueLookupParameter<BoolValue>("ClockwiseMigration Direction", "True to migrate individuals clockwise, otherwisemigrate 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))); 54 48 } 55 49 … … 58 52 // BackwardsCompatibility3.3 59 53 #region Backwards compatible code (remove with 3.4) 60 if (!Parameters.ContainsKey("ClockwiseMigration Direction")) {61 Parameters.Add(new ValueLookupParameter<BoolValue>("ClockwiseMigration Direction", "True to migrate individuals clockwise, otherwisemigrate 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))); 62 56 } 63 57 #endregion … … 68 62 69 63 /// <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> 72 67 /// __ scope __ __ scope __ 73 68 /// / | \ / | \ … … 81 76 /// <returns>The next operation.</returns> 82 77 public override IOperation Apply() { 83 bool clockwise = ClockwiseMigration DirectionParameter.ActualValue.Value;78 bool clockwise = ClockwiseMigrationParameter.ActualValue.Value; 84 79 IScope scope = ExecutionContext.Scope; 85 80 List<IScope> emigrantsList = new List<IScope>();
Note: See TracChangeset
for help on using the changeset viewer.