SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSBusStop Class Reference

A lane area vehicles can halt at. More...

#include <MSBusStop.h>

Inheritance diagram for MSBusStop:
MSTrigger Named GUIBusStop

Public Member Functions

void enter (SUMOVehicle *what, SUMOReal beg, SUMOReal end)
 Called if a vehicle enters this stop.
SUMOReal getBeginLanePosition () const
 Returns the begin position of this bus stop.
SUMOReal getEndLanePosition () const
 Returns the end position of this bus stop.
const std::string & getID () const
 Returns the id.
const MSLanegetLane () const
 Returns the lane this bus stop is located at.
SUMOReal getLastFreePos (SUMOVehicle &forVehicle) const
 Returns the last free position on this stop.
void leaveFrom (SUMOVehicle *what)
 Called if a vehicle leaves this stop.
 MSBusStop (const std::string &id, const std::vector< std::string > &lines, MSLane &lane, SUMOReal begPos, SUMOReal endPos)
 Constructor.
void setID (const std::string &newID)
 resets the id
virtual ~MSBusStop ()
 Destructor.

Protected Member Functions

void computeLastFreePos ()
 Computes the last free position on this stop.

Protected Attributes

SUMOReal myBegPos
 The begin position this bus stop is located at.
SUMOReal myEndPos
 The end position this bus stop is located at.
std::map< SUMOVehicle
*, std::pair< SUMOReal,
SUMOReal > > 
myEndPositions
 A map from objects (vehicles) to the areas they acquire after entering the stop.
std::string myID
 The name of the object.
MSLanemyLane
 The lane this bus stop is located at.
SUMOReal myLastFreePos
 The last free position at this stop (variable)
std::vector< std::string > myLines
 The list of lines that are assigned to this stop.

Private Member Functions

 MSBusStop (const MSBusStop &)
 Invalidated copy constructor.
MSBusStopoperator= (const MSBusStop &)
 Invalidated assignment operator.

Detailed Description

A lane area vehicles can halt at.

The bus stops tracks the last free space a vehicle may halt at by being informed about a vehicle's entering and depart. It keeps the information about entered vehicles' begin and end position within an internal container ("myEndPositions") and is so able to compute the last free space.

Please note that using the last free space disallows vehicles to enter a free space in between other vehicles.

Definition at line 61 of file MSBusStop.h.


Constructor & Destructor Documentation

MSBusStop::MSBusStop ( const std::string &  id,
const std::vector< std::string > &  lines,
MSLane lane,
SUMOReal  begPos,
SUMOReal  endPos 
)

Constructor.

Parameters:
[in]idThe id of the bus stop
[in]netThe net the bus stop belongs to
[in]linesNames of the bus lines that halt on this bus stop
[in]laneThe lane the bus stop is placed on
[in]begPosBegin position of the bus stop on the lane
[in]endPosEnd position of the bus stop on the lane

Definition at line 45 of file MSBusStop.cpp.

References computeLastFreePos().

MSBusStop::~MSBusStop ( )
virtual

Destructor.

Definition at line 55 of file MSBusStop.cpp.

MSBusStop::MSBusStop ( const MSBusStop )
private

Invalidated copy constructor.


Member Function Documentation

void MSBusStop::computeLastFreePos ( )
protected

Computes the last free position on this stop.

The last free position is the one, the last vehicle ends at. It is stored in myLastFreePos. If no vehicle halts, the last free position gets the value of myEndPos.

Definition at line 101 of file MSBusStop.cpp.

References myEndPos, myEndPositions, and myLastFreePos.

Referenced by enter(), leaveFrom(), and MSBusStop().

void MSBusStop::enter ( SUMOVehicle what,
SUMOReal  beg,
SUMOReal  end 
)

Called if a vehicle enters this stop.

Stores the position of the entering vehicle in myEndPositions.

Recomputes the free space using "computeLastFreePos" then.

Parameters:
[in]whatThe vehicle that enters the bus stop
[in]begThe begin halting position of the vehicle
[in]whatThe end halting position of the vehicle
See also:
computeLastFreePos

Definition at line 77 of file MSBusStop.cpp.

References computeLastFreePos(), and myEndPositions.

Referenced by MSVehicle::processNextStop().

SUMOReal MSBusStop::getBeginLanePosition ( ) const

Returns the begin position of this bus stop.

Returns:
The position the bus stop begins at

Definition at line 65 of file MSBusStop.cpp.

References myBegPos.

Referenced by MSRouteHandler::addStop(), and MSVehicle::processNextStop().

SUMOReal MSBusStop::getEndLanePosition ( ) const

Returns the end position of this bus stop.

Returns:
The position the bus stop ends at

Definition at line 71 of file MSBusStop.cpp.

References myEndPos.

Referenced by MSRouteHandler::addStop(), and MSNet::getBusStopID().

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

Returns the id.

Returns:
The stored id

Reimplemented in MS_E2_ZS_CollectorOverLanes.

Definition at line 61 of file Named.h.

References Named::myID.

Referenced by MSDetectorControl::add(), ShapeContainer::add(), RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_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(), NBLoadedTLDef::SignalGroup::patchTYellow(), RORouteDef_Complete::preComputeCurrentRoute(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), MSInductLoop::writeTypedXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

const MSLane & MSBusStop::getLane ( ) const

Returns the lane this bus stop is located at.

Returns:
Reference to the lane the bus stop is located at

Definition at line 59 of file MSBusStop.cpp.

References myLane.

Referenced by MSRouteHandler::addStop(), and MSNet::getBusStopID().

SUMOReal MSBusStop::getLastFreePos ( SUMOVehicle forVehicle) const

Returns the last free position on this stop.

Returns:
The last free position of this bus stop

Definition at line 84 of file MSBusStop.cpp.

References MSVehicleType::getMinGap(), SUMOVehicle::getVehicleType(), myEndPos, and myLastFreePos.

Referenced by MSVehicle::moveRegardingCritical(), MSVehicle::processNextStop(), and MSVehicle::vsafeCriticalCont().

void MSBusStop::leaveFrom ( SUMOVehicle what)

Called if a vehicle leaves this stop.

Removes the position of the vehicle from myEndPositions.

Recomputes the free space using "computeLastFreePos" then.

Parameters:
[in]whatThe vehicle that leaves the bus stop
See also:
computeLastFreePos

Definition at line 93 of file MSBusStop.cpp.

References computeLastFreePos(), and myEndPositions.

Referenced by MSVehicle::processNextStop().

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

Invalidated assignment operator.

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

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

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


Field Documentation

SUMOReal MSBusStop::myBegPos
protected

The begin position this bus stop is located at.

Definition at line 156 of file MSBusStop.h.

Referenced by getBeginLanePosition().

SUMOReal MSBusStop::myEndPos
protected

The end position this bus stop is located at.

Definition at line 159 of file MSBusStop.h.

Referenced by computeLastFreePos(), getEndLanePosition(), and getLastFreePos().

std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> > MSBusStop::myEndPositions
protected

A map from objects (vehicles) to the areas they acquire after entering the stop.

Definition at line 150 of file MSBusStop.h.

Referenced by computeLastFreePos(), enter(), and leaveFrom().

MSLane& MSBusStop::myLane
protected

The lane this bus stop is located at.

Definition at line 153 of file MSBusStop.h.

Referenced by getLane().

SUMOReal MSBusStop::myLastFreePos
protected

The last free position at this stop (variable)

Definition at line 162 of file MSBusStop.h.

Referenced by computeLastFreePos(), and getLastFreePos().

std::vector<std::string> MSBusStop::myLines
protected

The list of lines that are assigned to this stop.

Definition at line 147 of file MSBusStop.h.

Referenced by GUIBusStop::drawGL().


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