SUMO - Simulation of Urban MObility
MESegment Class Reference

A single mesoscopic segment (cell) More...

#include <MESegment.h>

Inheritance diagram for MESegment:
Inheritance graph
Collaboration diagram for MESegment:
Collaboration graph

Public Types

typedef std::vector< MEVehicle * > Queue
 
typedef std::vector< QueueQueues
 

Public Member Functions

void addReminders (MEVehicle *veh) const
 add this lanes MoveReminders to the given vehicle More...
 
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
bool free () const
 return whether this segment is considered free as opposed to jammed More...
 
double getBruttoOccupancy () const
 Returns the occupany of the segment (the sum of the vehicle lengths + minGaps) More...
 
int getCarNumber () const
 Returns the total number of cars on the segment. More...
 
const MSEdgegetEdge () const
 Returns the edge this segment belongs to. More...
 
SUMOTime getEntryBlockTime () const
 return the next time at which a vehicle my enter this segment More...
 
SUMOTime getEventTime () const
 Returns the (planned) time at which the next vehicle leaves this segment. More...
 
double getEventTimeSeconds () const
 Like getEventTime but returns seconds (for visualization) More...
 
double getFlow () const
 returns flow based on headway More...
 
const std::string & getID () const
 Returns the id. More...
 
int getIndex () const
 Returns the running index of the segment in the edge (0 is the most upstream). More...
 
double getLastHeadwaySeconds () const
 get the last headway time in seconds More...
 
double getLength () const
 Returns the length of the segment in meters. More...
 
MSLinkgetLink (const MEVehicle *veh, bool tlsPenalty=false) const
 Returns the link the given car will use when passing the next junction. More...
 
SUMOTime getLinkPenalty (const MEVehicle *veh) const
 Returns the penalty time for passing a link (if using gMesoTLSPenalty > 0 or gMesoMinorPenalty > 0) More...
 
double getMeanSpeed (bool useCache) const
 Returns the average speed of vehicles on the segment in meters per second. If there is no vehicle on the segment it returns the maximum allowed speed. More...
 
double getMeanSpeed () const
 wrapper to satisfy the FunctionBinding signature More...
 
SUMOTime getMinimumHeadwayTime () const
 return the minimum headway-time with which vehicles may enter or leave this segment More...
 
SUMOTime getNextInsertionTime (SUMOTime earliestEntry) const
 return a time after earliestEntry at which a vehicle may be inserted at full speed More...
 
MESegmentgetNextSegment () const
 Returns the following segment on the same edge (0 if it is the last). More...
 
const QueuegetQueue (int index) const
 Returns the cars in the queue with the given index for visualization. More...
 
double getRelativeJamThreshold () const
 Returns the relative occupany of the segment (percentage of road used)) at which the segment is considered jammed. More...
 
double getRelativeOccupancy () const
 Returns the relative occupany of the segment (percentage of road used)) More...
 
double getTLSCapacity (const MEVehicle *veh) const
 Returns the average green time as fraction of cycle time. More...
 
std::vector< const MEVehicle * > getVehicles () const
 returns all vehicles (for debugging) More...
 
bool hasSpaceFor (const MEVehicle *veh, SUMOTime entryTime, bool init=false) const
 Returns whether the given vehicle would still fit into the segment. More...
 
bool initialise (MEVehicle *veh, SUMOTime time)
 Inserts (emits) vehicle into the segment. More...
 
bool isOpen (const MEVehicle *veh) const
 Returns whether the vehicle may use the next link. More...
 
 MESegment (const std::string &id, const MSEdge &parent, MESegment *next, double length, double speed, int idx, SUMOTime tauff, SUMOTime taufj, SUMOTime taujf, SUMOTime taujj, double jamThresh, bool multiQueue, bool junctionControl)
 constructor More...
 
int numQueues () const
 return the number of queues More...
 
void receive (MEVehicle *veh, SUMOTime time, bool isDepart=false, bool afterTeleport=false)
 Adds the vehicle to the segment, adapting its parameters. More...
 
int remainingVehicleCapacity (const double vehLength) const
 return the remaining physical space on this segment More...
 
MEVehicleremoveCar (MEVehicle *v, SUMOTime leaveTime, MESegment *next)
 Removes the given car from the edge's que. More...
 
void send (MEVehicle *veh, MESegment *next, SUMOTime time)
 Removes the vehicle from the segment, adapting its parameters. More...
 
void setEntryBlockTime (SUMOTime entryBlockTime)
 set the next time at which a vehicle my enter this segment More...
 
void setID (const std::string &newID)
 resets the id More...
 
void setSpeed (double newSpeed, SUMOTime currentTime, double jamThresh=DO_NOT_PATCH_JAM_THRESHOLD)
 reset mySpeed and patch the speed of all vehicles in it. Also set/recompute myJamThreshold More...
 
bool vaporizeAnyCar (SUMOTime currentTime)
 tries to remove any car from this segment More...
 
void writeVehicles (OutputDevice &of) const
 
Measure collection
void addDetector (MSMoveReminder *data)
 Adds a data collector for a detector to this segment. More...
 
void removeDetector (MSMoveReminder *data)
 Removes a data collector for a detector from this segment. More...
 
void prepareDetectorForWriting (MSMoveReminder &data)
 Updates data of a detector for all vehicle queues. More...
 
State saving/loading
void saveState (OutputDevice &out)
 Saves the state of this segment into the given stream. More...
 
void loadState (std::vector< std::string > &vehIDs, MSVehicleControl &vc, const SUMOTime blockTime, const int queIdx)
 Loads the state of this segment with the given parameters. More...
 

Static Public Member Functions

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 bool isInvalid (const MESegment *segment)
 whether the given segment is 0 or encodes vaporization More...
 

Static Public Attributes

static const double DO_NOT_PATCH_JAM_THRESHOLD
 

Protected Attributes

std::string myID
 The name of the object. More...
 

Private Member Functions

double getMaxPenaltySeconds () const
 return the maximum tls penalty for all links from this edge More...
 
SUMOTime getTimeHeadway (const MESegment *pred, const MEVehicle *veh)
 
bool hasBlockedLeader () const
 whether a leader in any queue is blocked More...
 
double jamThresholdForSpeed (double speed, double jamThresh) const
 compute jam threshold for the given speed and jam-threshold option More...
 
bool limitedControlOverride (const MSLink *link) const
 whether the given link may be passed because the option meso-junction-control.limited is set More...
 
 MESegment (const MESegment &)
 Invalidated copy constructor. More...
 
 MESegment (const std::string &id)
 constructor for dummy segment More...
 
SUMOTime newArrival (const MEVehicle *const v, double newSpeed, SUMOTime currentTime)
 compute the new arrival time when switching speed More...
 
MESegmentoperator= (const MESegment &)
 Invalidated assignment operator. More...
 
bool overtake ()
 
void recomputeJamThreshold (double jamThresh)
 compute a value for myJamThreshold if jamThresh is negative, compute a value which allows free flow at mySpeed interpret jamThresh as the relative occupation at which jam starts More...
 
void setSpeedForQueue (double newSpeed, SUMOTime currentTime, SUMOTime blockTime, const std::vector< MEVehicle *> &vehs)
 
SUMOTime tauWithVehLength (SUMOTime tau, double lengthWithGap) const
 convert net time gap (leader back to follower front) to gross time gap (leader front to follower front) More...
 
void updateDetectorsOnLeave (MEVehicle *v, SUMOTime currentTime, MESegment *next)
 Updates data of all detectors for a leaving vehicle. More...
 

Static Private Member Functions

static bool useMultiQueue (bool multiQueue, const MSEdge &parent)
 whether the segment requires use of multiple queues More...
 

Private Attributes

double myA
 slope and axis offset for the jam-jam headway function More...
 
double myB
 
std::vector< SUMOTimemyBlockTimes
 The block times. More...
 
const double myCapacity
 The number of lanes * the length. More...
 
Queues myCarQues
 The car queues. Vehicles are inserted in the front and removed in the back. More...
 
std::vector< MSMoveReminder * > myDetectorData
 The data collection for all kinds of detectors. More...
 
const MSEdgemyEdge
 The microsim edge this segment belongs to. More...
 
SUMOTime myEntryBlockTime
 
std::map< const MSEdge *, std::vector< int > > myFollowerMap
 The follower edge to que index mapping for multi queue segments. More...
 
const double myHeadwayCapacity
 The capacity of the segment in number of cars, used only in time headway calculation This parameter has only an effect if tau_jf != tau_jj, which is not(!) the case per default. More...
 
const int myIndex
 Running number of the segment in the edge. More...
 
double myJamThreshold
 The space (in m) which needs to be occupied before the segment is considered jammed. More...
 
const bool myJunctionControl
 Whether junction control is enabled. More...
 
SUMOTime myLastHeadway
 the last headway More...
 
SUMOTime myLastMeanSpeedUpdate
 the time at which myMeanSpeed was last updated More...
 
const double myLength
 The segment's length. More...
 
double myMeanSpeed
 the mean speed on this segment. Updated at event time or on demand More...
 
const bool myMinorPenalty
 Whether minor penalty is enabled. More...
 
MESegmentmyNextSegment
 The next segment of this edge, 0 if this is the last segment of this edge. More...
 
double myOccupancy
 The occupied space (in m) on the segment. More...
 
const SUMOTime myTau_ff
 The time headway parameters, see the Eissfeldt thesis. More...
 
const SUMOTime myTau_fj
 
const SUMOTime myTau_jf
 
const SUMOTime myTau_jj
 
double myTau_length
 Headway parameter for computing gross time headyway from net time headway, length and edge speed. More...
 
const bool myTLSPenalty
 Whether tls penalty is enabled. More...
 

Static Private Attributes

static MSEdge myDummyParent
 
static MESegment myVaporizationTarget
 

Detailed Description

A single mesoscopic segment (cell)

Definition at line 56 of file MESegment.h.

Member Typedef Documentation

◆ Queue

typedef std::vector<MEVehicle*> MESegment::Queue

Definition at line 85 of file MESegment.h.

◆ Queues

typedef std::vector<Queue> MESegment::Queues

Definition at line 86 of file MESegment.h.

Constructor & Destructor Documentation

◆ MESegment() [1/3]

MESegment::MESegment ( const std::string &  id,
const MSEdge parent,
MESegment next,
double  length,
double  speed,
int  idx,
SUMOTime  tauff,
SUMOTime  taufj,
SUMOTime  taujf,
SUMOTime  taujj,
double  jamThresh,
bool  multiQueue,
bool  junctionControl 
)

constructor

Parameters
[in]idThe id of this segment (currently: "<EDGEID>:<SEGMENTNO>")
[in]parentThe edge this segment is located within
[in]nextThe following segment (belonging to the same edge)
[in]lengthThe segment's length
[in]speedThe speed allowed on this segment
[in]idxThe running index of this segment within the segment's edge
[in]tauffThe factor for free-free headway time
[in]taufjThe factor for free-jam headway time
[in]taujfThe factor for jam-free headway time
[in]taujjThe factor for jam-jam headway time
[in]jamThreshpercentage of occupied space before the segment is jammed
[in]multiQueuewhether to install multiple queues on this segment
[in]junctionControlwhether junction control is enabled on this segment
[in]thequotient of geometrical length / given length
Todo:
recheck the id; using a ':' as divider is not really nice

Definition at line 66 of file MESegment.cpp.

References MSEdge::allowedLanes(), MSEdge::getLanes(), MSEdge::getNumSuccessors(), MSEdge::getSuccessors(), myBlockTimes, myCarQues, myFollowerMap, recomputeJamThreshold(), and useMultiQueue().

◆ MESegment() [2/3]

MESegment::MESegment ( const MESegment )
private

Invalidated copy constructor.

◆ MESegment() [3/3]

MESegment::MESegment ( const std::string &  id)
private

constructor for dummy segment

Definition at line 124 of file MESegment.cpp.

Member Function Documentation

◆ addDetector()

void MESegment::addDetector ( MSMoveReminder data)

Adds a data collector for a detector to this segment.

Parameters
[in]dataThe data collector to add

Definition at line 204 of file MESegment.cpp.

References myCarQues, and myDetectorData.

Referenced by MSMeanData::init(), MEInductLoop::MEInductLoop(), METriggeredCalibrator::METriggeredCalibrator(), MSRouteProbe::MSRouteProbe(), and MSTriggeredRerouter::MSTriggeredRerouter().

◆ addReminders()

void MESegment::addReminders ( MEVehicle veh) const

add this lanes MoveReminders to the given vehicle

Definition at line 479 of file MESegment.cpp.

References MSBaseVehicle::addReminder(), and myDetectorData.

Referenced by receive().

◆ addTo()

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

Adds this object to the given container.

Parameters

Definition at line 128 of file Named.h.

References Named::StoringVisitor::add().

◆ free()

bool MESegment::free ( ) const
inline

return whether this segment is considered free as opposed to jammed

Definition at line 350 of file MESegment.h.

References myJamThreshold, and myOccupancy.

Referenced by getMeanSpeed(), getTimeHeadway(), and hasSpaceFor().

◆ getBruttoOccupancy()

double MESegment::getBruttoOccupancy ( ) const
inline

Returns the occupany of the segment (the sum of the vehicle lengths + minGaps)

Returns
the occupany of the segment in meters

Definition at line 172 of file MESegment.h.

References myOccupancy.

Referenced by METriggeredCalibrator::invalidJam().

◆ getCarNumber()

int MESegment::getCarNumber ( ) const

Returns the total number of cars on the segment.

Returns
the total number of cars on the segment

Definition at line 302 of file MESegment.cpp.

References myCarQues.

Referenced by getFlow(), GUIEdge::getParameterWindow(), getTimeHeadway(), and MSXMLRawOut::writeEdge().

◆ getEdge()

◆ getEntryBlockTime()

SUMOTime MESegment::getEntryBlockTime ( ) const
inline

return the next time at which a vehicle my enter this segment

Definition at line 364 of file MESegment.h.

References myEntryBlockTime.

Referenced by MELoop::checkCar().

◆ getEventTime()

SUMOTime MESegment::getEventTime ( ) const

Returns the (planned) time at which the next vehicle leaves this segment.

Returns
The time the vehicle thinks it leaves

Definition at line 624 of file MESegment.cpp.

References myCarQues, and SUMOTime_MAX.

Referenced by MELoop::checkCar(), getEdge(), and getEventTimeSeconds().

◆ getEventTimeSeconds()

double MESegment::getEventTimeSeconds ( ) const
inline

Like getEventTime but returns seconds (for visualization)

Definition at line 287 of file MESegment.h.

References getEventTime(), and STEPS2TIME.

Referenced by GUIEdge::getParameterWindow().

◆ getFlow()

double MESegment::getFlow ( ) const

returns flow based on headway

Note
: returns magic number 10000 when headway cannot be computed

Definition at line 692 of file MESegment.cpp.

References getCarNumber(), getMeanSpeed(), and myLength.

Referenced by getLastHeadwaySeconds(), and GUIEdge::getParameterWindow().

◆ getID()

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(), MSLCM_LC2013::adaptSpeedToPedestrians(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), LaneStoringVisitor::add(), MSPModel_Striping::add(), MSVehicleTransfer::add(), PCPolyContainer::add(), MSDetectorControl::add(), Named::StoringVisitor::add(), ShapeContainer::add(), IntermodalRouter< E, L, N, V >::addAccess(), NLTriggerBuilder::addAccess(), RORouteDef::addAlternative(), MSLane::addApproachingLane(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), MSPModel_Striping::addCrossingVehs(), RODFDetectorCon::addDetector(), RONet::addEdge(), NBParkingCont::addEdges2Keep(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), GUIEdge::addRerouter(), NBEdge::addRestrictedLane(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NIXMLEdgesHandler::addSplit(), NBTrafficLightLogic::addStep(), ROVehicle::addStop(), MSRouteHandler::addStop(), MSVehicle::addStop(), MSNet::addStoppingPlace(), NBEdge::addStraightConnections(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), MSVehicle::addTraciStopAtStoppingPlace(), AGActivityTripWriter::addTrip(), NIXMLConnectionsHandler::addWalkingArea(), NBEdge::append(), NBPTStopCont::assignAndCreatNewPTStopAsNeeded(), NBPTStopCont::assignPTStopToEdgeOfClosestPlatform(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), MSPModel_Striping::blockedAtDist(), MSLink::blockedAtTime(), MSLink::blockedByFoe(), NLEdgeControlBuilder::build(), NIVisumTL::build(), RODFNet::buildApproachList(), MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), NBNode::buildCrossings(), NBNode::buildCrossingsAndWalkingAreas(), NIImporter_VISUM::buildDistrictNode(), NLDetectorBuilder::buildE2Detector(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), GNETLSEditorFrame::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(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSEdge::checkAndRegisterBiDirEdge(), MSLane::checkForPedestrians(), NBEdge::checkGeometry(), NBEdgeCont::checkGrade(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkLinkLeader(), NBEdgeCont::checkOverlap(), MSDevice_Battery::checkParam(), MSE2Collector::checkPositioning(), MSVehicle::checkRewindLinkLanes(), MSSwarmTrafficLightLogic::choosePolicy(), MSDevice_SSM::classifyEncounter(), NBTrafficLightLogic::closeBuilding(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBLoadedSUMOTLDef::collectEdges(), NBTrafficLightDefinition::collectEdges(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBEdge::computeAngle(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBOwnTLDef::computeLogicAndConts(), NBNode::computeNodeShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBNode::computeSmoothShape(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSSOTLE2Sensors::countVehicles(), MSDevice_SSM::createEncounters(), GUINet::createTLWrapper(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSLane::detectCollisionBetween(), MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), NIVissimDistrictConnection::dict_BuildDistricts(), NBEdge::divideOnEdges(), NBEdge::divideSelectedLanesOnEdges(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSE3Collector::enter(), MSVehicle::enterLaneAtMove(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSPModel_Striping::MovePedestrians::execute(), MSTrafficLightLogic::SwitchCommand::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), libsumo::Helper::findCloserLane(), MSDevice_SSM::findFoeConflictLane(), libsumo::Simulation::findIntermodalRoute(), MSDevice_SSM::findSurroundingVehicles(), MSDevice_SSM::flushConflicts(), NBTrafficLightDefinition::forbids(), NBRampsComputer::fulfillsRampConstraints(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSPModel_Striping::getArbitraryPath(), GNEConnection::getAttribute(), MSVehicle::getBackPosition(), MSVehicle::getBackPositionOnLane(), libsumo::Vehicle::getBestLanes(), NBOwnTLDef::getBestPair(), MSVehicle::getCenterOnEdge(), MSDevice_Battery::getChargingStationID(), NBEdge::getConnection(), NBEdge::getConnectionRef(), libsumo::TrafficLight::getControlledLinks(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), libsumo::Lane::getEdgeID(), MSMeanData::getEdgeID(), NBEdge::getFirstNonPedestrianLane(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), libsumo::InductionLoop::getLaneID(), libsumo::LaneArea::getLaneID(), libsumo::Vehicle::getLaneID(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), MSLink::getLengthBeforeCrossing(), libsumo::Lane::getLinks(), MSLane::getLinkTo(), MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPerson::getNextEdge(), MSPModel_Striping::getNextLane(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getOppositePos(), GUITrafficLightLogicWrapper::getParameterWindow(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIE2Collector::MyWrapper::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), MSLane::getPartialBehind(), MSSOTLTrafficLightLogic::getPhaseIndexWithMaxCTS(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBPTStopCont::getReverseStop(), libsumo::Person::getRoadID(), libsumo::Vehicle::getRoadID(), libsumo::Vehicle::getRouteID(), MSNet::getStoppingPlaceID(), MSDevice_SSM::getUpstreamVehicles(), MSDevice_SSM::getVehiclesOnJunction(), MSTransportable::Stage_Driving::getWaitingDescription(), MSVehicleControl::getWaitingVehicle(), MSLink::getZipperSpeed(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSLane::handleCollisionBetween(), NBEdgeCont::ignoreFilterMatch(), MSVehicle::ignoreRed(), MSDeterministicHiLevelTrafficLightLogic::init(), MSRailSignal::init(), MSDelayBasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), MSTrafficLightLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), NBEdge::init(), MSE2Collector::initAuxiliaries(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBNodeCont::insert(), NBTrafficLightLogicCont::insert(), NBEdgeCont::insert(), MSEdge::insertVehicle(), MSLane::integrateNewVehicle(), IntermodalNetwork< E, L, N, V >::IntermodalNetwork(), GNEJunction::invalidateTLS(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), MSPedestrianPushButton::isActiveForEdge(), MSPedestrianPushButton::isActiveOnAnySideOfTheRoad(), RODFNet::isDestination(), RODFNet::isFalseSource(), MSLane::isInsertionSuccess(), RODFNet::isSource(), MSSOTLTrafficLightLogic::isThresholdPassed(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSAbstractLaneChangeModel::laneChangeOutput(), MSE3Collector::leave(), MSE3Collector::leaveFront(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSPedestrianPushButton::loadCrossingEdgeMap(), NIImporter_OpenDrive::loadNetwork(), MSPedestrianPushButton::loadPushButtons(), NBEdge::MainDirections::MainDirections(), ODDistrictCont::makeDistricts(), MSE2Collector::makeVehicleInfo(), GNEJunction::markAsModified(), MSSOTLE2Sensors::meanVehiclesSpeed(), METriggeredCalibrator::METriggeredCalibrator(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), libsumo::Person::moveToXY(), libsumo::Vehicle::moveToXY(), libsumo::Helper::moveToXYMap(), MSCalibrator::MSCalibrator(), MSChargingStation::MSChargingStation(), MSDevice_Battery::MSDevice_Battery(), MSE2Collector::MSE2Collector(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSCalibrator::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSPModel_Striping::nextBlocking(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSMeanData::MeanDataValues::notifyEnter(), MSDevice_Bluelight::notifyEnter(), MSDevice_Example::notifyEnter(), MSMeanData_Net::MSLaneMeanDataValues::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSMeanData::MeanDataValueTracker::notifyEnter(), MSE2Collector::notifyEnter(), MSDevice_SSM::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Bluelight::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSE3Collector::MSE3LeaveReminder::notifyLeave(), MSE2Collector::notifyLeave(), MSDevice_SSM::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSE2Collector::notifyMove(), MSDevice_SSM::notifyMove(), MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal(), GUIViewTraffic::onGamingClick(), GNEViewNet::onLeftBtnPress(), MSLink::opened(), 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()(), MSLane::incoming_lane_priority_sorter::operator()(), MSLane::outgoing_lane_priority_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NLTriggerBuilder::parseAndBuildCalibrator(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), MSRouteHandler::parseWalkPositions(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_LC2013::patchSpeed(), MSLCM_SL2015::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSVehicle::planMove(), MSVehicle::planMoveInternal(), MSLane::planMovements(), MSInternalJunction::postloadInit(), MSRightOfWayJunction::postloadInit(), NBEdge::prepareEdgePriorities(), AGStreet::print(), MSDevice_SSM::processEncounters(), MSVehicle::processLinkAproaches(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), NIXMLNodesHandler::processTrafficLightDefinitions(), NWWriter_SUMO::prohibitionConnection(), MSDelayBasedTrafficLightLogic::proposeProlongation(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckLanes(), NBEdge::recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), NIImporter_OpenStreetMap::reconstructLayerElevation(), NBLoadedSUMOTLDef::reconstructLogic(), NBNodeCont::remapIDs(), NBEdgeCont::remapIDs(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), MSLink::removeApproaching(), NBNodeCont::removeIsolatedRoads(), MSVehicle::removePassedDriveItems(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::rename(), NBEdgeCont::rename(), GNENet::renameEdge(), GNENet::renameJunction(), RORouteDef::repairCurrentRoute(), NBConnection::replaceFrom(), MSVehicle::replaceParkingArea(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIImporter_DlrNavteq::ConnectedLanesHandler::report(), MSBaseVehicle::reroute(), MSTriggeredRerouter::rerouteParkingArea(), MSLane::resetManeuverReservation(), MSLane::resetPartialOccupation(), NBEdge::restoreRestrictedLane(), GNEEdge::retrieveGNEConnection(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), NBPTLineCont::reviseStops(), MSPerson::MSPersonStage_Walking::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), RONet::saveAndRemoveRoutesUntil(), MSDevice_Vehroutes::saveState(), MSDevice::saveState(), MSDevice_Tripinfo::saveState(), MSBaseVehicle::saveState(), MSLane::saveState(), GUIVehicle::selectBlockingFoes(), MSE2Collector::selectLanes(), MSLink::setApproaching(), NBNodeCont::setAsTLControlled(), GNEEdge::setAttribute(), MSChargingStation::setChargeDelay(), MSChargingStation::setChargingPower(), NBEdge::setControllingTLInformation(), MSChargingStation::setEfficency(), GNEJunction::setLogicValid(), MSLane::setManeuverReservation(), MSDevice_Battery::setMaximumBatteryCapacity(), NBEdge::setNodeBorder(), NIXMLEdgesHandler::setNodes(), MSLane::setPartialOccupation(), MSDevice_Battery::setPowerMax(), MSLink::setRequestInformation(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSDevice_Battery::setStoppingTreshold(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBOwnTLDef::setTLControllingInformation(), NBTrafficLightLogicCont::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdge::shiftPositionAtNode(), NBEdgeCont::splitAt(), IntermodalRouter< E, L, N, V >::splitEdge(), MSLaneChangerSublane::startChangeSublane(), MSStopOut::stopEnded(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSSOTLTrafficLightLogic::trySwitch(), MSDevice_SSM::update(), MSVehicle::updateBestLanes(), MSLCM_SL2015::updateCFRelated(), MSSOTLTrafficLightLogic::updateCTS(), GNETLSEditorFrame::updateDescription(), MSVehicle::updateDriveItems(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSAbstractLaneChangeModel::updateTargetLane(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), MSPModel_Striping::PState::walk(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), NBParking::write(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), MSLink::writeApproaching(), NBSign::writeAsPOI(), NWWriter_DlrNavteq::writeConnectedLanes(), 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(), NWWriter_OpenDrive::writeInternalEdge(), writeInterval(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_OpenDrive::writeNormalEdge(), NWWriter_DlrNavteq::writeProhibitedManoeuvres(), NWWriter_SUMO::writeRoundabout(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFCDExport::writeTransportable(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), MSRouteProbe::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSE2Collector::writeXMLOutput(), and RONet::~RONet().

◆ getIDSecure()

◆ getIndex()

int MESegment::getIndex ( ) const
inline

Returns the running index of the segment in the edge (0 is the most upstream).

Returns
the running index of the segment in the edge

Definition at line 148 of file MESegment.h.

References myIndex.

Referenced by MELoop::changeSegment(), GUIEdge::getParameterWindow(), MEVehicle::getPositionOnLane(), MEVehicle::loadState(), MEVehicle::saveState(), MELoop::teleportVehicle(), MEVehicle::updateDetectorForWriting(), and MEVehicle::updateDetectors().

◆ getLastHeadwaySeconds()

double MESegment::getLastHeadwaySeconds ( ) const
inline

get the last headway time in seconds

Definition at line 292 of file MESegment.h.

References getFlow(), getVehicles(), loadState(), myLastHeadway, saveState(), and STEPS2TIME.

Referenced by GUIEdge::getParameterWindow().

◆ getLength()

double MESegment::getLength ( ) const
inline

◆ getLink()

MSLink * MESegment::getLink ( const MEVehicle veh,
bool  tlsPenalty = false 
) const

Returns the link the given car will use when passing the next junction.

This returns non-zero values only for the last segment and only if junction control is enabled.

Parameters
[in]vehThe vehicle in question
[in]tlsPenaltyWhether the link should be returned for computing tlsPenalty
Returns
The link to use or 0 without junction control

Definition at line 394 of file MESegment.cpp.

References MSEdge::getLanes(), MSLane::getLinkCont(), MEVehicle::getQueIndex(), myEdge, myJunctionControl, and MSBaseVehicle::succEdge().

Referenced by MELoop::checkCar(), getLinkPenalty(), getMeanSpeed(), getTLSCapacity(), isOpen(), loadState(), receive(), MEVehicle::replaceRoute(), send(), and setSpeedForQueue().

◆ getLinkPenalty()

SUMOTime MESegment::getLinkPenalty ( const MEVehicle veh) const

Returns the penalty time for passing a link (if using gMesoTLSPenalty > 0 or gMesoMinorPenalty > 0)

Parameters
[in]vehThe vehicle in question
Returns
The time penalty

Definition at line 698 of file MESegment.cpp.

References getLink(), MSLink::getMesoTLSPenalty(), MSGlobals::gMesoLimitedJunctionControl, MSGlobals::gMesoMinorPenalty, MSLink::havePriority(), MSLink::isTLSControlled(), limitedControlOverride(), myMinorPenalty, and myTLSPenalty.

Referenced by MEVehicle::getCurrentLinkPenaltySeconds(), and receive().

◆ getMaxPenaltySeconds()

double MESegment::getMaxPenaltySeconds ( ) const
private

return the maximum tls penalty for all links from this edge

Definition at line 733 of file MESegment.cpp.

References MSEdge::getLanes(), MSLane::getLinkCont(), MSLink::getMesoTLSPenalty(), MSGlobals::gMesoMinorPenalty, MSLink::havePriority(), MAX2(), myEdge, and STEPS2TIME.

Referenced by recomputeJamThreshold().

◆ getMeanSpeed() [1/2]

double MESegment::getMeanSpeed ( bool  useCache) const

Returns the average speed of vehicles on the segment in meters per second. If there is no vehicle on the segment it returns the maximum allowed speed.

Parameters
[in]useCachewhether to use a cached value if available
Note
this value is cached in myMeanSpeed. Since caching only takes place once every simstep there is a potential for side-influences (i.e. GUI calls to this method, ...) For that reason the simulation logic doesn't use the cache. This shouldn't matter much for speed since it is only used during initializsation of vehicles onto the segment.
Returns
the average speed on the segment

Definition at line 312 of file MESegment.cpp.

References free(), MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSEdge::getSpeedLimit(), myCarQues, myEdge, myLastMeanSpeedUpdate, myMeanSpeed, myTau_ff, myTau_jf, and tauWithVehLength().

Referenced by METriggeredCalibrator::invalidJam().

◆ getMeanSpeed() [2/2]

double MESegment::getMeanSpeed ( ) const
inline

wrapper to satisfy the FunctionBinding signature

Definition at line 205 of file MESegment.h.

References getLink(), isOpen(), receive(), removeCar(), send(), vaporizeAnyCar(), and writeVehicles().

Referenced by getFlow(), GUIEdge::getParameterWindow(), getRelativeJamThreshold(), and hasSpaceFor().

◆ getMinimumHeadwayTime()

SUMOTime MESegment::getMinimumHeadwayTime ( ) const
inline

return the minimum headway-time with which vehicles may enter or leave this segment

Definition at line 374 of file MESegment.h.

References myTau_ff.

Referenced by METriggeredCalibrator::maximumInflow().

◆ getNextInsertionTime()

SUMOTime MESegment::getNextInsertionTime ( SUMOTime  earliestEntry) const

return a time after earliestEntry at which a vehicle may be inserted at full speed

Definition at line 379 of file MESegment.cpp.

References MSEdge::getSpeedLimit(), MAX2(), MAX3(), myBlockTimes, myCarQues, myEdge, myEntryBlockTime, myLength, and TIME2STEPS.

Referenced by METriggeredCalibrator::execute(), and isInvalid().

◆ getNextSegment()

MESegment* MESegment::getNextSegment ( ) const
inline

◆ getQueue()

const Queue& MESegment::getQueue ( int  index) const
inline

Returns the cars in the queue with the given index for visualization.

Returns
the Queue (XXX not thread-safe!)

Definition at line 139 of file MESegment.h.

References myCarQues.

◆ getRelativeJamThreshold()

double MESegment::getRelativeJamThreshold ( ) const
inline

Returns the relative occupany of the segment (percentage of road used)) at which the segment is considered jammed.

Returns
the jam treshold of the segment in percent

Definition at line 188 of file MESegment.h.

References getMeanSpeed(), myCapacity, and myJamThreshold.

Referenced by GUIEdge::getParameterWindow().

◆ getRelativeOccupancy()

double MESegment::getRelativeOccupancy ( ) const
inline

Returns the relative occupany of the segment (percentage of road used))

Returns
the occupany of the segment in percent

Definition at line 180 of file MESegment.h.

References myCapacity, and myOccupancy.

Referenced by GUIEdge::getParameterWindow().

◆ getTimeHeadway()

SUMOTime MESegment::getTimeHeadway ( const MESegment pred,
const MEVehicle veh 
)
private

◆ getTLSCapacity()

double MESegment::getTLSCapacity ( const MEVehicle veh) const

Returns the average green time as fraction of cycle time.

Parameters
[in]vehThe vehicle in question for determining the link
Returns
The green fraction or 1 if the vehicle does not continue after this edge

Definition at line 719 of file MESegment.cpp.

References MSLink::getGreenFraction(), getLink(), MSLink::isTLSControlled(), and myTLSPenalty.

Referenced by getTimeHeadway().

◆ getVehicles()

std::vector< const MEVehicle * > MESegment::getVehicles ( ) const

returns all vehicles (for debugging)

Definition at line 671 of file MESegment.cpp.

References myCarQues.

Referenced by getLastHeadwaySeconds().

◆ hasBlockedLeader()

bool MESegment::hasBlockedLeader ( ) const
private

whether a leader in any queue is blocked

Definition at line 681 of file MESegment.cpp.

References myCarQues.

Referenced by hasSpaceFor().

◆ hasSpaceFor()

bool MESegment::hasSpaceFor ( const MEVehicle veh,
SUMOTime  entryTime,
bool  init = false 
) const

Returns whether the given vehicle would still fit into the segment.

Parameters
[in]vehThe vehicle to check space for
[in]entryTimeThe time at which the vehicle wants to enter
[in]initwhether the check is done at insertion time
Returns
true if the vehicle may be added to this segment, false otherwise

Definition at line 260 of file MESegment.cpp.

References free(), MSVehicleType::getLengthWithGap(), getMeanSpeed(), MSBaseVehicle::getVehicleType(), hasBlockedLeader(), jamThresholdForSpeed(), myCapacity, myEntryBlockTime, myJamThreshold, and myOccupancy.

Referenced by MELoop::changeSegment(), MELoop::checkCar(), initialise(), MSEdge::insertVehicle(), and MELoop::teleportVehicle().

◆ initialise()

bool MESegment::initialise ( MEVehicle veh,
SUMOTime  time 
)

Inserts (emits) vehicle into the segment.

Parameters
[in]vehThe vehicle to emit
[in]timeThe emission time
Returns
Whether the emission was successful

Definition at line 287 of file MESegment.cpp.

References MSGlobals::gCheckRoutes, MSBaseVehicle::getID(), hasSpaceFor(), MSBaseVehicle::hasValidRoute(), and receive().

Referenced by MSEdge::insertVehicle(), and METriggeredCalibrator::tryEmit().

◆ isInvalid()

static bool MESegment::isInvalid ( const MESegment segment)
inlinestatic

whether the given segment is 0 or encodes vaporization

Definition at line 341 of file MESegment.h.

References getNextInsertionTime(), and myVaporizationTarget.

Referenced by MELoop::changeSegment(), and send().

◆ isOpen()

bool MESegment::isOpen ( const MEVehicle veh) const

Returns whether the vehicle may use the next link.

In case of disabled junction control it returns always true.

Parameters
[in]vehThe vehicle in question
Returns
Whether it may pass to the next segment

Definition at line 425 of file MESegment.cpp.

References MEVehicle::estimateLeaveSpeed(), MSVehicleType::getCarFollowModel(), MEVehicle::getEventTime(), MSBaseVehicle::getImpatience(), MSVehicleType::getLengthWithGap(), getLink(), MSCFModel::getMaxDecel(), MEVehicle::getSpeed(), MSBaseVehicle::getVehicleType(), MEVehicle::getWaitingTime(), MSLink::havePriority(), limitedControlOverride(), myTLSPenalty, and MSLink::opened().

Referenced by getMeanSpeed(), and MEVehicle::mayProceed().

◆ jamThresholdForSpeed()

double MESegment::jamThresholdForSpeed ( double  speed,
double  jamThresh 
) const
private

compute jam threshold for the given speed and jam-threshold option

Definition at line 191 of file MESegment.cpp.

References DEFAULT_VEH_LENGHT_WITH_GAP, myLength, myTau_ff, STEPS2TIME, and tauWithVehLength().

Referenced by hasSpaceFor(), and recomputeJamThreshold().

◆ limitedControlOverride()

bool MESegment::limitedControlOverride ( const MSLink link) const
private

whether the given link may be passed because the option meso-junction-control.limited is set

Definition at line 441 of file MESegment.cpp.

References MSLane::getEdge(), MSLink::getLane(), MELoop::getSegmentForEdge(), MSGlobals::gMesoLimitedJunctionControl, MSGlobals::gMesoNet, myJamThreshold, and myOccupancy.

Referenced by getLinkPenalty(), and isOpen().

◆ loadState()

void MESegment::loadState ( std::vector< std::string > &  vehIDs,
MSVehicleControl vc,
const SUMOTime  blockTime,
const int  queIdx 
)

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 segment. Then, the internal queues that store vehicles dependant to their next edge are filled the same way. Then, the departure of last vehicles onto the next edge are restored.

Parameters
[in]vehIDsThe vehicle ids for the current que
[in]vcThe vehicle control to retrieve references vehicles from
[in]blockTimeThe time the last vehicle left the que
[in]queIdxThe index of the current que
Todo:

What about throwing an IOError?

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

Definition at line 651 of file MESegment.cpp.

References MELoop::addLeaderCar(), MSVehicleType::getLengthWithGap(), getLink(), MEVehicle::getSegment(), MSVehicleControl::getVehicle(), MSBaseVehicle::getVehicleType(), MSGlobals::gMesoNet, MIN2(), myBlockTimes, myCapacity, myCarQues, and myOccupancy.

Referenced by getLastHeadwaySeconds(), and MSStateHandler::myStartElement().

◆ newArrival()

SUMOTime MESegment::newArrival ( const MEVehicle *const  v,
double  newSpeed,
SUMOTime  currentTime 
)
private

compute the new arrival time when switching speed

Definition at line 603 of file MESegment.cpp.

References MEVehicle::getLastEntryTime(), MEVehicle::getSpeed(), MAX2(), MIN2(), myLength, STEPS2TIME, and TIME2STEPS.

Referenced by setSpeedForQueue().

◆ numQueues()

int MESegment::numQueues ( ) const
inline

return the number of queues

Definition at line 133 of file MESegment.h.

References myCarQues.

Referenced by GUIEdge::getParameterWindow().

◆ operator=()

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

Invalidated assignment operator.

◆ overtake()

bool MESegment::overtake ( )
private

Definition at line 473 of file MESegment.cpp.

References MSGlobals::gMesoOvertaking, myCapacity, myLength, myOccupancy, and RandHelper::rand().

Referenced by receive().

◆ prepareDetectorForWriting()

void MESegment::prepareDetectorForWriting ( MSMoveReminder data)

Updates data of a detector for all vehicle queues.

Parameters
[in]dataThe detector data to update

Definition at line 246 of file MESegment.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), MAX2(), myCarQues, myTau_ff, and tauWithVehLength().

Referenced by METriggeredCalibrator::execute(), MSMeanData::init(), MSMeanData::resetOnly(), MSMeanData::writeEdge(), and MEInductLoop::writeXMLOutput().

◆ receive()

void MESegment::receive ( MEVehicle veh,
SUMOTime  time,
bool  isDepart = false,
bool  afterTeleport = false 
)

◆ recomputeJamThreshold()

void MESegment::recomputeJamThreshold ( double  jamThresh)
private

compute a value for myJamThreshold if jamThresh is negative, compute a value which allows free flow at mySpeed interpret jamThresh as the relative occupation at which jam starts

Definition at line 141 of file MESegment.cpp.

References DEFAULT_VEH_LENGHT_WITH_GAP, DO_NOT_PATCH_JAM_THRESHOLD, getMaxPenaltySeconds(), MSEdge::getSpeedLimit(), jamThresholdForSpeed(), MAX2(), myA, myB, myCapacity, myEdge, myHeadwayCapacity, myJamThreshold, myLength, myMinorPenalty, myTau_jf, myTau_jj, myTLSPenalty, NUMERICAL_EPS, STEPS2TIME, and tauWithVehLength().

Referenced by MESegment(), and setSpeed().

◆ remainingVehicleCapacity()

int MESegment::remainingVehicleCapacity ( const double  vehLength) const
inline

return the remaining physical space on this segment

Definition at line 355 of file MESegment.h.

References myCapacity, and myOccupancy.

Referenced by METriggeredCalibrator::remainingVehicleCapacity().

◆ removeCar()

MEVehicle * MESegment::removeCar ( MEVehicle v,
SUMOTime  leaveTime,
MESegment next 
)

Removes the given car from the edge's que.

Parameters
[in]vThe vehicle to remove
[in]leaveTimeThe time at which the vehicle is leaving the que
[in]nextThe next segment for this vehicle
Returns
The next first vehicle to add to the net's que

Definition at line 348 of file MESegment.cpp.

References MSVehicleType::getLengthWithGap(), MEVehicle::getQueIndex(), MSBaseVehicle::getVehicleType(), MSEdge::lock(), MAX2(), myCarQues, myEdge, myOccupancy, MSEdge::unlock(), and updateDetectorsOnLeave().

Referenced by getMeanSpeed(), and send().

◆ removeDetector()

void MESegment::removeDetector ( MSMoveReminder data)

Removes a data collector for a detector from this segment.

Parameters
[in]dataThe data collector to remove

Definition at line 215 of file MESegment.cpp.

References myCarQues, and myDetectorData.

Referenced by METriggeredCalibrator::~METriggeredCalibrator().

◆ saveState()

void MESegment::saveState ( OutputDevice out)

Saves the state of this segment into the given stream.

Some internal values which must be restored are saved as well as ids of the vehicles stored in internal queues and the last departures of connected edges.

Parameters

Definition at line 639 of file MESegment.cpp.

References OutputDevice::closeTag(), myBlockTimes, myCarQues, OutputDevice::openTag(), SUMO_ATTR_TIME, SUMO_ATTR_VALUE, SUMO_TAG_SEGMENT, SUMO_TAG_VIEWSETTINGS_VEHICLES, and OutputDevice::writeAttr().

Referenced by getLastHeadwaySeconds().

◆ send()

void MESegment::send ( MEVehicle veh,
MESegment next,
SUMOTime  time 
)

Removes the vehicle from the segment, adapting its parameters.

Parameters
[in]vehThe vehicle in question
[in]nextThe subsequent segment for delay calculation
[in]timethe leave time
Todo:
Isn't always time == veh->getEventTime?

Definition at line 454 of file MESegment.cpp.

References MELoop::addLeaderCar(), MEVehicle::getEventTime(), getLink(), MEVehicle::getQueIndex(), getTimeHeadway(), MSGlobals::gMesoNet, isInvalid(), MAX2(), myBlockTimes, myLastHeadway, removeCar(), and MEVehicle::setEventTime().

Referenced by MELoop::changeSegment(), getMeanSpeed(), and MELoop::teleportVehicle().

◆ setEntryBlockTime()

void MESegment::setEntryBlockTime ( SUMOTime  entryBlockTime)
inline

set the next time at which a vehicle my enter this segment

Definition at line 369 of file MESegment.h.

References myEntryBlockTime.

Referenced by MELoop::teleportVehicle().

◆ setID()

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

◆ setSpeed()

void MESegment::setSpeed ( double  newSpeed,
SUMOTime  currentTime,
double  jamThresh = DO_NOT_PATCH_JAM_THRESHOLD 
)

reset mySpeed and patch the speed of all vehicles in it. Also set/recompute myJamThreshold

Parameters
[in]jamThreshfollows the semantic of option meso-jam-threshold

Definition at line 612 of file MESegment.cpp.

References myBlockTimes, myCarQues, recomputeJamThreshold(), and setSpeedForQueue().

Referenced by METriggeredCalibrator::execute(), getEdge(), and MSLaneSpeedTrigger::processCommand().

◆ setSpeedForQueue()

void MESegment::setSpeedForQueue ( double  newSpeed,
SUMOTime  currentTime,
SUMOTime  blockTime,
const std::vector< MEVehicle *> &  vehs 
)
private

◆ tauWithVehLength()

SUMOTime MESegment::tauWithVehLength ( SUMOTime  tau,
double  lengthWithGap 
) const
inlineprivate

convert net time gap (leader back to follower front) to gross time gap (leader front to follower front)

Definition at line 437 of file MESegment.h.

References myTau_length.

Referenced by getMeanSpeed(), getTimeHeadway(), jamThresholdForSpeed(), prepareDetectorForWriting(), receive(), and recomputeJamThreshold().

◆ updateDetectorsOnLeave()

void MESegment::updateDetectorsOnLeave ( MEVehicle v,
SUMOTime  currentTime,
MESegment next 
)
private

Updates data of all detectors for a leaving vehicle.

Parameters
[in]vThe vehicle to update values for
[in]currentTimeThe leave time of the vehicle
[in]nextThe next segment on this vehicles route

Definition at line 230 of file MESegment.cpp.

References myNextSegment, myVaporizationTarget, MSMoveReminder::NOTIFICATION_ARRIVED, MSMoveReminder::NOTIFICATION_JUNCTION, MSMoveReminder::NOTIFICATION_SEGMENT, MSMoveReminder::NOTIFICATION_VAPORIZED, and MEVehicle::updateDetectors().

Referenced by receive(), and removeCar().

◆ useMultiQueue()

bool MESegment::useMultiQueue ( bool  multiQueue,
const MSEdge parent 
)
staticprivate

whether the segment requires use of multiple queues

Definition at line 136 of file MESegment.cpp.

References MSEdge::getLanes(), and MSEdge::getNumSuccessors().

Referenced by MESegment().

◆ vaporizeAnyCar()

bool MESegment::vaporizeAnyCar ( SUMOTime  currentTime)

tries to remove any car from this segment

Parameters
[in]currentTimethe current time
Returns
Whether vaporization was successful
Note
: cars removed via this method do NOT count as arrivals

Definition at line 566 of file MESegment.cpp.

References MELoop::changeSegment(), MSGlobals::gMesoNet, myCarQues, myVaporizationTarget, and MELoop::removeLeaderCar().

Referenced by METriggeredCalibrator::execute(), and getMeanSpeed().

◆ writeVehicles()

void MESegment::writeVehicles ( OutputDevice of) const

Definition at line 338 of file MESegment.cpp.

References myCarQues, and MSXMLRawOut::writeVehicle().

Referenced by getMeanSpeed(), and MSXMLRawOut::writeEdge().

Field Documentation

◆ DO_NOT_PATCH_JAM_THRESHOLD

const double MESegment::DO_NOT_PATCH_JAM_THRESHOLD
static

Definition at line 378 of file MESegment.h.

Referenced by getEdge(), and recomputeJamThreshold().

◆ myA

double MESegment::myA
private

slope and axis offset for the jam-jam headway function

Definition at line 460 of file MESegment.h.

Referenced by getTimeHeadway(), and recomputeJamThreshold().

◆ myB

double MESegment::myB
private

Definition at line 460 of file MESegment.h.

Referenced by getTimeHeadway(), and recomputeJamThreshold().

◆ myBlockTimes

std::vector<SUMOTime> MESegment::myBlockTimes
private

The block times.

Definition at line 494 of file MESegment.h.

Referenced by getNextInsertionTime(), loadState(), MESegment(), receive(), saveState(), send(), and setSpeed().

◆ myCapacity

const double MESegment::myCapacity
private

◆ myCarQues

Queues MESegment::myCarQues
private

◆ myDetectorData

std::vector<MSMoveReminder*> MESegment::myDetectorData
private

The data collection for all kinds of detectors.

Definition at line 485 of file MESegment.h.

Referenced by addDetector(), addReminders(), and removeDetector().

◆ myDummyParent

MSEdge MESegment::myDummyParent
staticprivate

Definition at line 506 of file MESegment.h.

◆ myEdge

const MSEdge& MESegment::myEdge
private

The microsim edge this segment belongs to.

Definition at line 443 of file MESegment.h.

Referenced by getEdge(), getLink(), getMaxPenaltySeconds(), getMeanSpeed(), getNextInsertionTime(), receive(), recomputeJamThreshold(), and removeCar().

◆ myEntryBlockTime

SUMOTime MESegment::myEntryBlockTime
private

◆ myFollowerMap

std::map<const MSEdge*, std::vector<int> > MESegment::myFollowerMap
private

The follower edge to que index mapping for multi queue segments.

Definition at line 491 of file MESegment.h.

Referenced by MESegment(), and receive().

◆ myHeadwayCapacity

const double MESegment::myHeadwayCapacity
private

The capacity of the segment in number of cars, used only in time headway calculation This parameter has only an effect if tau_jf != tau_jj, which is not(!) the case per default.

Definition at line 464 of file MESegment.h.

Referenced by recomputeJamThreshold().

◆ myID

std::string Named::myID
protectedinherited

The name of the object.

Definition at line 135 of file Named.h.

Referenced by MSE2Collector::addDetectorToLanes(), RODFDetector::buildDestinationDistribution(), NGEdge::buildNBEdge(), NGNode::buildNBNode(), MSSOTLTrafficLightLogic::checkPhases(), NBNode::computeNodeShape(), MSE2Collector::detectorUpdate(), METriggeredCalibrator::execute(), MSCalibrator::execute(), GNEPOI::getAttribute(), GNEPOILane::getAttribute(), GNEPoly::getAttribute(), MSLane::getCanonicalPredecessorLane(), MSLane::getCanonicalSuccessorLane(), Named::getID(), NBEdge::getLaneID(), NBEdge::getLaneIDInsecure(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MSDelayBasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), MSSOTLTrafficLightLogic::init(), MSCalibrator::init(), NBEdge::init(), MSLane::isInsertionSuccess(), MSCalibrator::myStartElement(), MSE2Collector::notifyEnter(), MSE2Collector::notifyLeave(), MSE2Collector::notifyMove(), MSMeanData::openInterval(), RORouteDef::preComputeCurrentRoute(), NBEdge::reinitNodes(), MSRoute::release(), GNEPOI::setAttribute(), GNEPOILane::setAttribute(), GNEPoly::setAttribute(), Named::setID(), MSSOTLTrafficLightLogic::setToATargetPhase(), NBEdge::splitGeometry(), Distribution_Parameterized::toStr(), MSChargingStation::writeChargingStationOutput(), RODFDetector::writeEmitterDefinition(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), RODFDetector::writeSingleSpeedTrigger(), MEInductLoop::writeXMLOutput(), MSCalibrator::writeXMLOutput(), and MSE3Collector::writeXMLOutput().

◆ myIndex

const int MESegment::myIndex
private

Running number of the segment in the edge.

Definition at line 452 of file MESegment.h.

Referenced by getIndex(), and receive().

◆ myJamThreshold

double MESegment::myJamThreshold
private

The space (in m) which needs to be occupied before the segment is considered jammed.

Definition at line 482 of file MESegment.h.

Referenced by free(), getRelativeJamThreshold(), hasSpaceFor(), limitedControlOverride(), and recomputeJamThreshold().

◆ myJunctionControl

const bool MESegment::myJunctionControl
private

Whether junction control is enabled.

Definition at line 473 of file MESegment.h.

Referenced by getLink().

◆ myLastHeadway

SUMOTime MESegment::myLastHeadway
private

the last headway

Definition at line 502 of file MESegment.h.

Referenced by getLastHeadwaySeconds(), and send().

◆ myLastMeanSpeedUpdate

SUMOTime MESegment::myLastMeanSpeedUpdate
mutableprivate

the time at which myMeanSpeed was last updated

Definition at line 513 of file MESegment.h.

Referenced by getMeanSpeed().

◆ myLength

const double MESegment::myLength
private

◆ myMeanSpeed

double MESegment::myMeanSpeed
mutableprivate

the mean speed on this segment. Updated at event time or on demand

Definition at line 510 of file MESegment.h.

Referenced by getMeanSpeed().

◆ myMinorPenalty

const bool MESegment::myMinorPenalty
private

Whether minor penalty is enabled.

Definition at line 479 of file MESegment.h.

Referenced by getLinkPenalty(), and recomputeJamThreshold().

◆ myNextSegment

MESegment* MESegment::myNextSegment
private

The next segment of this edge, 0 if this is the last segment of this edge.

Definition at line 446 of file MESegment.h.

Referenced by getNextSegment(), and updateDetectorsOnLeave().

◆ myOccupancy

double MESegment::myOccupancy
private

The occupied space (in m) on the segment.

Definition at line 470 of file MESegment.h.

Referenced by free(), getBruttoOccupancy(), getRelativeOccupancy(), hasSpaceFor(), limitedControlOverride(), loadState(), overtake(), receive(), remainingVehicleCapacity(), and removeCar().

◆ myTau_ff

const SUMOTime MESegment::myTau_ff
private

The time headway parameters, see the Eissfeldt thesis.

Definition at line 455 of file MESegment.h.

Referenced by getMeanSpeed(), getMinimumHeadwayTime(), getTimeHeadway(), jamThresholdForSpeed(), prepareDetectorForWriting(), receive(), and setSpeedForQueue().

◆ myTau_fj

const SUMOTime MESegment::myTau_fj
private

Definition at line 455 of file MESegment.h.

Referenced by getTimeHeadway().

◆ myTau_jf

const SUMOTime MESegment::myTau_jf
private

Definition at line 455 of file MESegment.h.

Referenced by getMeanSpeed(), getTimeHeadway(), and recomputeJamThreshold().

◆ myTau_jj

const SUMOTime MESegment::myTau_jj
private

Definition at line 455 of file MESegment.h.

Referenced by recomputeJamThreshold().

◆ myTau_length

double MESegment::myTau_length
private

Headway parameter for computing gross time headyway from net time headway, length and edge speed.

Definition at line 457 of file MESegment.h.

Referenced by tauWithVehLength().

◆ myTLSPenalty

const bool MESegment::myTLSPenalty
private

Whether tls penalty is enabled.

Definition at line 476 of file MESegment.h.

Referenced by getLinkPenalty(), getTLSCapacity(), isOpen(), and recomputeJamThreshold().

◆ myVaporizationTarget

MESegment MESegment::myVaporizationTarget
staticprivate

Definition at line 507 of file MESegment.h.

Referenced by isInvalid(), updateDetectorsOnLeave(), and vaporizeAnyCar().


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