tmcgee94 Posted October 3, 2011 Share Posted October 3, 2011 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% Link to comment Share on other sites More sharing options...
insane_alien Posted October 3, 2011 Share Posted October 3, 2011 time = distance/ speed Link to comment Share on other sites More sharing options...
khaled Posted October 4, 2011 Share Posted October 4, 2011 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 ? Link to comment Share on other sites More sharing options...
insane_alien Posted October 4, 2011 Share Posted October 4, 2011 safety margin. the longer a journey, the more likely you will encounter delays Link to comment Share on other sites More sharing options...
khaled Posted October 5, 2011 Share Posted October 5, 2011 (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 October 5, 2011 by khaled Link to comment Share on other sites More sharing options...
Faz Posted October 30, 2011 Share Posted October 30, 2011 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now