diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 48546da05f7..9ee5e284d48 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -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 + ) } diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 56a885ad8cd..3f200e75ee1 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -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)