private static double acceptanceProbability(double oldCost,double newCost,double temp){
  return newCost < oldCost ? 1.0 : Math.exp(-(newCost - oldCost) / temp);
}

private static double acceptanceProbability ( double oldCost , double newCost , double temp ) { return newCost < oldCost ? 1.0 : Math . exp ( - ( newCost - oldCost ) / temp ) ; }
if the new cost is better than old , return 1 . 0 . otherwise , return a double that increases as the two costs are closer to each other .
