24 #ifndef MSLCM_LC2013_h 25 #define MSLCM_LC2013_h 44 #define INVALID_SPEED 299792458 + 1 // nothing can go faster than the speed of light! 87 const std::pair<MSVehicle*, SUMOReal>& leader,
88 const std::pair<MSVehicle*, SUMOReal>& neighLead,
89 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
91 const std::vector<MSVehicle::LaneQ>& preb,
122 const std::pair<MSVehicle*, SUMOReal>& leader,
123 const std::pair<MSVehicle*, SUMOReal>& neighLead,
124 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
126 const std::vector<MSVehicle::LaneQ>& preb,
135 int blocked,
int dir,
136 const std::pair<MSVehicle*, SUMOReal>& neighLead,
141 int blocked,
int dir,
142 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
174 SUMOReal& roundaboutDistanceAhead,
SUMOReal& roundaboutDistanceAheadNeigh,
int& roundaboutEdgesAhead,
int& roundaboutEdgesAheadNeigh);
214 return dist / (
abs(laneOffset)) < lookForwardDist;
217 return dist /
abs(laneOffset) > lookForwardDist;
221 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.
const SUMOReal myChangeProbThresholdRight
The car-following model abstraction.
SUMOReal myKeepRightProbability
const SUMOReal myKeepRightParam
const SUMOReal myChangeProbThresholdLeft
static void getRoundaboutAheadInfo(const MSLCM_LC2013 *lcm, const MSVehicle::LaneQ &curr, const MSVehicle::LaneQ &neigh, SUMOReal &roundaboutDistanceAhead, SUMOReal &roundaboutDistanceAheadNeigh, int &roundaboutEdgesAhead, int &roundaboutEdgesAheadNeigh)
computes the distance and number of edges in the next upcoming roundabout along the lane continuation...
std::vector< SUMOReal > myVSafes
const SUMOReal myCooperativeParam
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
const SUMOReal myStrategicParam
bool debugVehicle() const
whether the current vehicles shall be debugged
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 roundaboutDistBonus(SUMOReal roundaboutDistAhead, int roundaboutEdgesAhead) const
Computes the artificial bonus distance for roundabout lanes this additional distance reduces the sens...
SUMOReal myLeadingBlockerLength
SUMOReal myLookAheadSpeed
static SUMOReal overtakeDistance(const MSVehicle *follower, const MSVehicle *leader, const SUMOReal gap, SUMOReal followerSpeed=INVALID_SPEED, SUMOReal leaderSpeed=INVALID_SPEED)
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
A structure representing the best lanes for continuing the route.
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
static SUMOReal distanceAlongNextRoundabout(SUMOReal position, const MSLane *initialLane, const std::vector< MSLane *> &continuationLanes)
compute the distance on the next upcoming roundabout along a given sequence of lanes.
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.
const SUMOReal mySpeedGainParam
Interface for lane-change models.