Skip to content

Commit 3d33d27

Browse files
committed
Document the new synthpop crate.
I regenerated some scenarios; no diff. The prebaked summaries change a bit, but not the prebaked results -- not sure, but going to proceed.
1 parent 638e93c commit 3d33d27

2 files changed

Lines changed: 29 additions & 15 deletions

File tree

synthpop/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//! This crate describes a synthetic population that exist in a map. Currently each person's travel
2+
//! behavior is modelled, but in the future, demographic and health attributes may be added.
3+
//! There's a variety of ways to create these populations, scattered in other crates.
4+
//!
5+
//! Note that "scenario" is the term currently used to describe the population. This will be
6+
//! renamed "soon."
7+
18
#[macro_use]
29
extern crate anyhow;
310
#[macro_use]
@@ -18,6 +25,10 @@ mod external;
1825
mod modifier;
1926
mod scenario;
2027

28+
/// How does a trip primarily happen?
29+
///
30+
/// Note most trips are "multi-modal" -- somebody has to walk a bit before and after parking their
31+
/// car.
2132
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy, PartialOrd, Ord)]
2233
pub enum TripMode {
2334
Walk,
@@ -85,6 +96,9 @@ impl TripMode {
8596
}
8697
}
8798

99+
/// This is an ID used by Seattle soundcast. Originally it was preserved for debugging, but that
100+
/// hasn't happened in a long time. Also the format is tied to Soundcast. Consider deleting /
101+
/// changing.
88102
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
89103
pub struct OrigPersonID(
90104
#[serde(

tests/goldenfiles/prebaked_summaries.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@
44
"scenario": "weekday",
55
"finished_trips": 76640,
66
"cancelled_trips": 0,
7-
"total_trip_duration_seconds": 48024585.70720022
7+
"total_trip_duration_seconds": 47737106.95530067
88
},
99
{
1010
"map": "montlake (in seattle (us))",
1111
"scenario": "weekday",
12-
"finished_trips": 36691,
13-
"cancelled_trips": 105,
14-
"total_trip_duration_seconds": 20310765.155799977
12+
"finished_trips": 36712,
13+
"cancelled_trips": 84,
14+
"total_trip_duration_seconds": 20395747.699100226
1515
},
1616
{
1717
"map": "center (in poundbury (gb))",
1818
"scenario": "base",
1919
"finished_trips": 8544,
2020
"cancelled_trips": 4,
21-
"total_trip_duration_seconds": 7875686.524899973
21+
"total_trip_duration_seconds": 7780561.138399997
2222
},
2323
{
2424
"map": "center (in poundbury (gb))",
2525
"scenario": "go_active",
26-
"finished_trips": 8550,
27-
"cancelled_trips": 8,
28-
"total_trip_duration_seconds": 9621742.610499995
26+
"finished_trips": 8551,
27+
"cancelled_trips": 7,
28+
"total_trip_duration_seconds": 9518172.528999992
2929
},
3030
{
3131
"map": "center (in poundbury (gb))",
3232
"scenario": "base_with_bg",
3333
"finished_trips": 23734,
3434
"cancelled_trips": 260,
35-
"total_trip_duration_seconds": 22688766.85819996
35+
"total_trip_duration_seconds": 22696565.403099943
3636
},
3737
{
3838
"map": "center (in poundbury (gb))",
3939
"scenario": "go_active_with_bg",
40-
"finished_trips": 23740,
41-
"cancelled_trips": 264,
42-
"total_trip_duration_seconds": 24443832.929799832
40+
"finished_trips": 23741,
41+
"cancelled_trips": 263,
42+
"total_trip_duration_seconds": 24462554.289699882
4343
},
4444
{
4545
"map": "parliament (in tehran (ir))",
4646
"scenario": "random people going to and from work",
47-
"finished_trips": 29049,
48-
"cancelled_trips": 16755,
49-
"total_trip_duration_seconds": 41895811.17699998
47+
"finished_trips": 29350,
48+
"cancelled_trips": 16734,
49+
"total_trip_duration_seconds": 42567421.81329996
5050
}
5151
]

0 commit comments

Comments
 (0)