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

A single signal group, may control several connections. More...

#include <NBLoadedTLDef.h>

Inheritance diagram for NBLoadedTLDef::SignalGroup:
Named

Data Structures

class  phase_by_time_sorter
 Sorts phases by their begin time. More...
 
class  PhaseDef
 Definition of a single, loaded phase. More...
 

Public Member Functions

void addConnection (const NBConnection &c)
 Inserts a controlled connection. More...
 
void addPhaseBegin (SUMOTime time, TLColor color)
 Sets the begin of a phase. More...
 
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
bool containsConnection (NBEdge *from, NBEdge *to) const
 Returns whether the given connection is controlled by this signal. More...
 
bool containsIncoming (NBEdge *from) const
 Returns whether this signal controls the given edge. More...
 
bool containsOutgoing (NBEdge *to) const
 Returns whether this signal controls a connection where the given edge is the destination. More...
 
const NBConnectiongetConnection (unsigned int pos) const
 Returns the connection at the given index. More...
 
const std::string & getID () const
 Returns the id. More...
 
unsigned int getLinkNo () const
 Returns the number of links (connection) controlled by this signal. More...
 
std::vector< SUMORealgetTimes (SUMOTime cycleDuration) const
 Returns the times at which the signal switches. More...
 
bool hasYellow (SUMOTime time) const
 Returns whether controlled links have yellow at the given time. More...
 
bool mayDrive (SUMOTime time) const
 Returns whether vehicles on controlled links may drive at the given time. More...
 
void patchTYellow (SUMOTime tyellow, bool forced)
 Sets the yellow time. More...
 
void remap (NBEdge *removed, int removedLane, NBEdge *by, int byLane)
 Replaces a removed edge/lane. More...
 
void remapIncoming (NBEdge *which, const EdgeVector &by)
 Replaces the given incoming edge by the others given. More...
 
void remapOutgoing (NBEdge *which, const EdgeVector &by)
 Replaces the given outgoing edge by the others given. More...
 
void setID (const std::string &newID)
 resets the id More...
 
void setYellowTimes (SUMOTime tRedYellowe, SUMOTime tYellow)
 Sets the times for redyellow and yellow. More...
 
 SignalGroup (const std::string &id)
 Constructor. More...
 
void sortPhases ()
 Sorts the phases. More...
 
 ~SignalGroup ()
 Destructor. More...
 

Protected Attributes

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

Private Attributes

NBConnectionVector myConnections
 Connections controlled by this signal. More...
 
std::vector< PhaseDefmyPhases
 The phases of this signal. More...
 
SUMOTime myTRedYellow
 The times of redyellow and yellow. More...
 
SUMOTime myTYellow
 

Detailed Description

A single signal group, may control several connections.

Definition at line 54 of file NBLoadedTLDef.h.

Constructor & Destructor Documentation

NBLoadedTLDef::SignalGroup::SignalGroup ( const std::string &  id)

Constructor.

Parameters
[in]idThe id of the signal group

Definition at line 56 of file NBLoadedTLDef.cpp.

NBLoadedTLDef::SignalGroup::~SignalGroup ( )

Destructor.

Definition at line 59 of file NBLoadedTLDef.cpp.

Member Function Documentation

void NBLoadedTLDef::SignalGroup::addConnection ( const NBConnection c)

Inserts a controlled connection.

Parameters
[in]cThe connection to be controlled by this signal group

Definition at line 62 of file NBLoadedTLDef.cpp.

References NBConnection::getFrom(), NBConnection::getFromLane(), and NBEdge::getNumLanes().

void NBLoadedTLDef::SignalGroup::addPhaseBegin ( SUMOTime  time,
TLColor  color 
)

Sets the begin of a phase.

Parameters
[in]timeThe time at which the phase starts
[in]colorThe color of this signal starting at the given time

Definition at line 69 of file NBLoadedTLDef.cpp.

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

Adds this object to the given container.

Parameters
in,filled]cont The container to add this item to

Definition at line 114 of file Named.h.

References Named::StoringVisitor::add().

bool NBLoadedTLDef::SignalGroup::containsConnection ( NBEdge from,
NBEdge to 
) const

Returns whether the given connection is controlled by this signal.

Parameters
[in]fromThe connection's start edge
[in]fromThe connection's end edge
Returns
Whether the connection is controlled by this signal

Definition at line 150 of file NBLoadedTLDef.cpp.

bool NBLoadedTLDef::SignalGroup::containsIncoming ( NBEdge from) const

Returns whether this signal controls the given edge.

Parameters
[in]fromThe incoming edge
Returns
Whether this edge is controlled by this signal

Definition at line 169 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::remapRemoved(), and NBLoadedTLDef::replaceRemoved().

bool NBLoadedTLDef::SignalGroup::containsOutgoing ( NBEdge to) const

Returns whether this signal controls a connection where the given edge is the destination.

Parameters
[in]fromThe outgoing edge
Returns
Whether this edge's predecessing edge is controlled by this signal

Definition at line 203 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::remapRemoved(), and NBLoadedTLDef::replaceRemoved().

const NBConnection & NBLoadedTLDef::SignalGroup::getConnection ( unsigned int  pos) const

Returns the connection at the given index.

Parameters
[in]posThe position within this signal
Returns
The connection at the given index

Definition at line 162 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::buildPhaseState(), NBLoadedTLDef::collectNodes(), NBLoadedTLDef::mustBrake(), and NBLoadedTLDef::setTLControllingInformation().

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

Returns the id.

Returns
The stored id

Definition at line 60 of file Named.h.

References Named::myID.

Referenced by Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBTrafficLightDefinition::collectEdges(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NBEdge::connections_sorter(), NLDetectorBuilder::convUncontE2PosLength(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), MSCalibrator::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), 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(), NBRampsComputer::moveRampRight(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), MSVehicle::MSVehicle(), 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(), MSDevice_Person::notifyLeave(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::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()(), 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(), patchTYellow(), AGStreet::print(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), NWWriter_SUMO::prohibitionConnection(), NBEdgeCont::recheckPostProcessConnections(), remapIncoming(), remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), NIXMLConnectionsHandler::validateLaneInfo(), TraCIServerAPI_Vehicle::vtdMap_matchingEdgeLane(), TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), MSInductLoop::writeTypedXMLOutput(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

unsigned int NBLoadedTLDef::SignalGroup::getLinkNo ( ) const

Returns the number of links (connection) controlled by this signal.

Returns
The number of links controlled by this signal

Definition at line 123 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::buildPhaseState(), NBLoadedTLDef::collectNodes(), NBLoadedTLDef::mustBrake(), and NBLoadedTLDef::setTLControllingInformation().

std::vector< SUMOReal > NBLoadedTLDef::SignalGroup::getTimes ( SUMOTime  cycleDuration) const

Returns the times at which the signal switches.

Parameters
[in]cycleDurationThe duration of the complete cycle
Returns
The switch times of this signal

Definition at line 100 of file NBLoadedTLDef.cpp.

References SUMOReal, and NBTrafficLightDefinition::TLCOLOR_RED.

Referenced by NBLoadedTLDef::myCompute().

bool NBLoadedTLDef::SignalGroup::hasYellow ( SUMOTime  time) const

Returns whether controlled links have yellow at the given time.

Parameters
[in]timeThe regarded time
Returns
Whether controlled links are yellow at this time

Definition at line 142 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::buildPhaseState().

bool NBLoadedTLDef::SignalGroup::mayDrive ( SUMOTime  time) const

Returns whether vehicles on controlled links may drive at the given time.

Parameters
[in]timeThe regarded time
Returns
Whether vehicles may drive at this time

Definition at line 129 of file NBLoadedTLDef.cpp.

References NBTrafficLightDefinition::TLCOLOR_GREEN.

Referenced by NBLoadedTLDef::buildPhaseState().

void NBLoadedTLDef::SignalGroup::patchTYellow ( SUMOTime  tyellow,
bool  forced 
)

Sets the yellow time.

Parameters
[in]tyellowThe yellow time to set
[in]forcedWhether resetting tyellow was forced by the user by setting "tls.yellow.patch-small"

Definition at line 88 of file NBLoadedTLDef.cpp.

References Named::getID(), and WRITE_WARNING.

Referenced by NBLoadedTLDef::myCompute().

void NBLoadedTLDef::SignalGroup::remap ( NBEdge removed,
int  removedLane,
NBEdge by,
int  byLane 
)

Replaces a removed edge/lane.

Parameters
[in]removedThe edge to replace
[in]removedLaneThe lane of this edge to replace
[in]byThe edge to insert instead
[in]byLaneThis edge's lane to insert instead

Definition at line 237 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::replaceRemoved().

void NBLoadedTLDef::SignalGroup::remapIncoming ( NBEdge which,
const EdgeVector by 
)

Replaces the given incoming edge by the others given.

Parameters
[in]whichThe edge to replace
[in]byThe replacements

Definition at line 180 of file NBLoadedTLDef.cpp.

References Named::getID(), and NBConnection::replaceFrom().

Referenced by NBLoadedTLDef::remapRemoved().

void NBLoadedTLDef::SignalGroup::remapOutgoing ( NBEdge which,
const EdgeVector by 
)

Replaces the given outgoing edge by the others given.

Parameters
[in]whichThe edge to replace
[in]byThe replacements

Definition at line 214 of file NBLoadedTLDef.cpp.

References Named::getID(), and NBConnection::replaceTo().

Referenced by NBLoadedTLDef::remapRemoved().

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

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 68 of file Named.h.

References Named::myID.

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

void NBLoadedTLDef::SignalGroup::setYellowTimes ( SUMOTime  tRedYellowe,
SUMOTime  tYellow 
)

Sets the times for redyellow and yellow.

Parameters
[in]tRedYelloweThe duration of the redyellow phase
[in]tYellowThe duration of the yellow phase

Definition at line 75 of file NBLoadedTLDef.cpp.

void NBLoadedTLDef::SignalGroup::sortPhases ( )

Sorts the phases.

Definition at line 82 of file NBLoadedTLDef.cpp.

Referenced by NBLoadedTLDef::myCompute().

Field Documentation

NBConnectionVector NBLoadedTLDef::SignalGroup::myConnections
private

Connections controlled by this signal.

Definition at line 195 of file NBLoadedTLDef.h.

std::vector<PhaseDef> NBLoadedTLDef::SignalGroup::myPhases
private

The phases of this signal.

Definition at line 197 of file NBLoadedTLDef.h.

SUMOTime NBLoadedTLDef::SignalGroup::myTRedYellow
private

The times of redyellow and yellow.

Definition at line 199 of file NBLoadedTLDef.h.

SUMOTime NBLoadedTLDef::SignalGroup::myTYellow
private

Definition at line 199 of file NBLoadedTLDef.h.


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