Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4101 for trunk/sources


Ignore:
Timestamp:
07/25/10 01:26:56 (14 years ago)
Author:
abeham
Message:

#1101

  • Fixed real vector moves ignoring the bounds
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs

    r4068 r4101  
    6666        for (int i = 0; i < moves.Length; i++) {
    6767          AdditiveMove move = moves[i];
    68           if (vector[move.Dimension] < bounds[move.Dimension % bounds.Rows, 0])
     68          if (vector[move.Dimension] + move.MoveDistance < bounds[move.Dimension % bounds.Rows, 0])
    6969            vector[move.Dimension] = bounds[move.Dimension % bounds.Rows, 0];
    70           else if (vector[move.Dimension] > bounds[move.Dimension % bounds.Rows, 1])
     70          else if (vector[move.Dimension] + move.MoveDistance > bounds[move.Dimension % bounds.Rows, 1])
    7171            vector[move.Dimension] = bounds[move.Dimension % bounds.Rows, 1];
    7272        }
Note: See TracChangeset for help on using the changeset viewer.