20 #ifndef MSLCM_SL2015_h 21 #define MSLCM_SL2015_h 80 const std::vector<MSVehicle::LaneQ>& preb,
125 const std::vector<MSVehicle::LaneQ>& preb,
136 const std::vector<CLeaderDist>& blockers,
141 const std::vector<CLeaderDist>& blockers,
184 return dist / (
abs(laneOffset)) < lookForwardDist;
187 return dist /
abs(laneOffset) > lookForwardDist;
191 typedef std::pair<SUMOReal, int>
Info;
222 std::vector<CLeaderDist>* collectLeadBlockers = 0,
223 std::vector<CLeaderDist>* collectFollowBlockers = 0,
224 bool keepLatGapManeuver =
false);
229 std::vector<CLeaderDist>* collectBlockers = 0)
const;
240 const std::vector<MSVehicle::LaneQ>& preb,
250 int roundaboutEdgesAhead
void * inform(void *info, MSVehicle *sender)
void informFollower(int blocked, int dir, const CLeaderDist &neighFollow, SUMOReal remainingSeconds, SUMOReal plannedSpeed)
decide whether we will try cut in before the follower or allow to be overtaken
void informFollowers(int blocked, int dir, const std::vector< CLeaderDist > &blockers, SUMOReal remainingSeconds, SUMOReal plannedSpeed)
call informFollower for multiple followers
A lane change model developed by J. Erdmann.
SUMOReal myKeepRightProbability
int keepLatGap(int state, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, int laneOffset, SUMOReal &latDist, int &blocked)
check whether lateral gap requirements are met override the current maneuver if necessary ...
saves leader/follower vehicles and their distances relative to an ego vehicle
Representation of a vehicle in the micro simulation.
SUMOReal informLeader(int blocked, int dir, const CLeaderDist &neighLead, SUMOReal remainingSeconds)
SUMOReal myOrigLatDist
the complete lateral distance the vehicle wants to travel to finish its maneuver
std::vector< SUMOReal > myVSafes
speed adaptation requests by ego and surrounding vehicles
const SUMOReal myAssertive
void msg(const CLeaderDist &cld, SUMOReal speed, int state)
send a speed recommendation to the given vehicle
bool myCanChangeFully
whether the current lane changing meneuver can be finished in a single step
The car-following model abstraction.
bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist)
static CLeaderDist getSlowest(const MSLeaderDistanceInfo &ldi)
get the slowest vehicle in the given info
std::pair< const MSVehicle *, SUMOReal > CLeaderDist
int checkBlockingVehicles(const MSVehicle *ego, const MSLeaderDistanceInfo &vehicles, SUMOReal latDist, SUMOReal foeOffset, bool leaders, LaneChangeAction blockType, std::vector< CLeaderDist > *collectBlockers=0) const
check whether any of the vehicles overlaps with ego
void updateExpectedSublaneSpeeds(const MSLeaderInfo &ahead, int sublaneOffset, int laneIndex)
update expected speeds for each sublane of the current edge
bool debugVehicle() const
whether the current vehicles shall be debugged
bool amBlockingFollower()
MSLCM_SL2015(MSVehicle &v)
void saveBlockerLength(const MSVehicle *blocker, int lcaCounter)
save space for vehicles which need to counter-lane-change
StateAndDist decideDirection(StateAndDist sd1, StateAndDist sd2) const
decide in which direction to move in case both directions are desirable
A road/street connecting two junctions.
SUMOReal myLeadingBlockerLength
static bool overlap(SUMOReal right, SUMOReal left, SUMOReal right2, SUMOReal left2)
return whether the given intervals overlap
SUMOReal informLeaders(int blocked, int dir, const std::vector< CLeaderDist > &blockers, SUMOReal remainingSeconds)
std::vector< SUMOReal > myExpectedSublaneSpeeds
expected travel speeds on all sublanes on the current edge(!)
const MSEdge * myLastEdge
expected travel speeds on all sublanes on the current edge(!)
int wantsChangeSublane(int laneOffset, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked, SUMOReal &latDist, int &blocked)
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
const SUMOReal myChangeProbThresholdLeft
bool amBlockingFollowerNB()
int checkBlocking(const MSLane &neighLane, SUMOReal &latDist, int laneOffset, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, std::vector< CLeaderDist > *collectLeadBlockers=0, std::vector< CLeaderDist > *collectFollowBlockers=0, bool keepLatGapManeuver=false)
restrict latDist to permissible speed and determine blocking state depending on that distance ...
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.
std::pair< SUMOReal, int > Info
information regarding save velocity (unused) and state flags of the ego vehicle
SUMOReal myLookAheadSpeed
int _wantsChangeSublane(int laneOffset, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked, SUMOReal &latDist, int &blocked)
helper function for doing the actual work
SUMOReal _patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)
int myOwnState
The current state of the vehicle.
static CLeaderDist getLongest(const MSLeaderDistanceInfo &ldi)
get the longest vehicle in the given info
int checkStrategicChange(int ret, int laneOffset, const std::vector< MSVehicle::LaneQ > &preb, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &neighLeaders, int currIdx, int bestLaneOffset, bool changeToBest, int lcaCounter, SUMOReal currentDist, SUMOReal neighDist, SUMOReal laDist, int roundaboutEdgesAhead)
compute strategic lane change actions
LaneChangeAction
The state of a vehicle's lane-change behavior.
const SUMOReal myCooperativeParam
int slowDownForBlocked(MSVehicle **blocked, int state)
compute useful slowdowns for blocked vehicles
SUMOReal mySpeedGainProbabilityRight
a value for tracking the probability that a change to the right is beneficial
const SUMOReal mySublaneParam
const SUMOReal myStrategicParam
bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist)
void updateGaps(const MSLeaderDistanceInfo &others, SUMOReal foeOffset, SUMOReal newCenter, SUMOReal gapFactor, SUMOReal &surplusGapRight, SUMOReal &surplusGapLeft) const
check remaining lateral gaps for the given foe vehicles
const SUMOReal mySpeedGainParam
void setOwnState(int state)
void saveBlockerLength(SUMOReal length)
reserve space at the end of the lane to avoid dead locks
bool myDontBrake
flag to prevent speed adaptation by slowing down
const SUMOReal myKeepRightParam
const SUMOReal myChangeProbThresholdRight
const SUMOReal mySpeedLossProbThreshold
static LaneChangeAction getLCA(int state, SUMOReal latDist)
compute lane change action from desired lateral distance
Representation of a lane in the micro simulation.
int myPreviousState
lane changing state from the previous simulation step
int computeSublaneShift(const MSEdge *prevEdge, const MSEdge *curEdge)
compute shift so that prevSublane + shift = newSublane
SUMOReal mySpeedGainProbabilityLeft
a value for tracking the probability that a change to the left is beneficial
Interface for lane-change models.
bool amBlockingFollowerPlusNB()