private int hammingDistance(BinarySolution solutionOne, BinarySolution solutionTwo) {
    int distance = 0;
    for (int i = 0; i < problem.getNumberOfVariables(); i++) {
      distance += hammingDistance(solutionOne.getVariableValue(i), solutionTwo.getVariableValue(i));
    }

    return distance;
  }
private int hammingDistance ( BinarySolution solutionOne , BinarySolution solutionTwo ) { int distance = 0 ; for ( int i = 0 ; i < problem . getNumberOfVariables ( ) ; i ++ ) { distance += hammingDistance ( solutionOne . getVariableValue ( i ) , solutionTwo . getVariableValue ( i ) ) ; } return distance ; }
Calculate the hamming distance between two solutions

@param solutionOne A <code>Solution</code>
@param solutionTwo A <code>Solution</code>
@return the hamming distance between solutions