Changeset 5381 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
- Timestamp:
- 01/26/11 18:39:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
r4722 r5381 65 65 public override IOperation Apply() { 66 66 RealVector vector = RealVectorParameter.ActualValue; 67 AdditiveMove[] moves = GenerateMoves(RandomParameter.ActualValue, vector);68 67 DoubleMatrix bounds = BoundsParameter.ActualValue; 69 if (bounds != null) { 70 for (int i = 0; i < moves.Length; i++) { 71 AdditiveMove move = moves[i]; 72 if (vector[move.Dimension] + move.MoveDistance < bounds[move.Dimension % bounds.Rows, 0]) 73 vector[move.Dimension] = bounds[move.Dimension % bounds.Rows, 0]; 74 else if (vector[move.Dimension] + move.MoveDistance > bounds[move.Dimension % bounds.Rows, 1]) 75 vector[move.Dimension] = bounds[move.Dimension % bounds.Rows, 1]; 76 } 77 } 68 AdditiveMove[] moves = GenerateMoves(RandomParameter.ActualValue, vector, bounds); 78 69 Scope[] moveScopes = new Scope[moves.Length]; 79 70 for (int i = 0; i < moveScopes.Length; i++) { … … 85 76 } 86 77 87 protected abstract AdditiveMove[] GenerateMoves(IRandom random, RealVector realVector );78 protected abstract AdditiveMove[] GenerateMoves(IRandom random, RealVector realVector, DoubleMatrix bounds); 88 79 } 89 80 }
Note: See TracChangeset
for help on using the changeset viewer.