SUMO - Simulation of Urban MObility
MSLane Class Reference

Representation of a lane in the micro simulation. More...

#include <MSLane.h>

Inheritance diagram for MSLane:
Inheritance graph
Collaboration diagram for MSLane:
Collaboration graph

Data Structures

class  by_connections_to_sorter
 
class  edge_finder
 
struct  IncomingLaneInfo
 
class  vehicle_position_sorter
 Sorts vehicles by their position (descending) More...
 
struct  VehPosition
 

Public Types

typedef std::vector< MSVehicle * > VehCont
 Container for vehicles. More...
 

Public Member Functions

void addApproachingLane (MSLane *lane, bool warnMultiCon)
 
void addIncomingLane (MSLane *lane, MSLink *viaLink)
 
void addParameter (const std::string &key, const std::string &value)
 Adds a parameter. More...
 
void addParameter (const std::map< std::string, std::string > &mapArg)
 Adds all given parameter. More...
 
void addParameter (const Parameterised &p)
 Adds all given parameter. More...
 
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
bool allowsVehicleClass (SUMOVehicleClass vclass) const
 
virtual bool appropriate (const MSVehicle *veh)
 
void clearParameter ()
 Clears the parameter map. More...
 
virtual void detectCollisions (SUMOTime timestep, const std::string &stage)
 Check if vehicles are too close. More...
 
bool empty () const
 Returns true if there is not a single vehicle on the lane. More...
 
void enteredByLaneChange (MSVehicle *v)
 
std::pair< MSVehicle *const, SUMORealgetCriticalLeader (SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle &veh) const
 Returns the most dangerous leader and the distance to him. More...
 
int getCrossingIndex () const
 return the index of the link to the next crossing if this is walkingArea, else -1 More...
 
MSEdgegetEdge () const
 Returns the lane's edge. More...
 
MSVehiclegetFirstVehicle () const
 
std::pair< MSVehicle *const, SUMORealgetFollowerOnConsecutive (SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
 return the follower with the largest missing rear gap among all predecessor lanes (within dist) More...
 
const std::string & getID () const
 Returns the id. More...
 
const std::vector< IncomingLaneInfo > & getIncomingLanes () const
 
LinkState getIncomingLinkState () const
 get the state of the link from the logical predecessor to this lane More...
 
const MSEdgegetInternalFollower () const
 Returns the lane's follower if it is an internal lane, the edge of the lane otherwise. More...
 
MSVehiclegetLastVehicle () const
 returns the last vehicle More...
 
std::pair< MSVehicle *const, SUMORealgetLeader (const MSVehicle *veh, const SUMOReal vehPos, bool checkNext) const
 Returns the immediate leader of veh and the distance to veh starting on this lane. More...
 
std::pair< MSVehicle *const, SUMORealgetLeaderOnConsecutive (SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle &veh, const std::vector< MSLane * > &bestLaneConts) const
 Returns the immediate leader and the distance to him. More...
 
const MSLinkContgetLinkCont () const
 returns the container with all links !!! More...
 
MSLanegetLogicalPredecessorLane () const
 get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached in myLogicalPredecessorLane More...
 
MSLanegetLogicalPredecessorLane (const MSEdge &fromEdge) const
 return the (first) predecessor lane from the given edge More...
 
const std::map< std::string, std::string > & getMap () const
 Returns the inner key/value map. More...
 
SUMOReal getMissingRearGap (SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const
 return by how much further the leader must be inserted to avoid rear end collisions More...
 
std::vector< const MSLane * > getOutgoingLanes () const
 get the list of outgoing lanes More...
 
MSLanegetParallelLane (int offset) const
 Returns the lane with the given offset parallel to this one or 0 if it does not exist. More...
 
const std::string & getParameter (const std::string &key, const std::string &defaultValue) const
 Returns the value for a given key. More...
 
bool isApproachedFrom (MSEdge *const edge)
 
bool isApproachedFrom (MSEdge *const edge, MSLane *const lane)
 
bool isEmpty () const
 
bool isLinkEnd (MSLinkCont::const_iterator &i) const
 
bool isLinkEnd (MSLinkCont::iterator &i)
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
void leftByLaneChange (MSVehicle *v)
 
 MSLane (const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions, int index)
 Constructor. More...
 
virtual MSVehicleremoveVehicle (MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
 
void setID (const std::string &newID)
 resets the id More...
 
void setLength (SUMOReal val)
 Sets a new length for the lane (used by TraCI only) More...
 
void setMaxSpeed (SUMOReal val)
 Sets a new maximum speed for the lane (used by TraCI and MSCalibrator) More...
 
void setPermissions (SVCPermissions permissions)
 
void visit (const TraCIServerAPI_Lane::StoringVisitor &cont) const
 Callback for visiting the lane when traversing an RTree. More...
 
virtual ~MSLane ()
 Destructor. More...
 
Additional initialisation
void addLink (MSLink *link)
 Delayed initialization. More...
 
interaction with MSMoveReminder
virtual void addMoveReminder (MSMoveReminder *rem)
 Add a move-reminder to move-reminder container. More...
 
const std::vector< MSMoveReminder * > & getMoveReminders () const
 Return the list of this lane's move reminders. More...
 
Vehicle insertion
bool insertVehicle (MSVehicle &v)
 Tries to insert the given vehicle. More...
 
bool isInsertionSuccess (MSVehicle *vehicle, SUMOReal speed, SUMOReal pos, bool recheckNextLanes, MSMoveReminder::Notification notification)
 Tries to insert the given vehicle with the given state (speed and pos) More...
 
bool checkFailure (MSVehicle *aVehicle, SUMOReal &speed, SUMOReal &dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const
 
bool lastInsertion (MSVehicle &veh, SUMOReal mspeed)
 
bool freeInsertion (MSVehicle &veh, SUMOReal speed, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
 Tries to insert the given vehicle on any place. More...
 
void forceVehicleInsertion (MSVehicle *veh, SUMOReal pos)
 Inserts the given vehicle at the given position. More...
 
Handling vehicles lapping into lanes
SUMOReal setPartialOccupation (MSVehicle *v, SUMOReal leftVehicleLength)
 Sets the information about a vehicle lapping into this lane. More...
 
void resetPartialOccupation (MSVehicle *v)
 Removes the information about a vehicle lapping into this lane. More...
 
MSVehiclegetPartialOccupator () const
 Returns the vehicle which laps into this lane. More...
 
SUMOReal getPartialOccupatorEnd () const
 Returns the position of the in-lapping vehicle's end. More...
 
std::pair< MSVehicle *, SUMORealgetLastVehicleInformation () const
 Returns the last vehicle which is still on the lane. More...
 
Access to vehicles
unsigned int getVehicleNumber () const
 Returns the number of vehicles on this lane. More...
 
virtual const VehContgetVehiclesSecure () const
 Returns the vehicles container; locks it for microsimulation. More...
 
virtual void releaseVehicles () const
 Allows to use the container for microsimulation again. More...
 
Atomar value getter
size_t getNumericalID () const
 Returns this lane's numerical id. More...
 
const PositionVectorgetShape () const
 Returns this lane's shape. More...
 
SUMOReal getLengthGeometryFactor () const
 return shape.length() / myLength More...
 
SUMOReal interpolateLanePosToGeometryPos (SUMOReal lanePos) const
 
const Position geometryPositionAtOffset (SUMOReal offset) const
 
SUMOReal interpolateGeometryPosToLanePos (SUMOReal geometryPos) const
 
SUMOReal getVehicleMaxSpeed (const SUMOVehicle *const veh) const
 Returns the lane's maximum speed, given a vehicle's speed limit adaptation. More...
 
SUMOReal getSpeedLimit () const
 Returns the lane's maximum allowed speed. More...
 
SUMOReal getLength () const
 Returns the lane's length. More...
 
SVCPermissions getPermissions () const
 Returns the vehicle class permissions for this lane. More...
 
SUMOReal getWidth () const
 Returns the lane's width. More...
 
int getIndex () const
 Returns the lane's index. More...
 
Vehicle movement (longitudinal)
virtual void planMovements (const SUMOTime t)
 Compute safe velocities for all vehicles based on positions and speeds from the last time step. Also registers ApproachingVehicleInformation for all links. More...
 
virtual bool executeMovements (SUMOTime t, std::vector< MSLane * > &into)
 Executes planned vehicle movements with regards to right-of-way. More...
 
virtual bool integrateNewVehicle (SUMOTime t)
 Insert buffered vehicle into the real lane. More...
 
Current state retrieval
SUMOReal getMeanSpeed () const
 Returns the mean speed on this lane. More...
 
SUMOReal getWaitingSeconds () const
 Returns the overall waiting time on this lane. More...
 
SUMOReal getBruttoOccupancy () const
 Returns the brutto (including minGaps) occupancy of this lane during the last step. More...
 
SUMOReal getNettoOccupancy () const
 Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps) More...
 
SUMOReal getBruttoVehLenSum () const
 Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the last step. More...
 
SUMOReal getCO2Emissions () const
 Returns the sum of last step CO2 emissions. More...
 
SUMOReal getCOEmissions () const
 Returns the sum of last step CO emissions. More...
 
SUMOReal getPMxEmissions () const
 Returns the sum of last step PMx emissions. More...
 
SUMOReal getNOxEmissions () const
 Returns the sum of last step NOx emissions. More...
 
SUMOReal getHCEmissions () const
 Returns the sum of last step HC emissions. More...
 
SUMOReal getFuelConsumption () const
 Returns the sum of last step fuel consumption. More...
 
SUMOReal getElectricityConsumption () const
 Returns the sum of last step electricity consumption. More...
 
SUMOReal getHarmonoise_NoiseEmissions () const
 Returns the sum of last step noise emissions. More...
 
State saving/loading
void saveState (OutputDevice &out)
 Saves the state of this lane into the given stream. More...
 
void loadState (std::vector< std::string > &vehIDs, MSVehicleControl &vc)
 Loads the state of this segment with the given parameters. More...
 

Static Public Member Functions

static void clear ()
 Clears the dictionary. More...
 
static bool dictionary (const std::string &id, MSLane *lane)
 Static (sic!) container methods {. More...
 
static MSLanedictionary (const std::string &id)
 Returns the MSLane associated to the key id. More...
 
static size_t dictSize ()
 Returns the number of stored lanes. More...
 
template<class RTREE >
static void fill (RTREE &into)
 Fills the given RTree with lane instances. More...
 
template<class T >
static std::string getIDSecure (const T *obj, const std::string &fallBack="NULL")
 get an identifier for Named-like object which may be Null More...
 
static void insertIDs (std::vector< std::string > &into)
 Adds the ids of all stored lanes into the given vector. More...
 
static MSLinkCont::const_iterator succLinkSec (const SUMOVehicle &veh, unsigned int nRouteSuccs, const MSLane &succLinkSource, const std::vector< MSLane * > &conts)
 

Protected Types

typedef std::map< std::string, MSLane * > DictType
 definition of the static dictionary type More...
 

Protected Member Functions

SUMOReal basePos (const MSVehicle &veh) const
 departure position where the vehicle fits fully onto the lane (if possible) More...
 
SUMOReal getDepartSpeed (const MSVehicle &veh, bool &patchSpeed)
 
SUMOReal getMaximumBrakeDist () const
 compute maximum braking distance on this lane More...
 
bool handleCollision (SUMOTime timestep, const std::string &stage, MSVehicle *collider, MSVehicle *victim, const SUMOReal victimRear)
 detect whether there is a collision. then issue warning and add the vehicle to MSVehicleTransfer More...
 
virtual void incorporateVehicle (MSVehicle *veh, SUMOReal pos, SUMOReal speed, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
 Inserts the vehicle into this lane, and informs it about entering the network. More...
 
virtual void swapAfterLaneChange (SUMOTime t)
 moves myTmpVehicles int myVehicles after a lane change procedure More...
 

Protected Attributes

std::map< MSEdge *, std::vector< MSLane * > > myApproachingLanes
 
SUMOReal myBruttoVehicleLengthSum
 The current length of all vehicles on this lane, including their minGaps. More...
 
MSEdge *const myEdge
 The lane's edge, for routing only. More...
 
std::string myID
 The name of the object. More...
 
std::vector< IncomingLaneInfomyIncomingLanes
 
int myIndex
 The lane index. More...
 
MSVehiclemyInlappingVehicle
 The vehicle which laps into this lane. More...
 
SUMOReal myInlappingVehicleEnd
 End position of a vehicle which laps into this lane. More...
 
SUMOReal myLength
 Lane length [m]. More...
 
const SUMOReal myLengthGeometryFactor
 
MSLinkCont myLinks
 
MSLanemyLogicalPredecessorLane
 
SUMOReal myMaxSpeed
 Lane-wide speedlimit [m/s]. More...
 
SUMOReal myNettoVehicleLengthSum
 The current length of all vehicles on this lane, excluding their minGaps. More...
 
size_t myNumericalID
 Unique numerical ID (set on reading by netload) More...
 
SVCPermissions myPermissions
 The vClass permissions for this lane. More...
 
const std::map< SUMOVehicleClass, SUMOReal > * myRestrictions
 The vClass speed restrictions for this lane. More...
 
PositionVector myShape
 The shape of the lane. More...
 
VehCont myTmpVehicles
 
std::vector< MSVehicle * > myVehBuffer
 
VehCont myVehicles
 The lane's vehicles. The entering vehicles are inserted at the front of this container and the leaving ones leave from the back, e.g. the vehicle in front of the junction (often called first) is myVehicles.back() (if it exists). And if it is an iterator at a vehicle, ++it points to the vehicle in front. This is the interaction vehicle. More...
 
const SUMOReal myWidth
 Lane width [m]. More...
 

Static Protected Attributes

static DictType myDict
 Static dictionary to associate string-ids with objects. More...
 

Private Member Functions

 MSLane (const MSLane &)
 invalidated copy constructor More...
 
MSLaneoperator= (const MSLane &)
 invalidated assignment operator More...
 

Private Attributes

std::vector< MSMoveReminder * > myMoveReminders
 This lane's move reminder. More...
 

Friends

class MSLaneChanger
 needs access to myTmpVehicles (this maybe should be done via double-buffering!!!) More...
 
class MSQueueExport
 
class MSXMLRawOut
 

Detailed Description

Representation of a lane in the micro simulation.

Class which represents a single lane. Somekind of the main class of the simulation. Allows moving vehicles.

Definition at line 77 of file MSLane.h.

Member Typedef Documentation

typedef std::map< std::string, MSLane* > MSLane::DictType
protected

definition of the static dictionary type

Definition at line 909 of file MSLane.h.

typedef std::vector< MSVehicle* > MSLane::VehCont

Container for vehicles.

Definition at line 88 of file MSLane.h.

Constructor & Destructor Documentation

MSLane::MSLane ( const std::string &  id,
SUMOReal  maxSpeed,
SUMOReal  length,
MSEdge *const  edge,
unsigned int  numericalID,
const PositionVector shape,
SUMOReal  width,
SVCPermissions  permissions,
int  index 
)

Constructor.

Parameters
[in]idThe lane's id
[in]maxSpeedThe speed allowed on this lane
[in]lengthThe lane's length
[in]edgeThe edge this lane belongs to
[in]numericalIDThe numerical id of the lane
[in]shapeThe shape of the lane
[in]widthThe width of the lane
[in]permissionsEncoding of the Vehicle classes that may drive on this lane
[in]indexThe index of this lane within its parent edge
See also
SUMOVehicleClass

Definition at line 86 of file MSLane.cpp.

References MSEdge::getEdgeType(), MSNet::getInstance(), MSNet::getRestrictions(), and myRestrictions.

MSLane::~MSLane ( )
virtual

Destructor.

Definition at line 100 of file MSLane.cpp.

References myLinks.

MSLane::MSLane ( const MSLane )
private

invalidated copy constructor

Member Function Documentation

void MSLane::addApproachingLane ( MSLane lane,
bool  warnMultiCon 
)
void MSLane::addIncomingLane ( MSLane lane,
MSLink viaLink 
)
void MSLane::addLink ( MSLink link)

Delayed initialization.

Not all lane-members are known at the time the lane is born, above all the pointers to other lanes, so we have to add them later.

Parameters
[in]linkAn outgoing link

Definition at line 108 of file MSLane.cpp.

References myLinks.

Referenced by NLHandler::addConnection().

void MSLane::addMoveReminder ( MSMoveReminder rem)
virtual

Add a move-reminder to move-reminder container.

The move reminder will not be deleted by the lane.

Parameters
[in]remThe move reminder to add

Definition at line 115 of file MSLane.cpp.

References myMoveReminders, and myVehicles.

Referenced by MSMoveReminder::MSMoveReminder().

void Parameterised::addParameter ( const std::map< std::string, std::string > &  mapArg)
inherited

Adds all given parameter.

Parameters
[in]mapArgThe keys/values to insert

Definition at line 59 of file Parameterised.cpp.

References Parameterised::myMap.

void Parameterised::addParameter ( const Parameterised p)
inherited

Adds all given parameter.

Parameters
[in]pThe keys/values to insert

Definition at line 67 of file Parameterised.cpp.

References Parameterised::myMap.

void Named::addTo ( const StoringVisitor cont) const
inlineinherited

Adds this object to the given container.

Parameters

Definition at line 126 of file Named.h.

References Named::StoringVisitor::add().

bool MSLane::allowsVehicleClass ( SUMOVehicleClass  vclass) const
inline
bool MSLane::appropriate ( const MSVehicle veh)
virtual

Returns the information whether this lane may be used to continue the current route

Definition at line 830 of file MSLane.cpp.

References MSEdge::EDGEFUNCTION_INTERNAL, MSVehicle::getBestLanes(), MSVehicle::getBestLanesContinuation(), MSVehicle::getLaneIndex(), MSEdge::getPurpose(), myEdge, myLinks, MSBaseVehicle::succEdge(), and succLinkSec().

Referenced by executeMovements(), and getIndex().

SUMOReal MSLane::basePos ( const MSVehicle veh) const
protected

departure position where the vehicle fits fully onto the lane (if possible)

Definition at line 318 of file MSLane.cpp.

References MSVehicleType::getLength(), MSBaseVehicle::getVehicleType(), MIN2(), myLength, and POSITION_EPS.

Referenced by insertVehicle(), lastInsertion(), and visit().

bool MSLane::checkFailure ( MSVehicle aVehicle,
SUMOReal speed,
SUMOReal dist,
const SUMOReal  nspeed,
const bool  patchSpeed,
const std::string  errorMsg 
) const
void MSLane::clear ( )
static

Clears the dictionary.

Definition at line 795 of file MSLane.cpp.

References myDict.

Referenced by MSNet::clearAll(), and getEdge().

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 91 of file Parameterised.cpp.

References Parameterised::myMap.

void MSLane::detectCollisions ( SUMOTime  timestep,
const std::string &  stage 
)
virtual

Check if vehicles are too close.

Reimplemented in GUILane.

Definition at line 595 of file MSLane.cpp.

References getPartialOccupator(), getPartialOccupatorEnd(), handleCollision(), and myVehicles.

Referenced by GUILane::detectCollisions(), and getIndex().

bool MSLane::dictionary ( const std::string &  id,
MSLane lane 
)
static

Static (sic!) container methods {.

Inserts a MSLane into the static dictionary

Returns true if the key id isn't already in the dictionary. Otherwise returns false.

Parameters
[in]idThe id of the lane
[in]laneThe lane itself
Returns
Whether the lane was added
Todo:

make non-static

why is the id given? The lane is named

Definition at line 772 of file MSLane.cpp.

References myDict.

Referenced by NLHandler::addConnection(), NLHandler::addLane(), MSRouteHandler::addStop(), MSVehicle::addStop(), getEdge(), NLTriggerBuilder::getLane(), NLDetectorBuilder::getLaneChecking(), NLShapeHandler::getLanePos(), TraCIServerAPI_Lane::getShape(), MSPedestrianPushButton::loadPushButtons(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), NLHandler::parseLanes(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processSet(), and TraCIServerAPI_Lane::processSet().

MSLane * MSLane::dictionary ( const std::string &  id)
static

Returns the MSLane associated to the key id.

The lane is returned if exists, otherwise 0 is returned.

Parameters
[in]idThe id of the lane
Returns
The lane

Definition at line 784 of file MSLane.cpp.

References myDict.

static size_t MSLane::dictSize ( )
inlinestatic

Returns the number of stored lanes.

Returns
The number of stored lanes

Definition at line 510 of file MSLane.h.

References enteredByLaneChange(), fill(), getFirstVehicle(), getLastVehicle(), getParallelLane(), insertIDs(), isEmpty(), isLinkEnd(), leftByLaneChange(), myDict, removeVehicle(), and succLinkSec().

bool MSLane::empty ( ) const
inline

Returns true if there is not a single vehicle on the lane.

Definition at line 449 of file MSLane.h.

References myVehBuffer, myVehicles, setLength(), setMaxSpeed(), and SUMOReal.

Referenced by MSQueueExport::writeLane().

bool MSLane::executeMovements ( SUMOTime  t,
std::vector< MSLane * > &  into 
)
virtual

Executes planned vehicle movements with regards to right-of-way.

This method goes through all vehicles calling their executeMove method which causes vehicles to update their positions and speeds. Vehicles wich move to the next lane are stored in the targets lane buffer

See also
MSVehicle::executeMove

Reimplemented in GUILane.

Definition at line 662 of file MSLane.cpp.

References MSVehicleTransfer::add(), MSAbstractLaneChangeModel::alreadyMoved(), appropriate(), MSVehicle::executeMove(), MSVehicle::getBestLanesContinuation(), getEdge(), Named::getID(), MSBaseVehicle::getID(), MSVehicle::getInfluencer(), MSVehicleTransfer::getInstance(), MSNet::getInstance(), MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicleType::getLength(), getLength(), MSVehicleType::getLengthWithGap(), MSVehicle::getPositionOnLane(), MSAbstractLaneChangeModel::getShadowLane(), MSVehicle::getSpeed(), getSpeedLimit(), MSNet::getVehicleControl(), MSBaseVehicle::getVehicleType(), MSVehicle::getWaitingTime(), MSGlobals::gTimeToGridlock, MSGlobals::gTimeToGridlockHighways, MSVehicle::hasArrived(), MSVehicle::hasInfluencer(), MSAbstractLaneChangeModel::hasShadowVehicle(), MSVehicle::isParking(), MSVehicle::isStopped(), MSEdge::isVaporizing(), MSVehicle::Influencer::isVTDControlled(), myBruttoVehicleLengthSum, myLinks, myNettoVehicleLengthSum, myVehBuffer, myVehicles, MSMoveReminder::NOTIFICATION_ARRIVED, MSMoveReminder::NOTIFICATION_VAPORIZED, MSVehicle::onRemovalFromNet(), MSVehicleControl::registerCollision(), MSVehicleControl::registerTeleportJam(), MSVehicleControl::registerTeleportWrongLane(), MSVehicleControl::registerTeleportYield(), MSVehicleControl::scheduleVehicleRemoval(), SPEED2DIST, succLinkSec(), SUMOReal, time2string(), MSVehicle::workOnMoveReminders(), and WRITE_WARNING.

Referenced by GUILane::executeMovements(), and getIndex().

template<class RTREE >
template void MSLane::fill< LANE_RTREE_QUAL > ( RTREE &  into)
static
void MSLane::forceVehicleInsertion ( MSVehicle veh,
SUMOReal  pos 
)

Inserts the given vehicle at the given position.

No checks are done, vehicle insertion using this method may generate collisions (possibly delayed).

Parameters
[in]vehThe vehicle to insert
[in]posThe position at which the vehicle shall be inserted

Definition at line 521 of file MSLane.cpp.

References getDepartSpeed(), MSVehicle::getSpeed(), MSBaseVehicle::hasDeparted(), incorporateVehicle(), myVehicles, SUMOReal, and MSVehicle::updateBestLanes().

Referenced by getMoveReminders(), MSVehicle::Influencer::postProcessVTD(), and TraCIServerAPI_Vehicle::processSet().

bool MSLane::freeInsertion ( MSVehicle veh,
SUMOReal  speed,
MSMoveReminder::Notification  notification = MSMoveReminder::NOTIFICATION_DEPARTED 
)

Tries to insert the given vehicle on any place.

Parameters
[in]vehThe vehicle to insert
[in]speedThe maximum insertion speed
[in]notificationThe cause of insertion (i.e. departure, teleport, parking) defaults to departure
Returns
Whether the vehicle could be inserted

Definition at line 163 of file MSLane.cpp.

References MSVehicle::getCarFollowModel(), MSVehicleType::getLength(), getLength(), MSCFModel::getMaxDecel(), MSVehicleType::getMinGap(), getMissingRearGap(), getPartialOccupator(), getPartialOccupatorEnd(), MSVehicle::getPositionOnLane(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MSCFModel::insertionFollowSpeed(), isInsertionSuccess(), MIN2(), myLength, myVehicles, MSMoveReminder::NOTIFICATION_TELEPORT, POSITION_EPS, and SUMOReal.

Referenced by MSVehicleTransfer::checkInsertions(), getMoveReminders(), and insertVehicle().

SUMOReal MSLane::getBruttoOccupancy ( ) const
SUMOReal MSLane::getBruttoVehLenSum ( ) const

Returns the sum of lengths of vehicles, including their minGaps, which were on the lane during the last step.

Returns
The sum of vehicle lengths of vehicles in the last step

Definition at line 1425 of file MSLane.cpp.

References myBruttoVehicleLengthSum, and SUMOReal.

Referenced by MSVehicle::checkRewindLinkLanes(), and getIncomingLanes().

SUMOReal MSLane::getCO2Emissions ( ) const

Returns the sum of last step CO2 emissions.

Returns
CO2 emissions of vehicles on this lane during the last step

Definition at line 1460 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

SUMOReal MSLane::getCOEmissions ( ) const

Returns the sum of last step CO emissions.

Returns
CO emissions of vehicles on this lane during the last step

Definition at line 1472 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

std::pair< MSVehicle *const, SUMOReal > MSLane::getCriticalLeader ( SUMOReal  dist,
SUMOReal  seen,
SUMOReal  speed,
const MSVehicle veh 
) const

Returns the most dangerous leader and the distance to him.

Goes along the vehicle's estimated used lanes (bestLaneConts). For each link, it is determined whether the ego vehicle will pass it. If so, the subsequent lane is investigated. Check all lanes up to the stopping distance of ego. Return the leader vehicle (and the gap) which puts the biggest speed constraint on ego.

If no leading vehicle was found, <0, -1> is returned.

Pretty slow, as it has to go along lanes.

Parameters
[in]distThe distance to investigate
[in]seenThe already seen place (normally the place in front on own lane)
[in]speedThe speed of the vehicle used for determining whether a subsequent link will be opened at arrival time
[in]vehThe (ego) vehicle for which the information shall be computed
Returns

Definition at line 1229 of file MSLane.cpp.

References MSCFModel::brakeGap(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), MSNet::getCurrentTimeStep(), MSBaseVehicle::getImpatience(), MSNet::getInstance(), getLastVehicle(), MSVehicleType::getLength(), getLength(), MSCFModel::getMaxDecel(), MSVehicleType::getMinGap(), getPartialOccupator(), getPartialOccupatorEnd(), MSVehicle::getPositionOnLane(), MSVehicle::getSafeFollowSpeed(), MSVehicle::getSpeed(), getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), MSCFModel::insertionFollowSpeed(), isLinkEnd(), max, MAX2(), NUMERICAL_EPS, succLinkSec(), SUMOReal, and TIME2STEPS.

Referenced by MSLaneChanger::checkChange(), and getIncomingLanes().

int MSLane::getCrossingIndex ( ) const

return the index of the link to the next crossing if this is walkingArea, else -1

Definition at line 1384 of file MSLane.cpp.

References myLinks, and SUMOReal.

Referenced by getIndex().

MSEdge& MSLane::getEdge ( ) const
inline

Returns the lane's edge.

Returns
This lane's edge

Definition at line 467 of file MSLane.h.

References clear(), dictionary(), getInternalFollower(), and myEdge.

Referenced by MSLCM_JE2013::_patchSpeed(), MSLCM_LC2013::_patchSpeed(), MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), TraCIServerAPI_Lane::StoringVisitor::add(), addApproachingLane(), MSRouteHandler::addStop(), MSVehicle::addStop(), MSEdge::allowedLanes(), MSSwarmTrafficLightLogic::allowLine(), MSSOTLE2Sensors::buildSensorForLane(), MSEdge::changeLanes(), MSLaneChanger::checkChange(), MSVehicle::checkRewindLinkLanes(), MSEdge::closeBuilding(), GUILane::closeTraffic(), MSDevice_Tripinfo::computeLengthAndDuration(), GUIDetectorBuilder::createInductLoop(), NLDetectorBuilder::createInductLoop(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), MSVehicle::enterLaneAtMove(), MSVehicle::executeMove(), executeMovements(), MS_E2_ZS_CollectorOverLanes::extendTo(), MSVehicle::getBestLanesContinuation(), GUILane::getColorValue(), MSVehicle::getDistanceToPosition(), MSVehicle::getLaneIndex(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), getLogicalPredecessorLane(), MSPModel_Striping::PState::getNextEdge(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), MSVehicle::getPosition(), MSStoppingPlace::hasAccess(), MSVehicle::Influencer::implicitDeltaPosVTD(), MSVehicle::Influencer::implicitSpeedVTD(), MSVehicle::influenceChangeDecision(), MSRailSignal::init(), isInsertionSuccess(), MSJunction::isLeader(), MSLink::lastWasContMajor(), MESegment::limitedControlOverride(), MSPedestrianPushButton::loadPushButtons(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), GUIViewTraffic::onCmdAddRerouter(), GUIViewTraffic::onCmdCloseEdge(), MSLane::edge_finder::operator()(), NLTriggerBuilder::parseAndBuildCalibrator(), MSRouteHandler::parseWalkPositions(), MSLCM_DK2008::patchSpeed(), MSVehicle::planMoveInternal(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_Lane::processSet(), MSPModel_Striping::PState::PState(), MSVehicle::resumeFromStopping(), MSLink::setRequestInformation(), succLinkSec(), MSVehicle::unsafeLinkAhead(), MSVehicle::updateBestLanes(), TraCIServerAPI_Vehicle::vtdMap(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSFCDExport::write(), and MSLink::writeApproaching().

SUMOReal MSLane::getElectricityConsumption ( ) const

Returns the sum of last step electricity consumption.

Returns
electricity consumption of vehicles on this lane during the last step

Definition at line 1532 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), and MSFullExport::writeLane().

MSVehicle * MSLane::getFirstVehicle ( ) const

Definition at line 889 of file MSLane.cpp.

References myVehicles.

Referenced by dictSize(), and getFollowerOnConsecutive().

std::pair< MSVehicle *const, SUMOReal > MSLane::getFollowerOnConsecutive ( SUMOReal  backOffset,
SUMOReal  leaderSpeed,
SUMOReal  leaderMaxDecel 
) const
SUMOReal MSLane::getFuelConsumption ( ) const

Returns the sum of last step fuel consumption.

Returns
fuel consumption of vehicles on this lane during the last step

Definition at line 1520 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

SUMOReal MSLane::getHarmonoise_NoiseEmissions ( ) const

Returns the sum of last step noise emissions.

Returns
noise emissions of vehicles on this lane during the last step

Definition at line 1544 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), HelpersHarmonoise::sum(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

SUMOReal MSLane::getHCEmissions ( ) const

Returns the sum of last step HC emissions.

Returns
HC emissions of vehicles on this lane during the last step

Definition at line 1508 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Definition at line 65 of file Named.h.

References Named::myID.

Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), MSDetectorControl::add(), Named::StoringVisitor::add(), IntermodalRouter< E, L, N, V >::addAccess(), NLTriggerBuilder::addAccess(), RORouteDef::addAlternative(), addApproachingLane(), MSNet::addBusStop(), MSNet::addChargingStation(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), MSNet::addContainerStop(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), GUIEdge::addRerouter(), NBEdge::addRestrictedLane(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NIXMLEdgesHandler::addSplit(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), ROVehicle::addStop(), MSVehicle::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciBusOrContainerStop(), MSVehicle::addTraciStop(), AGActivityTripWriter::addTrip(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSContainer::MSContainerStage_Driving::beginEventOutput(), MSContainer::MSContainerStage_Waiting::beginEventOutput(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NLEdgeControlBuilder::build(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), NBNode::buildCrossings(), NBNode::buildCrossingsAndWalkingAreas(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), GNEConnector::buildIinternalLanes(), GNETLSEditor::buildIinternalLanes(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MELoop::buildSegmentsFor(), MSSOTLE2Sensors::buildSensorForLane(), MSSOTLE2Sensors::buildSensorForOutLane(), NBNode::buildWalkingAreas(), MSBaseVehicle::calculateArrivalParams(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MELoop::changeSegment(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), MSVehicleTransfer::checkInsertions(), MSSwarmTrafficLightLogic::choosePolicy(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBLoadedSUMOTLDef::collectEdges(), NBTrafficLightDefinition::collectEdges(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBOwnTLDef::computeLogicAndConts(), NBNode::computeNodeShape(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSSOTLE2Sensors::countVehicles(), GUINet::createTLWrapper(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), NIVissimDistrictConnection::dict_BuildDistricts(), MSContainer::MSContainerStage_Driving::endEventOutput(), MSContainer::MSContainerStage_Waiting::endEventOutput(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSPModel_Striping::MovePedestrians::execute(), MSTrafficLightLogic::SwitchCommand::execute(), MSVehicle::executeMove(), executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), TraCIServerAPI_Vehicle::findCloserLane(), NBRampsComputer::fulfillsRampConstraints(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), MSNet::getChargingStationID(), NBEdge::getConnection(), MSNet::getContainerStopID(), NBEdge::getCrossingAngle(), GNEEdge::getDest(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), MSE2Collector::getEstimateQueueLength(), NBEdge::getFirstNonPedestrianLane(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPerson::getNextEdge(), MSPModel_Striping::getNextLane(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUI_E2_ZS_Collector::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), MSSOTLTrafficLightLogic::getPhaseIndexWithMaxCTS(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), GNEEdge::getSource(), MSVehicleControl::getWaitingVehicle(), MSLink::getZipperSpeed(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), handleCollision(), NBEdgeCont::ignoreFilterMatch(), MSDeterministicHiLevelTrafficLightLogic::init(), MSRailSignal::init(), MSActuatedTrafficLightLogic::init(), MSTrafficLightLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBNodeCont::insert(), NBTrafficLightLogicCont::insert(), NBEdgeCont::insert(), MSEdge::insertVehicle(), IntermodalNetwork< E, L, N, V >::IntermodalNetwork(), GNEJunction::invalidateTLS(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), MSPedestrianPushButton::isActiveForEdge(), MSPedestrianPushButton::isActiveOnAnySideOfTheRoad(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), MSSOTLTrafficLightLogic::isThresholdPassed(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSPedestrianPushButton::loadCrossingEdgeMap(), NIImporter_OpenDrive::loadNetwork(), MSPedestrianPushButton::loadPushButtons(), ODDistrictCont::makeDistricts(), MSSOTLE2Sensors::meanVehiclesSpeed(), METriggeredCalibrator::METriggeredCalibrator(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSChargingStation::MSChargingStation(), MSDevice_Battery::MSDevice_Battery(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Example::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSE2Collector::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSDevice_BTsender::notifyMove(), MSE2Collector::notifyMove(), GUIViewTraffic::onGamingClick(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), MSEdge::by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), MSRouteHandler::parseWalkPositions(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_JE2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSRightOfWayJunction::postloadInit(), AGStreet::print(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_ArealDetector::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processSet(), NIXMLNodesHandler::processTrafficLightDefinitions(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNodeCont::removeIsolatedRoads(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), GNENet::renameEdge(), GNENet::renameJunction(), RORouteDef::repairCurrentRoute(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), saveState(), MSDevice_Battery::setActualBatteryCapacity(), MSDevice_Battery::setAirDragCoefficient(), NBNodeCont::setAsTLControlled(), MSChargingStation::setChrgPower(), MSDevice_Battery::setConstantPowerIntake(), NBEdge::setControllingTLInformation(), MSChargingStation::setEfficency(), MSDevice_Battery::setFrontSurfaceArea(), MSDevice_Battery::setInternalMomentOfInertia(), GNEJunction::setLogicValid(), MSDevice_Battery::setMass(), MSDevice_Battery::setMaximumBatteryCapacity(), NIXMLEdgesHandler::setNodes(), MSDevice_Battery::setPowerMax(), MSDevice_Battery::setPropulsionEfficiency(), MSDevice_Battery::setRadialDragCoefficient(), MSDevice_Battery::setRecuperationEfficiency(), MSLink::setRequestInformation(), MSDevice_Battery::setRollDragCoefficient(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBOwnTLDef::setTLControllingInformation(), NBTrafficLightLogicCont::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdge::shiftPositionAtNode(), NBEdgeCont::splitAt(), succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSSOTLTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::updateCTS(), GNETLSEditor::updateDescription(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap(), MSPModel_Striping::PState::walk(), MSLCM_JE2013::wantsChange(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_SUMO::writeInternalConnections(), writeInterval(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_SUMO::writeRoundabout(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFCDExport::writeTransportable(), MSInductLoop::writeTypedXMLOutput(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), PointOfInterest::writeXML(), SUMO::Polygon::writeXML(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

template<class T >
static std::string Named::getIDSecure ( const T *  obj,
const std::string &  fallBack = "NULL" 
)
inlinestaticinherited

get an identifier for Named-like object which may be Null

Definition at line 58 of file Named.h.

Referenced by operator<<(), and toString().

LinkState MSLane::getIncomingLinkState ( ) const

get the state of the link from the logical predecessor to this lane

Definition at line 1348 of file MSLane.cpp.

References MSLinkContHelper::getConnectingLink(), getLogicalPredecessorLane(), MSLink::getState(), and LINKSTATE_DEADEND.

Referenced by getIncomingLanes().

int MSLane::getIndex ( ) const
inline

Returns the lane's index.

Returns
This lane's index

Definition at line 398 of file MSLane.h.

References appropriate(), detectCollisions(), executeMovements(), getCrossingIndex(), getLinkCont(), integrateNewVehicle(), myIndex, and planMovements().

Referenced by GUILane::drawLinkNo(), and MSLink::getZipperSpeed().

const MSEdge * MSLane::getInternalFollower ( ) const

Returns the lane's follower if it is an internal lane, the edge of the lane otherwise.

Returns
This lane's follower

Definition at line 761 of file MSLane.cpp.

References MSEdge::EDGEFUNCTION_INTERNAL, MSEdge::getPurpose(), MSEdge::getSuccessors(), and myEdge.

Referenced by getEdge(), MSVehicle::getRerouteOrigin(), and MSVehicle::updateBestLanes().

MSVehicle * MSLane::getLastVehicle ( ) const

returns the last vehicle

Definition at line 880 of file MSLane.cpp.

References myVehicles.

Referenced by MSVehicle::checkRewindLinkLanes(), dictSize(), getCriticalLeader(), isInsertionSuccess(), and MSLink::maybeOccupied().

std::pair< MSVehicle *, SUMOReal > MSLane::getLastVehicleInformation ( ) const

Returns the last vehicle which is still on the lane.

The information about the last vehicle in this lane's que is returned. If there is no such vehicle, the information about the vehicle which laps into this lane is returned. If there is no such vehicle, the first returned member is 0.

Returns
Information about the last vehicle and it's back position

Definition at line 563 of file MSLane.cpp.

References MSVehicleType::getLength(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), myInlappingVehicle, myInlappingVehicleEnd, myVehicles, and SUMOReal.

Referenced by getPartialOccupatorEnd(), and MSVehicle::planMoveInternal().

std::pair< MSVehicle *const, SUMOReal > MSLane::getLeader ( const MSVehicle veh,
const SUMOReal  vehPos,
bool  checkNext 
) const

Returns the immediate leader of veh and the distance to veh starting on this lane.

Iterates over the current lane to find a leader and then uses getLeaderOnConsecutive()

Parameters
[in]vehThe vehicle for which the information shall be computed
[in]vehPosThe vehicle position relative to this lane (may be negative)
[in]checkNextWhether lanes after this one shall be checked
Returns

Definition at line 1135 of file MSLane.cpp.

References MSCFModel::brakeGap(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), getLeaderOnConsecutive(), getLength(), MSVehicleType::getMinGap(), getPartialOccupator(), getPartialOccupatorEnd(), MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), myVehicles, NUMERICAL_EPS, and SUMOReal.

Referenced by MSLaneChanger::checkChange(), getIncomingLanes(), and MSVehicle::planMoveInternal().

std::pair< MSVehicle *const, SUMOReal > MSLane::getLeaderOnConsecutive ( SUMOReal  dist,
SUMOReal  seen,
SUMOReal  speed,
const MSVehicle veh,
const std::vector< MSLane * > &  bestLaneConts 
) const

Returns the immediate leader and the distance to him.

Goes along the vehicle's estimated used lanes (bestLaneConts). For each link, it is determined whether the vehicle will pass it. If so, the subsequent lane is investigated. If a vehicle (leader) is found, it is returned, together with the length of the investigated lanes until this vehicle's end, including the already seen place (seen).

If no leading vehicle was found, <0, -1> is returned.

Pretty slow, as it has to go along lanes.

Todo:
: There are some oddities:
  • what about crossing a link at red, or if a link is closed? Has a following vehicle to be regarded or not?
Parameters
[in]distThe distance to investigate
[in]seenThe already seen place (normally the place in front on own lane)
[in]speedThe speed of the vehicle used for determining whether a subsequent link will be opened at arrival time
[in]vehThe vehicle for which the information shall be computed
[in]bestLaneContsThe lanes the vehicle will use in future
Returns

Definition at line 1166 of file MSLane.cpp.

References MSCFModel::brakeGap(), MSVehicle::getCarFollowModel(), MSNet::getCurrentTimeStep(), MSBaseVehicle::getImpatience(), MSNet::getInstance(), MSVehicleType::getLength(), getLength(), MSCFModel::getMaxDecel(), MSVehicleType::getMinGap(), getPartialOccupator(), getPartialOccupatorEnd(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getVehicleType(), MAX2(), NUMERICAL_EPS, succLinkSec(), and TIME2STEPS.

Referenced by getIncomingLanes(), getLeader(), and MSVehicle::getLeader().

SUMOReal MSLane::getLength ( ) const
inline

Returns the lane's length.

Returns
This lane's length

Definition at line 375 of file MSLane.h.

References myLength.

Referenced by MSVehicle::adaptLaneEntering2MoveReminder(), NLTriggerBuilder::addAccess(), NLHandler::addConnection(), addIncomingLane(), MSVehicle::addStop(), GUI_E2_ZS_CollectorOverLanes::buildCollector(), MS_E2_ZS_CollectorOverLanes::buildCollector(), MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), MSSOTLE2Sensors::buildSensorForLane(), MSSOTLE2Sensors::buildSensorForOutLane(), MSLaneChanger::checkChange(), MSVehicle::checkRewindLinkLanes(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), MSPModel_Striping::PState::distToLaneEnd(), GUIVehicle::drawAction_drawRailCarriages(), MSVehicle::executeMove(), executeMovements(), MS_E2_ZS_CollectorOverLanes::extendTo(), MSVehicle::fixPosition(), freeInsertion(), GUILane::getColorValue(), getCriticalLeader(), MSVehicle::getDistanceToPosition(), MSE2Collector::getEstimatedCurrentVehicleNumber(), MSE2Collector::getEstimateQueueLength(), getFollowerOnConsecutive(), TraCIServerAPI_Simulation::getLaneChecking(), NLShapeHandler::getLanePos(), getLeader(), MSVehicle::getLeader(), getLeaderOnConsecutive(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), MSDevice_Battery::getPropEnergy(), MSVehicle::getRerouteOrigin(), MSVehicle::getSafeFollowSpeed(), MSVehicle::getSpaceTillLastStanding(), MSActuatedTrafficLightLogic::init(), MS_E2_ZS_CollectorOverLanes::init(), insertVehicle(), isInsertionSuccess(), MSLink::maybeOccupied(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), NLTriggerBuilder::parseAndBuildChargingStation(), NLTriggerBuilder::parseAndBuildStoppingPlace(), MSVehicle::planMoveInternal(), MSVehicle::Influencer::postProcessVTD(), TraCIServerAPI_Lane::processGet(), GUIVehicle::selectBlockingFoes(), MSVehicle::setBlinkerInformation(), MSLink::setRequestInformation(), MSVehicle::unsafeLinkAhead(), MSVehicle::updateBestLanes(), TraCIServerAPI_Vehicle::vtdMap(), MSLCM_DK2008::wantsChangeToLeft(), MSLCM_DK2008::wantsChangeToRight(), MSLink::writeApproaching(), MSMeanData::writeEdge(), and MSQueueExport::writeLane().

SUMOReal MSLane::getLengthGeometryFactor ( ) const
inline

return shape.length() / myLength

Definition at line 327 of file MSLane.h.

References myLengthGeometryFactor.

MSLane * MSLane::getLogicalPredecessorLane ( const MSEdge fromEdge) const

return the (first) predecessor lane from the given edge

Definition at line 1336 of file MSLane.cpp.

References getEdge(), and myIncomingLanes.

const std::map<std::string, std::string>& Parameterised::getMap ( ) const
inlineinherited
SUMOReal MSLane::getMaximumBrakeDist ( ) const
protected
SUMOReal MSLane::getMeanSpeed ( ) const

Returns the mean speed on this lane.

Returns
The average speed of vehicles during the last step; default speed if no vehicle was on this lane

Definition at line 1444 of file MSLane.cpp.

References getVehiclesSecure(), myMaxSpeed, myVehicles, releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

SUMOReal MSLane::getMissingRearGap ( SUMOReal  backOffset,
SUMOReal  leaderSpeed,
SUMOReal  leaderMaxDecel 
) const

return by how much further the leader must be inserted to avoid rear end collisions

Definition at line 1045 of file MSLane.cpp.

References MSVehicle::getCarFollowModel(), getFollowerOnConsecutive(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), and SUMOReal.

Referenced by freeInsertion(), getIncomingLanes(), and isInsertionSuccess().

const std::vector< MSMoveReminder* >& MSLane::getMoveReminders ( ) const
inline
SUMOReal MSLane::getNettoOccupancy ( ) const

Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)

Returns
The occupancy during the last step

Definition at line 1410 of file MSLane.cpp.

References MSVehicleType::getLength(), MSVehicle::getPositionOnLane(), getVehiclesSecure(), MSBaseVehicle::getVehicleType(), myInlappingVehicle, myInlappingVehicleEnd, myLength, myNettoVehicleLengthSum, myVehicles, releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

SUMOReal MSLane::getNOxEmissions ( ) const

Returns the sum of last step NOx emissions.

Returns
NOx emissions of vehicles on this lane during the last step

Definition at line 1496 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

size_t MSLane::getNumericalID ( ) const
inline

Returns this lane's numerical id.

Returns
This lane's numerical id

Definition at line 314 of file MSLane.h.

References myNumericalID.

Referenced by MSPModel_Striping::lane_by_numid_sorter::operator()(), and MSPModel_Striping::walkingarea_path_sorter::operator()().

std::vector< const MSLane * > MSLane::getOutgoingLanes ( ) const

get the list of outgoing lanes

Definition at line 1359 of file MSLane.cpp.

References myLinks.

Referenced by getIncomingLanes(), and MSRailSignal::init().

MSLane * MSLane::getParallelLane ( int  offset) const

Returns the lane with the given offset parallel to this one or 0 if it does not exist.

Parameters
[in]offsetThe offset of the result lane

Definition at line 991 of file MSLane.cpp.

References myEdge, and MSEdge::parallelLane().

Referenced by MSLaneChanger::checkChange(), dictSize(), and MSAbstractLaneChangeModel::getShadowLane().

const std::string & Parameterised::getParameter ( const std::string &  key,
const std::string &  defaultValue 
) const
inherited

Returns the value for a given key.

Parameters
[in]keyThe key to ask for
[in]defaultValueThe default value to return if no value is stored under the key
Returns
The value stored under the key

Definition at line 81 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), MSDevice_Example::buildVehicleDevices(), MSDevice_Battery::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSSOTLTrafficLightLogic::getDecayConstant(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLRequestTrafficLightLogic::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSSOTLTrafficLightLogic::getThreshold(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Lane::processGet(), MSSOTLPolicyDesirability::readParameter(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and TraCIServerAPI_Vehicle::vtdMap().

SUMOReal MSLane::getPartialOccupatorEnd ( ) const
inline
SVCPermissions MSLane::getPermissions ( ) const
inline

Returns the vehicle class permissions for this lane.

Returns
This lane's allowed vehicle classes

Definition at line 383 of file MSLane.h.

References myPermissions.

Referenced by MSSwarmTrafficLightLogic::allowLine(), GUIApplicationWindow::onCmdEditChosen(), and TraCIServerAPI_Lane::processGet().

SUMOReal MSLane::getPMxEmissions ( ) const

Returns the sum of last step PMx emissions.

Returns
PMx emissions of vehicles on this lane during the last step

Definition at line 1484 of file MSLane.cpp.

References getVehiclesSecure(), releaseVehicles(), and SUMOReal.

Referenced by GUILane::getColorValue(), getIncomingLanes(), GUILane::getScaleValue(), TraCIServerAPI_Lane::processGet(), and MSFullExport::writeLane().

const PositionVector& MSLane::getShape ( ) const
inline
unsigned int MSLane::getVehicleNumber ( ) const
inline

Returns the number of vehicles on this lane.

Returns
The number of vehicles on this lane

Definition at line 284 of file MSLane.h.

References myVehicles.

Referenced by MSVehicle::checkRewindLinkLanes(), TraCIServerAPI_Lane::processGet(), MSFullExport::writeLane(), and MSXMLRawOut::writeLane().

virtual const VehCont& MSLane::getVehiclesSecure ( ) const
inlinevirtual

Returns the vehicles container; locks it for microsimulation.

Please note that it is necessary to release the vehicles container afterwards using "releaseVehicles".

Returns
The vehicles on this lane

Reimplemented in GUILane.

Definition at line 295 of file MSLane.h.

References myVehicles.

Referenced by TraCIServerAPI_Lane::StoringVisitor::add(), getBruttoOccupancy(), getCO2Emissions(), getCOEmissions(), getElectricityConsumption(), getFuelConsumption(), getHarmonoise_NoiseEmissions(), getHCEmissions(), MSVehicle::getLeader(), getMeanSpeed(), getNettoOccupancy(), getNOxEmissions(), getPMxEmissions(), MSVehicle::getSpaceTillLastStanding(), MSPedestrianPushButton::isActiveForEdge(), TraCIServerAPI_Lane::processGet(), and MSLink::writeApproaching().

SUMOReal MSLane::getWaitingSeconds ( ) const

Returns the overall waiting time on this lane.

Returns
The sum of the waiting time of all vehicles during the last step;

Definition at line 1431 of file MSLane.cpp.

References myVehicles, and SUMOReal.

Referenced by getIncomingLanes(), and TraCIServerAPI_Lane::processGet().

void MSLane::incorporateVehicle ( MSVehicle veh,
SUMOReal  pos,
SUMOReal  speed,
const MSLane::VehCont::iterator &  at,
MSMoveReminder::Notification  notification = MSMoveReminder::NOTIFICATION_DEPARTED 
)
protectedvirtual

Inserts the vehicle into this lane, and informs it about entering the network.

Calls the vehicles enterLaneAtInsertion function, updates statistics and modifies the active state as needed

Parameters
[in]vehThe vehicle to be incorporated
[in]posThe position of the vehicle
[in]speedThe speed of the vehicle
[in]at
[in]notificationThe cause of insertion (i.e. departure, teleport, parking) defaults to departure

Reimplemented in GUILane.

Definition at line 126 of file MSLane.cpp.

References MSVehicle::enterLaneAtInsertion(), MSNet::getEdgeControl(), MSNet::getInstance(), MSVehicleType::getLength(), MSVehicleType::getLengthWithGap(), MSBaseVehicle::getVehicleType(), MSEdgeControl::gotActive(), MSEdge::markDelayed(), myBruttoVehicleLengthSum, myEdge, myLength, myNettoVehicleLengthSum, and myVehicles.

Referenced by forceVehicleInsertion(), GUILane::incorporateVehicle(), isInsertionSuccess(), loadState(), and visit().

void MSLane::insertIDs ( std::vector< std::string > &  into)
static

Adds the ids of all stored lanes into the given vector.

Parameters

Definition at line 804 of file MSLane.cpp.

References myDict.

Referenced by dictSize(), and TraCIServerAPI_Lane::processGet().

bool MSLane::insertVehicle ( MSVehicle v)

Tries to insert the given vehicle.

The insertion position and speed are determined in dependence to the vehicle's departure definition, first.

Then, the vehicle is tried to be inserted into the lane using these values by a call to "isInsertionSuccess". The result of "isInsertionSuccess" is returned.

Parameters
[in]vThe vehicle to insert
Returns
Whether the vehicle could be inserted
See also
isInsertionSuccess
MSVehicle::getDepartureDefinition
MSVehicle::DepartArrivalDefinition

Definition at line 273 of file MSLane.cpp.

References basePos(), DEPART_POS_BASE, DEPART_POS_DEFAULT, DEPART_POS_FREE, DEPART_POS_GIVEN, DEPART_POS_LAST, DEPART_POS_RANDOM, DEPART_POS_RANDOM_FREE, SUMOVehicleParameter::departPos, SUMOVehicleParameter::departPosProcedure, freeInsertion(), getDepartSpeed(), getLength(), MSBaseVehicle::getParameter(), isInsertionSuccess(), lastInsertion(), myLength, MSMoveReminder::NOTIFICATION_DEPARTED, RandHelper::rand(), and SUMOReal.

Referenced by getMoveReminders(), and MSEdge::insertVehicle().

bool MSLane::integrateNewVehicle ( SUMOTime  t)
virtual
SUMOReal MSLane::interpolateGeometryPosToLanePos ( SUMOReal  geometryPos) const
inline

Definition at line 345 of file MSLane.h.

References myLengthGeometryFactor.

Referenced by GUILane::getPopUpMenu(), and MSLink::setRequestInformation().

bool MSLane::isApproachedFrom ( MSEdge *const  edge)

Definition at line 1021 of file MSLane.cpp.

References myApproachingLanes.

Referenced by getIncomingLanes().

bool MSLane::isApproachedFrom ( MSEdge *const  edge,
MSLane *const  lane 
)

Definition at line 1027 of file MSLane.cpp.

References myApproachingLanes.

bool MSLane::isEmpty ( ) const

Returns the information whether the lane is has no vehicle and no partial occupation

Definition at line 875 of file MSLane.cpp.

References myInlappingVehicle, and myVehicles.

Referenced by dictSize().

bool MSLane::isInsertionSuccess ( MSVehicle vehicle,
SUMOReal  speed,
SUMOReal  pos,
bool  recheckNextLanes,
MSMoveReminder::Notification  notification 
)

Tries to insert the given vehicle with the given state (speed and pos)

Checks whether the vehicle can be inserted at the given position with the given speed so that no collisions with leader/follower occur and the speed does not cause unexpected behaviour on consecutive lanes. Returns false if the vehicle can not be inserted.

If the insertion can take place, incorporateVehicleis called and true is returned.

Parameters
[in]vehicleThe vehicle to insert
[in]speedThe speed with which it shall be inserted
[in]posThe position at which it shall be inserted
[in]recheckNextLanesForces patching the speed for not being too fast on next lanes
[in]notificationThe cause of insertion (i.e. departure, teleport, parking) defaults to departure
Returns
Whether the vehicle could be inserted
See also
MSVehicle::enterLaneAtInsertion

Definition at line 341 of file MSLane.cpp.

References ARRIVAL_SPEED_GIVEN, SUMOVehicleParameter::arrivalSpeed, SUMOVehicleParameter::arrivalSpeedProcedure, MSRoute::begin(), MSCFModel::brakeGap(), checkFailure(), MSInsertionControl::descheduleDeparture(), MSCFModel::freeSpeed(), MSVehicle::gap(), MSVehicle::getBestLanesContinuation(), MSVehicle::getCarFollowModel(), MSNet::getCurrentTimeStep(), getEdge(), MSBaseVehicle::getID(), MSBaseVehicle::getImpatience(), MSNet::getInsertionControl(), MSNet::getInstance(), MSRoute::getLastEdge(), getLastVehicle(), MSVehicleType::getLength(), getLength(), MSCFModel::getMaxDecel(), MSVehicleType::getMinGap(), getMissingRearGap(), MSBaseVehicle::getParameter(), getPartialOccupator(), getPartialOccupatorEnd(), MSVehicle::getPositionOnLane(), MSBaseVehicle::getRoute(), MSCFModel::getSecureGap(), MSVehicle::getSpeed(), getVehicleMaxSpeed(), MSBaseVehicle::getVehicleType(), incorporateVehicle(), MSCFModel::insertionFollowSpeed(), isLinkEnd(), LINKSTATE_ALLWAY_STOP, LINKSTATE_EQUAL, LINKSTATE_MINOR, LINKSTATE_STOP, MAX2(), myLength, myVehicles, NUMERICAL_EPS, MSVehicle::setTentativeLaneAndPosition(), MSCFModel::stopSpeed(), succLinkSec(), SUMO_const_haltingSpeed, SUMOReal, TIME2STEPS, toString(), MSVehicle::updateBestLanes(), WRITE_ERROR, and WRITE_WARNING.

Referenced by MSVehicleTransfer::checkInsertions(), freeInsertion(), getMoveReminders(), insertVehicle(), and lastInsertion().

bool MSLane::isLinkEnd ( MSLinkCont::const_iterator &  i) const

Returns the information whether the given link shows at the end of the list of links (is not valid)

Definition at line 864 of file MSLane.cpp.

References myLinks.

Referenced by MSLaneChanger::checkChange(), dictSize(), getCriticalLeader(), isInsertionSuccess(), MSVehicle::planMoveInternal(), and MSVehicle::unsafeLinkAhead().

bool MSLane::isLinkEnd ( MSLinkCont::iterator &  i)

Returns the information whether the given link shows at the end of the list of links (is not valid)

Definition at line 870 of file MSLane.cpp.

References myLinks.

bool Parameterised::knowsParameter ( const std::string &  key) const
inherited

Returns whether the parameter is known.

Parameters
[in]keyThe key to ask for
Returns
Whether the key is known

Definition at line 75 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by MSDevice_Example::buildVehicleDevices(), and MSDevice::equippedByDefaultAssignmentOptions().

void MSLane::loadState ( std::vector< std::string > &  vehIDs,
MSVehicleControl vc 
)

Loads the state of this segment with the given parameters.

This method is called for every internal que the segment has. Every vehicle is retrieved from the given MSVehicleControl and added to this lane.

Parameters
[in]vehIDsThe vehicle ids for the current que
[in]vcThe vehicle control to retrieve references vehicles from
Todo:

What about throwing an IOError?

What about throwing an error if something else fails (a vehicle can not be referenced)?

Definition at line 1605 of file MSLane.cpp.

References MSVehicle::getPositionOnLane(), MSVehicle::getSpeed(), MSVehicleControl::getVehicle(), incorporateVehicle(), myVehicles, MSMoveReminder::NOTIFICATION_JUNCTION, and MSVehicle::updateBestLanes().

Referenced by getIncomingLanes().

MSLane& MSLane::operator= ( const MSLane )
private

invalidated assignment operator

Referenced by MSLane::edge_finder::operator()().

void MSLane::planMovements ( const SUMOTime  t)
virtual

Compute safe velocities for all vehicles based on positions and speeds from the last time step. Also registers ApproachingVehicleInformation for all links.

This method goes through all vehicles calling their "planMove" method.

See also
MSVehicle::planMove

Reimplemented in GUILane.

Definition at line 580 of file MSLane.cpp.

References MSVehicleType::getLengthWithGap(), getPartialOccupator(), MSBaseVehicle::getVehicleType(), myVehicles, and SUMOReal.

Referenced by getIndex(), and GUILane::planMovements().

void MSLane::resetPartialOccupation ( MSVehicle v)

Removes the information about a vehicle lapping into this lane.

Parameters
[in]vThe vehicle which laps into this lane

Definition at line 547 of file MSLane.cpp.

References MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getShadowLane(), MSAbstractLaneChangeModel::isChangingLanes(), myInlappingVehicle, and myInlappingVehicleEnd.

Referenced by MSAbstractLaneChangeModel::continueLaneChangeManeuver(), MSAbstractLaneChangeModel::endLaneChangeManeuver(), and getMoveReminders().

void MSLane::saveState ( OutputDevice out)

Saves the state of this lane into the given stream.

Basically, a list of vehicle ids

Parameters

Definition at line 1594 of file MSLane.cpp.

References OutputDevice::closeTag(), Named::getID(), myVehicles, OutputDevice::openTag(), SUMO_ATTR_VALUE, SUMO_TAG_LANE, SUMO_TAG_VIEWSETTINGS_VEHICLES, and OutputDevice::writeAttr().

Referenced by getIncomingLanes().

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 73 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

void MSLane::setLength ( SUMOReal  val)

Sets a new length for the lane (used by TraCI only)

Parameters
[in]valthe new length in m

Definition at line 960 of file MSLane.cpp.

References myEdge, and MSEdge::recalcCache().

Referenced by empty(), and TraCIServerAPI_Lane::processSet().

void MSLane::setMaxSpeed ( SUMOReal  val)

Sets a new maximum speed for the lane (used by TraCI and MSCalibrator)

Parameters
[in]valthe new speed in m/s

Definition at line 953 of file MSLane.cpp.

References myEdge, myMaxSpeed, and MSEdge::recalcCache().

Referenced by empty(), and TraCIServerAPI_Lane::processSet().

SUMOReal MSLane::setPartialOccupation ( MSVehicle v,
SUMOReal  leftVehicleLength 
)

Sets the information about a vehicle lapping into this lane.

The given left length of vehicle which laps into this lane is used to determine the vehicle's end position in regard to this lane's length. This information is set into myInlappingVehicleState; additionally, the vehicle pointer is stored in myInlappingVehicle; Returns this lane's length for subtracting it from the left vehicle length.

Parameters
[in]vThe vehicle which laps into this lane
[in]leftVehicleLengthThe distance the vehicle laps into this lane
Returns
This lane's length

Definition at line 531 of file MSLane.cpp.

References MSVehicle::getLaneChangeModel(), MSAbstractLaneChangeModel::getShadowLane(), MSAbstractLaneChangeModel::hasShadowVehicle(), MSAbstractLaneChangeModel::isChangingLanes(), myInlappingVehicle, myInlappingVehicleEnd, myLength, and MSAbstractLaneChangeModel::setShadowPartialOccupator().

Referenced by getMoveReminders(), and MSAbstractLaneChangeModel::startLaneChangeManeuver().

void MSLane::setPermissions ( SVCPermissions  permissions)
inline

Definition at line 571 of file MSLane.h.

References myPermissions.

Referenced by TraCIServerAPI_Lane::processSet().

MSLinkCont::const_iterator MSLane::succLinkSec ( const SUMOVehicle veh,
unsigned int  nRouteSuccs,
const MSLane succLinkSource,
const std::vector< MSLane * > &  conts 
)
static
void MSLane::swapAfterLaneChange ( SUMOTime  t)
protectedvirtual

moves myTmpVehicles int myVehicles after a lane change procedure

Reimplemented in GUILane.

Definition at line 967 of file MSLane.cpp.

References myTmpVehicles, and myVehicles.

Referenced by GUILane::swapAfterLaneChange(), and visit().

void MSLane::visit ( const TraCIServerAPI_Lane::StoringVisitor cont) const
inline

Callback for visiting the lane when traversing an RTree.

This is used in the TraCIServerAPI_Lane for context subscriptions.

Parameters
[in]contThe context doing all the work
See also
TraCIServerAPI_Lane::StoringVisitor::add

Definition at line 797 of file MSLane.h.

References TraCIServerAPI_Lane::StoringVisitor::add(), basePos(), getDepartSpeed(), getMaximumBrakeDist(), handleCollision(), incorporateVehicle(), MSMoveReminder::NOTIFICATION_DEPARTED, SUMOReal, and swapAfterLaneChange().

Referenced by TraCIServer::collectObjectsInRange().

Friends And Related Function Documentation

friend class MSLaneChanger
friend

needs access to myTmpVehicles (this maybe should be done via double-buffering!!!)

Definition at line 80 of file MSLane.h.

friend class MSQueueExport
friend

Definition at line 84 of file MSLane.h.

friend class MSXMLRawOut
friend

Definition at line 82 of file MSLane.h.

Field Documentation

std::map<MSEdge*, std::vector<MSLane*> > MSLane::myApproachingLanes
protected

Definition at line 903 of file MSLane.h.

Referenced by addApproachingLane(), and isApproachedFrom().

SUMOReal MSLane::myBruttoVehicleLengthSum
protected

The current length of all vehicles on this lane, including their minGaps.

Definition at line 887 of file MSLane.h.

Referenced by enteredByLaneChange(), executeMovements(), getBruttoOccupancy(), getBruttoVehLenSum(), handleCollision(), incorporateVehicle(), integrateNewVehicle(), leftByLaneChange(), and removeVehicle().

MSLane::DictType MSLane::myDict
staticprotected

Static dictionary to associate string-ids with objects.

Definition at line 912 of file MSLane.h.

Referenced by clear(), dictionary(), dictSize(), fill(), and insertIDs().

std::vector<IncomingLaneInfo> MSLane::myIncomingLanes
protected
int MSLane::myIndex
protected

The lane index.

Definition at line 845 of file MSLane.h.

Referenced by GUILane::drawMarkings(), and getIndex().

MSVehicle* MSLane::myInlappingVehicle
protected

The vehicle which laps into this lane.

Definition at line 896 of file MSLane.h.

Referenced by getBruttoOccupancy(), getLastVehicleInformation(), getNettoOccupancy(), getPartialOccupator(), isEmpty(), resetPartialOccupation(), and setPartialOccupation().

SUMOReal MSLane::myInlappingVehicleEnd
protected

End position of a vehicle which laps into this lane.

Definition at line 893 of file MSLane.h.

Referenced by getBruttoOccupancy(), getLastVehicleInformation(), getNettoOccupancy(), getPartialOccupatorEnd(), resetPartialOccupation(), and setPartialOccupation().

const SUMOReal MSLane::myLengthGeometryFactor
protected
MSLinkCont MSLane::myLinks
protected

The lane's Links to it's succeeding lanes and the default right-of-way rule, i.e. blocked or not blocked.

Definition at line 901 of file MSLane.h.

Referenced by addLink(), appropriate(), GUILane::drawArrows(), GUILane::drawLane2LaneConnections(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawTLSLinkNo(), executeMovements(), getCrossingIndex(), getLinkCont(), getOutgoingLanes(), isLinkEnd(), succLinkSec(), and ~MSLane().

MSLane* MSLane::myLogicalPredecessorLane
mutableprotected

Definition at line 883 of file MSLane.h.

Referenced by getLogicalPredecessorLane().

SUMOReal MSLane::myMaxSpeed
protected

Lane-wide speedlimit [m/s].

Definition at line 866 of file MSLane.h.

Referenced by GUILane::getColorValue(), getMeanSpeed(), GUILane::getScaleValue(), getSpeedLimit(), getVehicleMaxSpeed(), and setMaxSpeed().

std::vector< MSMoveReminder* > MSLane::myMoveReminders
private

This lane's move reminder.

Definition at line 916 of file MSLane.h.

Referenced by addMoveReminder(), and getMoveReminders().

SUMOReal MSLane::myNettoVehicleLengthSum
protected

The current length of all vehicles on this lane, excluding their minGaps.

Definition at line 890 of file MSLane.h.

Referenced by enteredByLaneChange(), executeMovements(), getNettoOccupancy(), handleCollision(), incorporateVehicle(), integrateNewVehicle(), leftByLaneChange(), and removeVehicle().

size_t MSLane::myNumericalID
protected

Unique numerical ID (set on reading by netload)

Definition at line 839 of file MSLane.h.

Referenced by getNumericalID().

const std::map<SUMOVehicleClass, SUMOReal>* MSLane::myRestrictions
protected

The vClass speed restrictions for this lane.

Definition at line 880 of file MSLane.h.

Referenced by getVehicleMaxSpeed(), and MSLane().

VehCont MSLane::myTmpVehicles
protected

Container for lane-changing vehicles. After completion of lane-change- process, the two containers will be swapped.

Definition at line 870 of file MSLane.h.

Referenced by swapAfterLaneChange().

std::vector<MSVehicle*> MSLane::myVehBuffer
protected

buffer for vehicles that moved from their previous lane onto this one

Definition at line 874 of file MSLane.h.

Referenced by empty(), executeMovements(), integrateNewVehicle(), and MSXMLRawOut::writeLane().

VehCont MSLane::myVehicles
protected

The lane's vehicles. The entering vehicles are inserted at the front of this container and the leaving ones leave from the back, e.g. the vehicle in front of the junction (often called first) is myVehicles.back() (if it exists). And if it is an iterator at a vehicle, ++it points to the vehicle in front. This is the interaction vehicle.

Definition at line 854 of file MSLane.h.

Referenced by addMoveReminder(), detectCollisions(), empty(), executeMovements(), GUILane::firstWaitingTime(), forceVehicleInsertion(), freeInsertion(), getBruttoOccupancy(), getFirstVehicle(), getLastVehicle(), getLastVehicleInformation(), getLeader(), getMeanSpeed(), getNettoOccupancy(), getVehicleNumber(), GUILane::getVehiclesSecure(), getVehiclesSecure(), getWaitingSeconds(), incorporateVehicle(), integrateNewVehicle(), isEmpty(), isInsertionSuccess(), lastInsertion(), loadState(), planMovements(), removeVehicle(), saveState(), swapAfterLaneChange(), MSQueueExport::writeLane(), and MSXMLRawOut::writeLane().

const SUMOReal MSLane::myWidth
protected

The documentation for this class was generated from the following files: