71 const std::vector<MSVehicle::LaneQ>& preb,
73 double& maneuverDist)
const;
81 const std::pair<MSVehicle* const, double>& leader,
82 const std::pair<MSVehicle* const, double>& neighLead,
83 const std::pair<MSVehicle* const, double>& neighFollow,
84 const std::vector<MSVehicle::LaneQ>& preb);
LaneChangeAction
The state of a vehicle's lane-change behavior.
Performs lane changing of vehicles.
Changer::iterator ChangerIt
the iterator moving over the ChangeElems
Performs lane changing of vehicles.
bool startChangeSublane(MSVehicle *vehicle, ChangerIt &from, double latDist, double maneuverDist)
change by the specified amount and return whether a new lane was entered
bool checkChangeToNewLane(MSVehicle *vehicle, const int direction, ChangerIt from, ChangerIt to)
check whether the given vehicle has entered the new lane 'to->lane' during a sublane LC-step
void outputLCStarted(MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction, double maneuverDist)
optional output for start of lane-change maneuvre
MSLaneChangerSublane(const MSLaneChangerSublane &)
Copy constructor.
void addOutsideLeaders(const MSVehicle *vehicle, MSLeaderDistanceInfo &leaders) const
~MSLaneChangerSublane()
Destructor.
MSLeaderDistanceInfo getLeaders(const ChangerIt &target, const MSVehicle *ego) const
get leaders for ego on the given lane
StateAndDist checkChangeHelper(MSVehicle *vehicle, int laneOffset, LaneChangeAction alternatives)
helper function that calls checkChangeSublane and sets blocker information
static std::pair< MSVehicle *, double > findClosestLeader(const MSLeaderDistanceInfo &leaders, const MSVehicle *vehicle)
find the closest leader that prevents ego vehicle from passing on the current lane
bool myCheckedChangeOpposite
whether checkChangeOpposite was called for the current vehicle
virtual void initChanger()
Initialize the changer before looping over all vehicles.
bool checkChangeOpposite(MSVehicle *vehicle, int laneOffset, MSLane *targetLane, const std::pair< MSVehicle *const, double > &leader, const std::pair< MSVehicle *const, double > &neighLead, const std::pair< MSVehicle *const, double > &neighFollow, const std::vector< MSVehicle::LaneQ > &preb)
virtual void updateChanger(bool vehHasChanged)
void abortLCManeuver(MSVehicle *vehicle)
immediately stop lane-changing and register vehicle as unchanged
MSLaneChangerSublane()
Default constructor.
void outputLCEnded(MSVehicle *vehicle, ChangerIt &from, ChangerIt &to, int direction)
optional output for end of lane-change maneuvre
MSAbstractLaneChangeModel::StateAndDist StateAndDist
int checkChangeSublane(int laneOffset, LaneChangeAction alternatives, const std::vector< MSVehicle::LaneQ > &preb, double &latDist, double &maneuverDist) const
check whether sub-lane changing in the given direction is desirable and possible
bool continueChangeSublane(MSVehicle *vehicle, ChangerIt &from)
Continue a sublane-lane change maneuver and return whether the midpoint was passed in this step.
MSLaneChangerSublane & operator=(const MSLaneChangerSublane &)
Assignment operator.
Representation of a lane in the micro simulation.
saves leader/follower vehicles and their distances relative to an ego vehicle
Representation of a vehicle in the micro simulation.