We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can see in the src how each trip in trips.json is assembled:
src
trips.json
trip-simulator/src/agent.js
Lines 183 to 184 in a1497e6
Where does the 1000 constant in the denominator come from? I think it's related to the stepSize from the simulation being hardcoded to 1000:
stepSize
trip-simulator/src/simulation.js
Line 18 in a1497e6
If so, are the trip_duration and trip_distance values the in seconds and meters, respectively?
trip_duration
trip_distance
I ask because I'd assume the time would converted /60 (min) /360 (hrs), so wondering where the 1000 is coming from.
Same question roughly with distance value.
The text was updated successfully, but these errors were encountered:
this.path = await this.simulation.route(this.location, destination);
OSRM returns a duration float, in seconds. You factor rate * time and then factor by 1000 to get distance in meters since rate in kmph.
So that would be total distance covered, right? And, if so, then why re-divide by 1000 only to compute duration for completed trip?
I feel like I am missing just one step in the logic as I am reading through it 🤔
Sorry, something went wrong.
No branches or pull requests
I can see in the
src
how each trip intrips.json
is assembled:trip-simulator/src/agent.js
Lines 183 to 184 in a1497e6
Where does the 1000 constant in the denominator come from? I think it's related to the
stepSize
from the simulation being hardcoded to 1000:trip-simulator/src/simulation.js
Line 18 in a1497e6
If so, are the
trip_duration
andtrip_distance
values the in seconds and meters, respectively?I ask because I'd assume the time would converted /60 (min) /360 (hrs), so wondering where the 1000 is coming from.
Same question roughly with distance value.
The text was updated successfully, but these errors were encountered: