Jump to content

Recommended Posts

Posted

Need an algorithm to approximate the traveling time for a trip. For a shorter trip, under 120 miles time is based on miles, more than 120 miles it is adjusted by 10%

Posted

Need an algorithm to approximate the traveling time for a trip. For a shorter trip, under 120 miles time is based on miles, more than 120 miles it is adjusted by 10%

 

define "adjusted by 10%", is it that 10% is an error ?

Posted (edited)

the algorithm is simple then,

 

IF [math]DISTANCE < 120[/math] THEN [math]TIME = \frac{DISTANCE}{SPEED}[/math]

 

ELSE [math]TIME = [ \frac{DISTANCE}{SPEED} - \epsilon \; , \; \frac{DISTANCE}{SPEED} + \epsilon ][/math] END

 

.. where [math]\epsilon \; = \; 0.1 \times \frac{DISTANCE}{SPEED}[/math],

Edited by khaled
  • 4 weeks later...
Posted

Just curious here. Why only include the 10% safety margin for trips longer than 2 hours? The margin for error should apply for any distance.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.