24 #ifndef MSLCM_LC2013_h 25 #define MSLCM_LC2013_h 79 const std::pair<MSVehicle*, SUMOReal>& leader,
80 const std::pair<MSVehicle*, SUMOReal>& neighLead,
81 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
83 const std::vector<MSVehicle::LaneQ>& preb,
114 const std::pair<MSVehicle*, SUMOReal>& leader,
115 const std::pair<MSVehicle*, SUMOReal>& neighLead,
116 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
118 const std::vector<MSVehicle::LaneQ>& preb,
128 int blocked,
int dir,
129 const std::pair<MSVehicle*, SUMOReal>& neighLead,
134 int blocked,
int dir,
135 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
164 return dist / (
abs(laneOffset)) < lookForwardDist;
167 return dist /
abs(laneOffset) > lookForwardDist;
171 typedef std::pair<SUMOReal, int>
Info;
void saveBlockerLength(MSVehicle *blocker, int lcaCounter)
save space for vehicles which need to counter-lane-change
Representation of a vehicle in the micro simulation.
MSLCM_LC2013(MSVehicle &v)
int wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, SUMOReal > &leader, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
bool amBlockingFollower()
bool amBlockingFollowerNB()
SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)
Called to adapt the speed in order to allow a lane change.
The car-following model abstraction.
SUMOReal myKeepRightProbability
std::vector< SUMOReal > myVSafes
void informFollower(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, int dir, const std::pair< MSVehicle *, SUMOReal > &neighFollow, SUMOReal remainingSeconds, SUMOReal plannedSpeed)
decide whether we will try cut in before the follower or allow to be overtaken
void saveBlockerLength(SUMOReal length)
reserve space at the end of the lane to avoid dead locks
A class responsible for exchanging messages between cars involved in lane-change interaction.
bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist)
A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013...
bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist)
SUMOReal myLeadingBlockerLength
SUMOReal myLookAheadSpeed
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
int myOwnState
The current state of the vehicle.
SUMOReal informLeader(MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, int dir, const std::pair< MSVehicle *, SUMOReal > &neighLead, SUMOReal remainingSeconds)
std::pair< SUMOReal, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
int _wantsChange(int laneOffset, MSAbstractLaneChangeModel::MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, SUMOReal > &leader, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked)
helper function for doing the actual work
SUMOReal mySpeedGainProbability
a value for tracking the probability that a change to the offset with the same sign is beneficial ...
bool amBlockingFollowerPlusNB()
SUMOReal _patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)
void * inform(void *info, MSVehicle *sender)
Representation of a lane in the micro simulation.
Interface for lane-change models.