The default numGradientSamples was 1, which I believe would just make
this SteepestAscentHillClimber (without replacement). I changed it to
10. More importantly in the loop that runs numGradientSamples times I
added a check to see if terminate returns true, and if it does, it
breaks out of the loop. I changed the loop from a Number.times loop to
a for loop because after some searching it seems that break, continue,
and return commands are not allowed inside the Number.times method.