Implementing the Nelder-Mead simplex algorithm with adaptive parameters