My first stab at a hiking pace/time function in the Player class seems off. Try something more like this:
var timeTraveled = function(distance, elev0, elev1, land_cover) {
/** Calculate the time it takes for the hiker to travel a given distance. */
var toblersRule = function(slope) {
/** Calculate a hiker's pace in minutes per meter
https://en.wikipedia.org/wiki/Tobler's_hiking_function
*/
return 0.01 * Math.exp(3.5 * Math.abs(0.05 + slope));
}
var pace = toblersRule((elev1 - elev0) / 30.);
var land_cover_factor = 3 * (land_cover / 100.0);
return pace * distance * land_cover_factor;
}
My first stab at a hiking pace/time function in the
Player
class seems off. Try something more like this: