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...
 
SUMOReal 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...
 
SUMOReal getEventTimeSeconds () const
 Like getEventTime but returns seconds (for visualization) More...
 
SUMOReal 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...
 
SUMOReal getLength () const
 Returns the length of the segment in meters. More...
 
SUMOReal getLengthGeometryFactor () const
 return precomputed geometrical length / myLength More...
 
MSLinkgetLink (const MEVehicle *veh, bool tlsPenalty=false) const
 Returns the link the given car will use when passing the next junction. More...
 
SUMOReal 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...
 
SUMOReal 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...
 
SUMOReal getRelativeJamThreshold () const
 Returns the relative occupany of the segment (percentage of road used)) at which the segment is considered jammed. More...
 
SUMOReal getRelativeOccupancy () const
 Returns the relative occupany of the segment (percentage of road used)) More...
 
SUMOTime getTLSPenalty (const MEVehicle *veh) const
 Returns the penalty time for passing a tls-controlled link (if using gMesoTLSPenalty > 0) 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, SUMOReal length, SUMOReal speed, int idx, SUMOTime tauff, SUMOTime taufj, SUMOTime taujf, SUMOTime taujj, SUMOReal jamThresh, bool multiQueue, bool junctionControl, SUMOReal lengthGeometryFactor)
 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 SUMOReal 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 (SUMOReal newSpeed, SUMOTime currentTime, SUMOReal 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 SUMOReal DO_NOT_PATCH_JAM_THRESHOLD
 

Protected Attributes

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

Private Member Functions

SUMOTime getTimeHeadway (bool predecessorIsFree, SUMOReal leaderLength)
 
SUMOReal jamThresholdForSpeed (SUMOReal speed, SUMOReal 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, SUMOReal newSpeed, SUMOTime currentTime)
 compute the new arrival time when switching speed More...
 
MESegmentoperator= (const MESegment &)
 Invalidated assignment operator. More...
 
bool overtake ()
 
void recomputeJamThreshold (SUMOReal 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 (SUMOReal newSpeed, SUMOTime currentTime, SUMOTime blockTime, const std::vector< MEVehicle *> &vehs)
 
void updateDetectorsOnLeave (MEVehicle *v, SUMOTime currentTime, MESegment *next)
 Updates data of all detectors for a leaving vehicle. More...
 

Private Attributes

SUMOReal myA
 slope and axis offset for the jam-jam headway function More...
 
SUMOReal myB
 
std::vector< SUMOTimemyBlockTimes
 The block times. More...
 
const SUMOReal 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 SUMOReal 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...
 
SUMOReal 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 myLastMeanSpeedUpdate
 the time at which myMeanSpeed was last updated More...
 
const SUMOReal myLength
 The segment's length. More...
 
const SUMOReal myLengthGeometryFactor
 
SUMOReal myMeanSpeed
 the mean speed on this segment. Updated at event time or on demand More...
 
MESegmentmyNextSegment
 The next segment of this edge, 0 if this is the last segment of this edge. More...
 
SUMOReal 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
 
SUMOReal myTau_length
 Headway paramter for computing gross time headyway from net time heawdway, 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 57 of file MESegment.h.

Member Typedef Documentation

§ Queue

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

Definition at line 87 of file MESegment.h.

§ Queues

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

Definition at line 88 of file MESegment.h.

Constructor & Destructor Documentation

§ MESegment() [1/3]

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

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 71 of file MESegment.cpp.

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

§ 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 193 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 470 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 129 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 347 of file MESegment.h.

References myJamThreshold, myOccupancy, and myTLSPenalty.

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

§ getBruttoOccupancy()

SUMOReal 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 174 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 287 of file MESegment.cpp.

References myCarQues, and SUMOReal.

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 361 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 615 of file MESegment.cpp.

References myCarQues, and SUMOTime_MAX.

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

§ getEventTimeSeconds()

SUMOReal MESegment::getEventTimeSeconds ( ) const
inline

Like getEventTime but returns seconds (for visualization)

Definition at line 289 of file MESegment.h.

References getEventTime(), getFlow(), getVehicles(), loadState(), saveState(), STEPS2TIME, and SUMOReal.

Referenced by GUIEdge::getParameterWindow().

§ getFlow()

SUMOReal MESegment::getFlow ( ) const

returns flow based on headway

Note
: returns magic number 10000 when headway cannot be computed

Definition at line 672 of file MESegment.cpp.

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

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

§ getID()

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

Returns the id.

Returns
The stored id

Definition at line 66 of file Named.h.

References Named::myID.

Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), PCPolyContainer::add(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), MSDetectorControl::add(), Named::StoringVisitor::add(), ShapeContainer::add(), IntermodalRouter< E, L, N, V >::addAccess(), NLTriggerBuilder::addAccess(), RORouteDef::addAlternative(), MSLane::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(), NBEdge::addStraightConnections(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciBusOrContainerStop(), MSVehicle::addTraciStop(), AGActivityTripWriter::addTrip(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::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(), 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(), NBEdge::checkGeometry(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), 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(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBNode::computeSmoothShape(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NLDetectorBuilder::convUncontE2PosLength(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSSOTLE2Sensors::countVehicles(), GUINet::createTLWrapper(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), NIVissimDistrictConnection::dict_BuildDistricts(), NBEdge::divideOnEdges(), NBEdge::divideSelectedLanesOnEdges(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::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(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), TraCIServerAPI_Vehicle::findCloserLane(), NBRampsComputer::fulfillsRampConstraints(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), GNEConnection::getAttribute(), MSVehicle::getBackPosition(), MSNet::getBusStopID(), MSVehicle::getCenterOnEdge(), MSDevice_Battery::getChargingStationID(), MSNet::getChargingStationID(), NBEdge::getConnection(), NBEdge::getConnectionRef(), MSNet::getContainerStopID(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), MSE2Collector::getEstimateQueueLength(), NBEdge::getFirstNonPedestrianLane(), MSLane::getFollower(), MSLane::getFollowerOnConsecutive(), MSLane::getFollowersOnConsecutive(), GNEEdge::getGNEJunctionDest(), GNEEdge::getGNEJunctionSource(), MSLink::getInternalLengthsAfter(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPerson::getNextEdge(), MSPModel_Striping::getNextLane(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getOppositePos(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUI_E2_ZS_Collector::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(), MSVehicleControl::getWaitingVehicle(), MSLink::getZipperSpeed(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSLane::handleCollisionBetween(), 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(), MSLane::isInsertionSuccess(), RODFNet::isSource(), MSSOTLTrafficLightLogic::isThresholdPassed(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), MSE3Collector::leaveFront(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSPedestrianPushButton::loadCrossingEdgeMap(), NIImporter_OpenDrive::loadNetwork(), MSPedestrianPushButton::loadPushButtons(), NBEdge::MainDirections::MainDirections(), ODDistrictCont::makeDistricts(), NBNodeCont::mapToNumericalIDs(), NBEdgeCont::mapToNumericalIDs(), GNEJunction::markAsModified(), 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(), 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(), GNEViewNet::onLeftBtnPress(), 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_SL2015::patchSpeed(), MSLCM_LC2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSVehicle::planMove(), MSLane::planMovements(), MSRightOfWayJunction::postloadInit(), NBEdge::prepareEdgePriorities(), MSAbstractLaneChangeModel::primaryLaneChanged(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_ArealDetector::processGet(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), NIXMLNodesHandler::processTrafficLightDefinitions(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NIImporter_OpenStreetMap::reconstructLayerElevation(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNodeCont::removeIsolatedRoads(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::rename(), NBEdgeCont::rename(), GNENet::renameEdge(), GNENet::renameJunction(), RORouteDef::repairCurrentRoute(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), MSBaseVehicle::reroute(), MSLane::resetPartialOccupation(), NBEdge::restoreRestrictedLane(), GNEEdge::retrieveConnection(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), MSLane::saveState(), MSDevice_Battery::setAirDragCoefficient(), NBNodeCont::setAsTLControlled(), MSChargingStation::setChargeDelay(), MSChargingStation::setChargingPower(), MSDevice_Battery::setConstantPowerIntake(), NBEdge::setControllingTLInformation(), MSChargingStation::setEfficency(), MSDevice_Battery::setFrontSurfaceArea(), MSDevice_Battery::setInternalMomentOfInertia(), GNEJunction::setLogicValid(), MSDevice_Battery::setMass(), MSDevice_Battery::setMaximumBatteryCapacity(), NIXMLEdgesHandler::setNodes(), MSLane::setPartialOccupation(), 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(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSSOTLTrafficLightLogic::trySwitch(), MSVehicle::updateBestLanes(), MSSOTLTrafficLightLogic::updateCTS(), GNETLSEditorFrame::updateDescription(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap(), MSPModel_Striping::PState::walk(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), MSLink::writeApproaching(), 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(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), PointOfInterest::writeXML(), SUMO::Polygon::writeXML(), MSRouteProbe::writeXMLOutput(), MSE2Collector::writeXMLOutput(), MSInductLoop::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 150 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().

§ getLength()

SUMOReal MESegment::getLength ( ) const
inline

§ getLengthGeometryFactor()

SUMOReal MESegment::getLengthGeometryFactor ( ) 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 386 of file MESegment.cpp.

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

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

§ getMeanSpeed() [1/2]

SUMOReal 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 297 of file MESegment.cpp.

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

Referenced by METriggeredCalibrator::invalidJam().

§ getMeanSpeed() [2/2]

SUMOReal MESegment::getMeanSpeed ( ) const
inline

wrapper to satisfy the FunctionBinding signature

Definition at line 207 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 371 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 371 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 141 of file MESegment.h.

References myCarQues.

§ getRelativeJamThreshold()

SUMOReal 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 190 of file MESegment.h.

References getMeanSpeed(), myCapacity, myJamThreshold, and SUMOReal.

Referenced by GUIEdge::getParameterWindow().

§ getRelativeOccupancy()

SUMOReal 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 182 of file MESegment.h.

References myCapacity, and myOccupancy.

Referenced by GUIEdge::getParameterWindow().

§ getTimeHeadway()

SUMOTime MESegment::getTimeHeadway ( bool  predecessorIsFree,
SUMOReal  leaderLength 
)
private

Definition at line 355 of file MESegment.cpp.

References free(), getCarNumber(), myA, myB, myTau_ff, myTau_fj, myTau_jf, myTau_length, and TIME2STEPS.

Referenced by getLengthGeometryFactor(), and send().

§ getTLSPenalty()

SUMOTime MESegment::getTLSPenalty ( const MEVehicle veh) const

Returns the penalty time for passing a tls-controlled link (if using gMesoTLSPenalty > 0)

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

Definition at line 678 of file MESegment.cpp.

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

Referenced by MEVehicle::getCurrentTLSPenaltySeconds(), getLengthGeometryFactor(), and receive().

§ getVehicles()

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

returns all vehicles (for debugging)

Definition at line 662 of file MESegment.cpp.

References myCarQues, and SUMOReal.

Referenced by getEventTimeSeconds().

§ 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 249 of file MESegment.cpp.

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

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 272 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 338 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 417 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()

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

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

Definition at line 179 of file MESegment.cpp.

References SUMOVTypeParameter::getDefault(), SUMOVTypeParameter::length, max, SUMOVTypeParameter::minGap, myLength, myTau_ff, myTau_length, STEPS2TIME, and SUMOReal.

Referenced by getLengthGeometryFactor(), 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 433 of file MESegment.cpp.

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

Referenced by getLengthGeometryFactor(), 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 642 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 getEventTimeSeconds(), and MSStateHandler::myStartElement().

§ newArrival()

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

compute the new arrival time when switching speed

Definition at line 594 of file MESegment.cpp.

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

Referenced by getLengthGeometryFactor(), and setSpeedForQueue().

§ numQueues()

int MESegment::numQueues ( ) const
inline

return the number of queues

Definition at line 135 of file MESegment.h.

References myCarQues.

§ operator=()

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

Invalidated assignment operator.

§ overtake()

bool MESegment::overtake ( )
private

§ 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 235 of file MESegment.cpp.

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

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 ( SUMOReal  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 136 of file MESegment.cpp.

References DO_NOT_PATCH_JAM_THRESHOLD, MSEdge::getSpeedLimit(), jamThresholdForSpeed(), myA, myB, myCapacity, myEdge, myHeadwayCapacity, myJamThreshold, myTau_jf, myTau_jj, STEPS2TIME, and SUMOReal.

Referenced by getLengthGeometryFactor(), MESegment(), and setSpeed().

§ remainingVehicleCapacity()

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

return the remaining physical space on this segment

Definition at line 352 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 333 of file MESegment.cpp.

References MSVehicleType::getLengthWithGap(), MEVehicle::getQueIndex(), MSBaseVehicle::getVehicleType(), MSEdge::lock(), MAX2(), myCarQues, myEdge, myOccupancy, SUMOReal, 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 204 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 630 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 getEventTimeSeconds().

§ 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 446 of file MESegment.cpp.

References MELoop::addLeaderCar(), free(), MEVehicle::getEventTime(), MSVehicleType::getLengthWithGap(), getLink(), MEVehicle::getQueIndex(), getTimeHeadway(), MSBaseVehicle::getVehicleType(), MSGlobals::gMesoNet, isInvalid(), MAX2(), myBlockTimes, 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 366 of file MESegment.h.

References myEntryBlockTime.

Referenced by MELoop::teleportVehicle().

§ setID()

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

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 74 of file Named.h.

References Named::myID.

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

§ setSpeed()

void MESegment::setSpeed ( SUMOReal  newSpeed,
SUMOTime  currentTime,
SUMOReal  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 603 of file MESegment.cpp.

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

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

§ setSpeedForQueue()

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

§ 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 219 of file MESegment.cpp.

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

Referenced by getLengthGeometryFactor(), receive(), and removeCar().

§ 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 557 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 323 of file MESegment.cpp.

References myCarQues, and MSXMLRawOut::writeVehicle().

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

Field Documentation

§ DO_NOT_PATCH_JAM_THRESHOLD

const SUMOReal MESegment::DO_NOT_PATCH_JAM_THRESHOLD
static

Definition at line 375 of file MESegment.h.

Referenced by getEdge(), and recomputeJamThreshold().

§ myA

SUMOReal MESegment::myA
private

slope and axis offset for the jam-jam headway function

Definition at line 443 of file MESegment.h.

Referenced by getTimeHeadway(), and recomputeJamThreshold().

§ myB

SUMOReal MESegment::myB
private

Definition at line 443 of file MESegment.h.

Referenced by getTimeHeadway(), and recomputeJamThreshold().

§ myBlockTimes

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

The block times.

Definition at line 474 of file MESegment.h.

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

§ myCapacity

const SUMOReal 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 465 of file MESegment.h.

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

§ myDummyParent

MSEdge MESegment::myDummyParent
staticprivate

Definition at line 486 of file MESegment.h.

§ myEdge

const MSEdge& MESegment::myEdge
private

The microsim edge this segment belongs to.

Definition at line 426 of file MESegment.h.

Referenced by getEdge(), getLink(), 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 471 of file MESegment.h.

Referenced by MESegment(), and receive().

§ myHeadwayCapacity

const SUMOReal 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 447 of file MESegment.h.

Referenced by recomputeJamThreshold().

§ myID

§ myIndex

const int MESegment::myIndex
private

Running number of the segment in the edge.

Definition at line 435 of file MESegment.h.

Referenced by getIndex(), and receive().

§ myJamThreshold

SUMOReal MESegment::myJamThreshold
private

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

Definition at line 462 of file MESegment.h.

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

§ myJunctionControl

const bool MESegment::myJunctionControl
private

Whether junction control is enabled.

Definition at line 456 of file MESegment.h.

Referenced by getLink().

§ myLastMeanSpeedUpdate

SUMOTime MESegment::myLastMeanSpeedUpdate
mutableprivate

the time at which myMeanSpeed was last updated

Definition at line 493 of file MESegment.h.

Referenced by getMeanSpeed().

§ myLength

const SUMOReal MESegment::myLength
private

The segment's length.

Definition at line 432 of file MESegment.h.

Referenced by getFlow(), getLength(), getNextInsertionTime(), jamThresholdForSpeed(), newArrival(), overtake(), and receive().

§ myLengthGeometryFactor

const SUMOReal MESegment::myLengthGeometryFactor
private

Definition at line 482 of file MESegment.h.

Referenced by getLengthGeometryFactor().

§ myMeanSpeed

SUMOReal MESegment::myMeanSpeed
mutableprivate

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

Definition at line 490 of file MESegment.h.

Referenced by getMeanSpeed().

§ myNextSegment

MESegment* MESegment::myNextSegment
private

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

Definition at line 429 of file MESegment.h.

Referenced by getNextSegment(), and updateDetectorsOnLeave().

§ myOccupancy

SUMOReal MESegment::myOccupancy
private

The occupied space (in m) on the segment.

Definition at line 453 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 438 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 438 of file MESegment.h.

Referenced by getTimeHeadway().

§ myTau_jf

const SUMOTime MESegment::myTau_jf
private

Definition at line 438 of file MESegment.h.

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

§ myTau_jj

const SUMOTime MESegment::myTau_jj
private

Definition at line 438 of file MESegment.h.

Referenced by recomputeJamThreshold().

§ myTau_length

SUMOReal MESegment::myTau_length
private

Headway paramter for computing gross time headyway from net time heawdway, length and edge speed.

Definition at line 440 of file MESegment.h.

Referenced by getTimeHeadway(), and jamThresholdForSpeed().

§ myTLSPenalty

const bool MESegment::myTLSPenalty
private

Whether tls penalty is enabled.

Definition at line 459 of file MESegment.h.

Referenced by free(), getTLSPenalty(), and isOpen().

§ myVaporizationTarget

MESegment MESegment::myVaporizationTarget
staticprivate

Definition at line 487 of file MESegment.h.

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


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