protected void replaceWorstPoint(PointValuePair pointValuePair,final Comparator<PointValuePair> comparator){
  for (int i=0; i < dimension; i++) {
    if (comparator.compare(simplex[i],pointValuePair) > 0) {
      PointValuePair tmp=simplex[i];
      simplex[i]=pointValuePair;
      pointValuePair=tmp;
    }
  }
  simplex[dimension]=pointValuePair;
}

protected void replaceWorstPoint ( PointValuePair pointValuePair , final Comparator < PointValuePair > comparator ) { for ( int i = 0 ; i < dimension ; i ++ ) { if ( comparator . compare ( simplex [ i ] , pointValuePair ) > 0 ) { PointValuePair tmp = simplex [ i ] ; simplex [ i ] = pointValuePair ; pointValuePair = tmp ; } } simplex [ dimension ] = pointValuePair ; }
replace the worst point of the simplex by a new point .
