From dcf720d439a7fbf7c62a2350c44b3623d0feab15 Mon Sep 17 00:00:00 2001 From: dabreegster Date: Fri, 4 Sep 2020 18:37:30 +0000 Subject: [PATCH] deploy: 193a3b15153ca643d456b1219de80d060eb0ae74 --- .../built_info/constant.BUILT_TIME_UTC.html | 2 +- .../sim/make/activity_model/fn.rand_time.html | 2 +- .../activity_model/fn.select_trip_mode.html | 2 +- rustdoc/sim/make/activity_model/index.html | 2 +- .../game-3c7487281029702d/out/built.rs.html | 2 +- rustdoc/src/sim/make/activity_model.rs.html | 32 +++++++++++++------ 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html b/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html index 35b4604bfb..a8d3100acd 100644 --- a/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html +++ b/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html @@ -1,2 +1,2 @@ -game::pregame::built_info::BUILT_TIME_UTC - Rust

[][src]Constant game::pregame::built_info::BUILT_TIME_UTC

pub const BUILT_TIME_UTC: &str = "Fri, 04 Sep 2020 18:27:07 +0000";

The built-time in RFC2822, UTC

+game::pregame::built_info::BUILT_TIME_UTC - Rust

[][src]Constant game::pregame::built_info::BUILT_TIME_UTC

pub const BUILT_TIME_UTC: &str = "Fri, 04 Sep 2020 18:34:28 +0000";

The built-time in RFC2822, UTC

\ No newline at end of file diff --git a/rustdoc/sim/make/activity_model/fn.rand_time.html b/rustdoc/sim/make/activity_model/fn.rand_time.html index f2c414b0cb..4fb06a9abc 100644 --- a/rustdoc/sim/make/activity_model/fn.rand_time.html +++ b/rustdoc/sim/make/activity_model/fn.rand_time.html @@ -1 +1 @@ -sim::make::activity_model::rand_time - Rust

[][src]Function sim::make::activity_model::rand_time

fn rand_time(rng: &mut XorShiftRng, low: Time, high: Time) -> Time
\ No newline at end of file +sim::make::activity_model::rand_time - Rust

[][src]Function sim::make::activity_model::rand_time

fn rand_time(rng: &mut XorShiftRng, low: Time, high: Time) -> Time
\ No newline at end of file diff --git a/rustdoc/sim/make/activity_model/fn.select_trip_mode.html b/rustdoc/sim/make/activity_model/fn.select_trip_mode.html index f6b608e586..0bb9c7ce9d 100644 --- a/rustdoc/sim/make/activity_model/fn.select_trip_mode.html +++ b/rustdoc/sim/make/activity_model/fn.select_trip_mode.html @@ -1 +1 @@ -sim::make::activity_model::select_trip_mode - Rust

[][src]Function sim::make::activity_model::select_trip_mode

fn select_trip_mode(distance: Distance, rng: &mut XorShiftRng) -> TripMode
\ No newline at end of file +sim::make::activity_model::select_trip_mode - Rust

[][src]Function sim::make::activity_model::select_trip_mode

fn select_trip_mode(distance: Distance, rng: &mut XorShiftRng) -> TripMode
\ No newline at end of file diff --git a/rustdoc/sim/make/activity_model/index.html b/rustdoc/sim/make/activity_model/index.html index 3d0c52714a..18d00ec203 100644 --- a/rustdoc/sim/make/activity_model/index.html +++ b/rustdoc/sim/make/activity_model/index.html @@ -1,2 +1,2 @@ -sim::make::activity_model - Rust

[][src]Module sim::make::activity_model

Functions

+sim::make::activity_model - Rust

[][src]Module sim::make::activity_model

Functions

border_person
rand_time
robot_person
select_trip_mode
\ No newline at end of file diff --git a/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-3c7487281029702d/out/built.rs.html b/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-3c7487281029702d/out/built.rs.html index 2b6ef8fe58..b3a50d9ac9 100644 --- a/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-3c7487281029702d/out/built.rs.html +++ b/rustdoc/src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-3c7487281029702d/out/built.rs.html @@ -111,7 +111,7 @@ /// The output of `rustdoc -V` pub const RUSTDOC_VERSION: &str = "rustdoc 1.46.0 (04488afe3 2020-08-24)"; /// The built-time in RFC2822, UTC -pub const BUILT_TIME_UTC: &str = "Fri, 04 Sep 2020 18:27:07 +0000"; +pub const BUILT_TIME_UTC: &str = "Fri, 04 Sep 2020 18:34:28 +0000"; /// The target architecture, given by `cfg!(target_arch)`. pub const CFG_TARGET_ARCH: &str = "x86_64"; /// The endianness, given by `cfg!(target_endian)`. diff --git a/rustdoc/src/sim/make/activity_model.rs.html b/rustdoc/src/sim/make/activity_model.rs.html index 8481d6c8d4..a3b3686edc 100644 --- a/rustdoc/src/sim/make/activity_model.rs.html +++ b/rustdoc/src/sim/make/activity_model.rs.html @@ -257,6 +257,12 @@ 257 258 259 +260 +261 +262 +263 +264 +265
 use crate::{
     IndividTrip, PersonID, PersonSpec, Scenario, ScenarioGenerator, SpawnTrip, TripEndpoint,
@@ -483,25 +489,20 @@
 fn select_trip_mode(distance: Distance, rng: &mut XorShiftRng) -> TripMode {
     // TODO Make this probabilistic
     // for example probability of walking currently has massive differences
-    // at thresholds, it would be nicer to change this graduall
+    // at thresholds, it would be nicer to change this gradually
     // TODO - do not select based on distance but select one that is fastest/best in the
     // given situation excellent bus connection / plenty of parking /
     // cycleways / suitable rail connection all strongly influence
     // selected mode of transport, distance is not the sole influence
     // in some cities there may case where driving is only possible method
     // to get somewhere, even at a short distance
+
+    // Always walk for really short trips
     if distance < Distance::miles(0.5) {
         return TripMode::Walk;
     }
-    if rng.gen_bool(0.005) {
-        // low chance for really, really dedicated cyclists
-        return TripMode::Bike;
-    }
-    if rng.gen_bool(0.3) {
-        // try transit if available, will
-        // degrade into walk if not available
-        return TripMode::Transit;
-    }
+
+    // Sometimes bike or walk for moderate trips
     if distance < Distance::miles(3.0) {
         if rng.gen_bool(0.15) {
             return TripMode::Bike;
@@ -510,6 +511,17 @@
             return TripMode::Walk;
         }
     }
+
+    // For longer trips, maybe bike for dedicated cyclists
+    if rng.gen_bool(0.005) {
+        return TripMode::Bike;
+    }
+    // Try transit if available, or fallback to walking
+    if rng.gen_bool(0.3) {
+        return TripMode::Transit;
+    }
+
+    // Most of the time, just drive
     TripMode::Drive
 }