-
Notifications
You must be signed in to change notification settings - Fork 57
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
switch from walk to EMERGENCY(faster walk) as last resort mode #3488 #3512
base: develop
Are you sure you want to change the base?
Changes from all commits
3be093a
43bf1bb
11c3b67
ab9a612
5a0349e
fd74c6a
4999372
e5d228d
32e978d
c41bd1b
265f045
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,8 @@ object Modes { | |
|
||
case object HOV3_TELEPORTATION extends BeamMode(value = "hov3_teleportation", None, "") | ||
|
||
case object EMERGENCY extends BeamMode(value = "emergency", None, "") | ||
|
||
// Driving / Automobile-like (hailed rides are a bit of a hybrid) | ||
|
||
case object CAR extends BeamMode(value = "car", Some(Left(LegMode.CAR)), TransportMode.car) | ||
|
@@ -101,6 +103,13 @@ object Modes { | |
TransportMode.transit_walk | ||
) | ||
|
||
case object EMERGENCY_TRANSIT | ||
extends BeamMode( | ||
value = "emergency_transit", | ||
Some(Right(TransitModes.TRANSIT)), | ||
TransportMode.other | ||
) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need this |
||
case object DRIVE_TRANSIT | ||
extends BeamMode( | ||
value = "drive_transit", | ||
|
@@ -135,13 +144,15 @@ object Modes { | |
CAV, | ||
WALK, | ||
BIKE, | ||
EMERGENCY, | ||
TRANSIT, | ||
RIDE_HAIL, | ||
RIDE_HAIL_POOLED, | ||
RIDE_HAIL_TRANSIT, | ||
DRIVE_TRANSIT, | ||
WALK_TRANSIT, | ||
BIKE_TRANSIT, | ||
EMERGENCY_TRANSIT, | ||
HOV2_TELEPORTATION, | ||
HOV3_TELEPORTATION | ||
) | ||
|
@@ -234,6 +245,7 @@ object Modes { | |
case BeamMode.TRANSIT => throw new IllegalArgumentException("access vehicle is unknown") | ||
case BeamMode.WALK_TRANSIT => BeamMode.WALK | ||
case BeamMode.DRIVE_TRANSIT => BeamMode.CAR | ||
case BeamMode.EMERGENCY_TRANSIT => BeamMode.EMERGENCY | ||
case BeamMode.RIDE_HAIL_TRANSIT => BeamMode.CAR | ||
case BeamMode.BIKE_TRANSIT => BeamMode.BIKE | ||
case _ => throw new IllegalArgumentException("not a transit mode: " + mode.value) | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -10,6 +10,8 @@ import beam.router.Modes.BeamMode.{ | |||
CAR_HOV3, | ||||
CAV, | ||||
DRIVE_TRANSIT, | ||||
EMERGENCY, | ||||
EMERGENCY_TRANSIT, | ||||
HOV2_TELEPORTATION, | ||||
HOV3_TELEPORTATION, | ||||
RIDE_HAIL, | ||||
|
@@ -91,6 +93,7 @@ object EmbodiedBeamTrip { | |||
var hasUsedCar: Boolean = false | ||||
var hasUsedBike: Boolean = false | ||||
var hasUsedRideHail: Boolean = false | ||||
var hasUsedEmergency: Boolean = false | ||||
legs.foreach { leg => | ||||
// Any presence of transit makes it transit | ||||
if (leg.beamLeg.mode.isTransit) { | ||||
|
@@ -115,7 +118,10 @@ object EmbodiedBeamTrip { | |||
theMode = leg.beamLeg.mode | ||||
} else if (theMode == WALK && leg.beamLeg.mode == BIKE) { | ||||
theMode = leg.beamLeg.mode | ||||
} else if (theMode == WALK && leg.beamLeg.mode == EMERGENCY) { | ||||
theMode = EMERGENCY | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
} | ||||
if (leg.beamLeg.mode == EMERGENCY) hasUsedEmergency = true | ||||
if (leg.beamLeg.mode == BIKE) hasUsedBike = true | ||||
if (leg.beamLeg.mode == CAR) hasUsedCar = true | ||||
if (leg.isRideHail) hasUsedRideHail = true | ||||
|
@@ -126,6 +132,8 @@ object EmbodiedBeamTrip { | |||
DRIVE_TRANSIT | ||||
} else if (theMode == TRANSIT && hasUsedBike) { | ||||
BIKE_TRANSIT | ||||
} else if (theMode == TRANSIT && hasUsedEmergency) { | ||||
EMERGENCY_TRANSIT | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that it's safier not to change these method at all. But in this case we wouldn't have |
||||
} else if (theMode == TRANSIT && !hasUsedCar) { | ||||
WALK_TRANSIT | ||||
} else { | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a copy/paste error or something to that extent - as the condition is the same