SUMO - Simulation of Urban MObility
|
#include <MSLink.h>
Data Structures | |
struct | ApproachingVehicleInformation |
A structure holding the information about vehicles approaching a link. More... | |
class | vehicle_in_request_finder |
Public Member Functions | |
void | addBlockedLink (MSLink *link) |
bool | blockedAtTime (SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed) const |
Returns the information whether this link is blocked Valid after the vehicles have set their requests. More... | |
const std::vector < ApproachingVehicleInformation > & | getApproaching () const |
LinkDirection | getDirection () const |
Returns the direction the vehicle passing this link take. More... | |
MSLane * | getLane () const |
Returns the connected lane. More... | |
SUMOReal | getLength () const |
Returns the length of this link. More... | |
unsigned int | getRespondIndex () const |
Returns the respond index (for visualization) More... | |
LinkState | getState () const |
Returns the current state of the link. More... | |
MSLane * | getViaLaneOrLane () const |
return the via lane if it exists and the lane otherwise More... | |
bool | hasApproachingFoe (SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal speed) const |
Returns the information whether a vehicle is approaching on one of the link's foe streams. More... | |
bool | havePriority () const |
Returns whether this link is a major link. More... | |
bool | isBlockingAnyone () const |
bool | isCont () const |
bool | isCrossing () const |
Returns whether this link belongs to a junction where more than one edge is incoming. More... | |
MSLink (MSLane *succLane, LinkDirection dir, LinkState state, SUMOReal length) | |
Constructor for simulation not using internal lanes. More... | |
bool | opened (SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength) const |
Returns the information whether the link may be passed. More... | |
void | removeApproaching (SUMOVehicle *veh) |
void | setApproaching (SUMOVehicle *approaching, SUMOTime arrivalTime, SUMOReal speed, bool setRequest) |
Sets the information about an approaching vehicle. More... | |
void | setRequestInformation (unsigned int requestIdx, unsigned int respondIdx, bool isCrossing, bool isCont, const std::vector< MSLink * > &foeLinks, const std::vector< MSLane * > &foeLanes) |
Sets the request information. More... | |
void | setTLState (LinkState state, SUMOTime t) |
Sets the current tl-state. More... | |
bool | willHaveBlockedFoe () const |
~MSLink () | |
Destructor. More... | |
Private Types | |
typedef std::vector < ApproachingVehicleInformation > | LinkApproachingVehicles |
Private Member Functions | |
MSLink (const MSLink &s) | |
invalidated copy constructor More... | |
MSLink & | operator= (const MSLink &s) |
invalidated assignment operator More... | |
Static Private Member Functions | |
static SUMOTime | safeHeadwayTime (SUMOReal leaderSpeed, SUMOReal followerSpeed) |
Private Attributes | |
bool | myAmCont |
LinkApproachingVehicles | myApproachingVehicles |
std::set< MSLink * > | myBlockedFoeLinks |
LinkDirection | myDirection |
An abstract (hopefully human readable) definition of the link's direction. More... | |
std::vector< MSLane * > | myFoeLanes |
std::vector< MSLink * > | myFoeLinks |
bool | myIsCrossing |
Whether any foe links exist. More... | |
MSLane * | myLane |
The lane approached by this link. More... | |
SUMOReal | myLength |
The length of the link. More... | |
unsigned int | myRequestIdx |
The position of the link within this request. More... | |
unsigned int | myRespondIdx |
The position within this respond. More... | |
LinkState | myState |
The state of the link. More... | |
Static Private Attributes | |
static SUMOTime | myLookaheadTime = TIME2STEPS(1) |
|
private |
MSLink::MSLink | ( | MSLane * | succLane, |
LinkDirection | dir, | ||
LinkState | state, | ||
SUMOReal | length | ||
) |
Constructor for simulation not using internal lanes.
[in] | succLane | The lane approached by this link |
[in] | dir | The direction of this link |
[in] | state | The state of this link |
[in] | length | The length of this link |
Definition at line 54 of file MSLink.cpp.
MSLink::~MSLink | ( | ) |
Destructor.
Definition at line 72 of file MSLink.cpp.
|
private |
invalidated copy constructor
void MSLink::addBlockedLink | ( | MSLink * | link | ) |
Definition at line 101 of file MSLink.cpp.
References myBlockedFoeLinks.
Returns the information whether this link is blocked Valid after the vehicles have set their requests.
[in] | arrivalTime | The arrivalTime of the vehicle who checks for an approaching foe |
[in] | leaveTime | The leaveTime of the vehicle who checks for an approaching foe |
[in] | speed | The speed with which the checking vehicle plans to leave the link |
Definition at line 158 of file MSLink.cpp.
References myApproachingVehicles, and safeHeadwayTime().
|
inline |
Definition at line 142 of file MSLink.h.
References myApproachingVehicles.
LinkDirection MSLink::getDirection | ( | ) | const |
Returns the direction the vehicle passing this link take.
Definition at line 225 of file MSLink.cpp.
References myDirection.
MSLane * MSLink::getLane | ( | ) | const |
Returns the connected lane.
Definition at line 237 of file MSLink.cpp.
References myLane.
Referenced by MSVehicle::checkRewindLinkLanes(), Command_SaveTLSSwitches::execute(), MSLinkContHelper::getConnectingLink(), TraCIServerAPI_TLS::processGet(), and TraCIServerAPI_Lane::processGet().
|
inline |
Returns the length of this link.
Definition at line 232 of file MSLink.h.
References myLength.
Referenced by opened(), TraCIServerAPI_Lane::processGet(), and setApproaching().
unsigned int MSLink::getRespondIndex | ( | ) | const |
Returns the respond index (for visualization)
Definition at line 265 of file MSLink.cpp.
References myRespondIdx.
|
inline |
Returns the current state of the link.
Definition at line 187 of file MSLink.h.
References myState.
Referenced by Command_SaveTLCoupledLaneDet::execute(), MSVehicle::moveChecked(), and GUILaneWrapper::ROWdrawAction_drawLinkRules().
MSLane * MSLink::getViaLaneOrLane | ( | ) | const |
return the via lane if it exists and the lane otherwise
Definition at line 251 of file MSLink.cpp.
References myLane.
Referenced by GUIVehicle::drawGLAdditional(), and MSVehicle::moveChecked().
Returns the information whether a vehicle is approaching on one of the link's foe streams.
Valid after the vehicles have set their requests
[in] | arrivalTime | The arrivalTime of the vehicle who checks for an approaching foe |
[in] | leaveTime | The leaveTime of the vehicle who checks for an approaching foe |
[in] | speed | The speed with which the checking vehicle plans to leave the link |
Definition at line 209 of file MSLink.cpp.
References myFoeLanes, and myFoeLinks.
Referenced by TraCIServerAPI_Lane::processGet().
|
inline |
Returns whether this link is a major link.
Definition at line 223 of file MSLink.h.
References myState.
Referenced by MSVehicle::checkRewindLinkLanes(), MSVehicle::moveChecked(), and TraCIServerAPI_Lane::processGet().
|
inline |
Definition at line 164 of file MSLink.h.
References myApproachingVehicles.
|
inline |
Definition at line 245 of file MSLink.h.
References myAmCont.
Referenced by MSVehicle::checkRewindLinkLanes(), MSVehicle::moveChecked(), and setRequestInformation().
|
inline |
Returns whether this link belongs to a junction where more than one edge is incoming.
Definition at line 240 of file MSLink.h.
References myIsCrossing.
Referenced by MSVehicle::checkRewindLinkLanes(), and setRequestInformation().
bool MSLink::opened | ( | SUMOTime | arrivalTime, |
SUMOReal | arrivalSpeed, | ||
SUMOReal | leaveSpeed, | ||
SUMOReal | vehicleLength | ||
) | const |
Returns the information whether the link may be passed.
Valid after the junctions have set their reponds
Definition at line 128 of file MSLink.cpp.
References getLength(), MSGlobals::gUseMesoSim, LINKSTATE_TL_RED, myAmCont, myFoeLanes, myFoeLinks, myState, and TIME2STEPS.
Referenced by MSVehicle::checkRewindLinkLanes(), MSVehicle::moveChecked(), and TraCIServerAPI_Lane::processGet().
void MSLink::removeApproaching | ( | SUMOVehicle * | veh | ) |
Definition at line 119 of file MSLink.cpp.
References myApproachingVehicles.
Referenced by MSVehicle::moveChecked().
Definition at line 183 of file MSLink.cpp.
References DEFAULT_VEH_DECEL, DEFAULT_VEH_MINGAP, SUMOReal, and TIME2STEPS.
Referenced by blockedAtTime().
void MSLink::setApproaching | ( | SUMOVehicle * | approaching, |
SUMOTime | arrivalTime, | ||
SUMOReal | speed, | ||
bool | setRequest | ||
) |
Sets the information about an approaching vehicle.
The information is stored in myApproachingVehicles.
Definition at line 89 of file MSLink.cpp.
References getLength(), MSVehicleType::getLengthWithGap(), SUMOVehicle::getVehicleType(), myApproachingVehicles, and TIME2STEPS.
void MSLink::setRequestInformation | ( | unsigned int | requestIdx, |
unsigned int | respondIdx, | ||
bool | isCrossing, | ||
bool | isCont, | ||
const std::vector< MSLink * > & | foeLinks, | ||
const std::vector< MSLane * > & | foeLanes | ||
) |
Sets the request information.
Because traffic lights and junction logics are loaded after links, we have to assign the information about the right-of-way requests and responses after the initialisation.
Definition at line 76 of file MSLink.cpp.
References isCont(), isCrossing(), myAmCont, myFoeLanes, myFoeLinks, myIsCrossing, myRequestIdx, and myRespondIdx.
Sets the current tl-state.
[in] | state | The current state of the link |
Definition at line 231 of file MSLink.cpp.
References myState.
Referenced by MSTrafficLightLogic::addLink().
bool MSLink::willHaveBlockedFoe | ( | ) | const |
Definition at line 108 of file MSLink.cpp.
References myBlockedFoeLinks.
|
private |
Definition at line 304 of file MSLink.h.
Referenced by isCont(), opened(), and setRequestInformation().
|
private |
Definition at line 283 of file MSLink.h.
Referenced by blockedAtTime(), getApproaching(), isBlockingAnyone(), removeApproaching(), and setApproaching().
|
private |
Definition at line 284 of file MSLink.h.
Referenced by addBlockedLink(), and willHaveBlockedFoe().
|
private |
An abstract (hopefully human readable) definition of the link's direction.
Definition at line 296 of file MSLink.h.
Referenced by getDirection().
|
private |
Definition at line 312 of file MSLink.h.
Referenced by hasApproachingFoe(), opened(), and setRequestInformation().
|
private |
Definition at line 311 of file MSLink.h.
Referenced by hasApproachingFoe(), opened(), and setRequestInformation().
|
private |
Whether any foe links exist.
Definition at line 302 of file MSLink.h.
Referenced by isCrossing(), and setRequestInformation().
|
private |
The lane approached by this link.
Definition at line 281 of file MSLink.h.
Referenced by getLane(), and getViaLaneOrLane().
|
private |
|
staticprivate |
|
private |
The position of the link within this request.
Definition at line 287 of file MSLink.h.
Referenced by setRequestInformation().
|
private |
The position within this respond.
Definition at line 290 of file MSLink.h.
Referenced by getRespondIndex(), and setRequestInformation().
|
private |
The state of the link.
Definition at line 293 of file MSLink.h.
Referenced by getState(), havePriority(), opened(), and setTLState().