-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
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
Use minimal example json to show how to import .json files #19
Comments
Using the larger example in #17. Will try on the minimal one also... |
Fixed the issue by multiplying by 1000 and making it an integer. Next issue is easier to debug:
|
PR incoming... |
Oops, should probably check JSON in the docs more carefully. Edit: got the file path wrong, it is not my day... |
Awesome. It works!
|
Wait I'm really not thinking clearly. The Scenario format and the |
Associated json below. Seem reasonable? {
"scenario_name": "monday",
"people": [
{
"trips": [
{
"departure": 391200000,
"origin": {
"Position": {
"longitude": -122.303723,
"latitude": 47.6372834
}
},
"destination": {
"Position": {
"longitude": -122.3190500,
"latitude": 47.6378600
}
},
"mode": "Drive",
"purpose": "Shopping"
},
{
"departure": 430800000,
"origin": {
"Position": {
"longitude": -122.3075948,
"latitude": 47.6394773
}
},
"destination": {
"Position": {
"longitude": -122.3190500,
"latitude": 47.6378600
}
},
"mode": "Walk",
"purpose": "Recreation"
}
]
}
]
} |
Although I would replace Drive with Bike as the distances are small. |
Is origin and destination swapped for the second trip? |
Looks like it... |
Also, when I import it nothing shows. Any ideas why? |
Reproducible example... cargo run --bin import_traffic -- \\n --map=data/system/us/seattle/maps/montlake.bin \\n --input=minimal_scenario.json
cargo run --bin game -- --dev data/system/us/seattle/maps/montlake.bin\n |
That's with: {
"scenario_name": "monday",
"people": [
{
"trips": [
{
"departure": 391200000,
"origin": {
"Position": {
"longitude": -122.303723,
"latitude": 47.6372834
}
},
"destination": {
"Position": {
"longitude": -122.3190500,
"latitude": 47.6378600
}
},
"mode": "Bike",
"purpose": "Shopping"
},
{
"departure": 430800000,
"origin": {
"Position": {
"longitude": -122.3190500,
"latitude": 47.6378600
}
},
"destination": {
"Position": {
"longitude": -122.3075948,
"latitude": 47.6394773
}
},
"mode": "Walk",
"purpose": "Recreation"
}
]
}
]
} as |
I've updated the times, e.g. to "departure": 10800000, |
It's working! Slightly random time but that's fine... |
Follow-up question, guess there's a simple question to this one, why don't they go by Bike as per the JSON (guess: there is not bike nearby or it's too near to cycle)? |
Apologies, they are biking 🎉 |
Update outdated json schema for #19
It's worth doing but currently I get the following error message:
The text was updated successfully, but these errors were encountered: