Skip to content

Commit

Permalink
Merge pull request #3484 from LBNL-UCB-STI/zn/remove-shared-teleporta…
Browse files Browse the repository at this point in the history
…tion-vehicles-after-trip

Remove shared teleportation vehicles for non-teleportation trips
  • Loading branch information
Xuan-1998 authored Mar 21, 2022
2 parents cb1df77 + f3ee1a4 commit 676c687
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/scala/beam/agentsim/agents/PersonAgent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,11 @@ class PersonAgent(
)
eventsManager.processEvent(teleportationEvent)

goto(ProcessingNextLegOrStartActivity) using data.copy(hasDeparted = true)
goto(ProcessingNextLegOrStartActivity) using data.copy(
hasDeparted = true,
currentVehicle = Vector.empty[Id[BeamVehicle]],
currentTourPersonalVehicle = None
)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,11 @@ trait ChoosesMode {

var availablePersonalStreetVehicles =
correctedCurrentTourMode match {
case None | Some(CAR | BIKE | HOV2_TELEPORTATION | HOV3_TELEPORTATION) =>
// In these cases, a personal vehicle will be involved
case None | Some(CAR | BIKE) =>
// In these cases, a personal vehicle will be involved, but filter out teleportation vehicles
newlyAvailableBeamVehicles.filterNot(v => BeamVehicle.isSharedTeleportationVehicle(v.id))
case Some(HOV2_TELEPORTATION | HOV3_TELEPORTATION) =>
// In these cases, also include teleportation vehicles
newlyAvailableBeamVehicles
case Some(DRIVE_TRANSIT | BIKE_TRANSIT) =>
val tour = _experiencedBeamPlan.getTourContaining(nextAct)
Expand Down

0 comments on commit 676c687

Please sign in to comment.