|
SUMO - Simulation of Urban MObility
|
A SUMO-compliant built logic for a traffic light. More...
#include <NBTrafficLightLogic.h>
Data Structures | |
| class | PhaseDefinition |
| The definition of a single phase of the logic. More... | |
Public Member Functions | |
| void | addStep (SUMOTime duration, const std::string &state, int index=-1) |
| Adds a phase to the logic. | |
| void | closeBuilding () throw () |
| closes the building process | |
| void | deletePhase (unsigned int index) |
| SUMOTime | getDuration () const throw () |
| Returns the duration of the complete cycle. | |
| const std::string & | getID () const |
| Returns the id. | |
| unsigned int | getNumLinks () |
| Returns the number of participating links. | |
| SUMOTime | getOffset () const |
| Returns the offset of first switch. | |
| const std::vector < PhaseDefinition > & | getPhases () const |
| Returns the phases. | |
| const std::string & | getProgramID () const |
| Returns the ProgramID. | |
| NBTrafficLightLogic (const std::string &id, const std::string &subid, unsigned int noLinks) throw () | |
| Constructor. | |
| NBTrafficLightLogic (const NBTrafficLightLogic *logic) | |
| Copy Constructor. | |
| void | resetPhases () |
| void | setID (const std::string &newID) |
| resets the id | |
| void | setOffset (SUMOTime offset) throw () |
| Sets the offset of this tls. | |
| void | setPhaseDuration (unsigned int phaseIndex, SUMOTime duration) |
| Modifies the duration for an existing phase (used by NETEDIT) | |
| void | setPhaseState (unsigned int phaseIndex, int tlIndex, LinkState linkState) |
| Modifies the state for an existing phase (used by NETEDIT) | |
| ~NBTrafficLightLogic () throw () | |
| Destructor. | |
Protected Attributes | |
| std::string | myID |
| The name of the object. | |
Private Types | |
| typedef std::vector < PhaseDefinition > | PhaseDefinitionVector |
| Definition of a vector of traffic light phases. | |
Private Attributes | |
| unsigned int | myNumLinks |
| The number of participating links. | |
| SUMOTime | myOffset |
| The tls program's offset. | |
| PhaseDefinitionVector | myPhases |
| The junction logic's storage for traffic light phase list. | |
| const std::string | mySubID |
| The tls program's subid. | |
Static Private Attributes | |
| static const std::string | ALLOWED_STATES |
| static const char | allowedStatesInitializer [] |
| all allowed characters for phase state (see SUMOXMLDefinitions) | |
A SUMO-compliant built logic for a traffic light.
Definition at line 55 of file NBTrafficLightLogic.h.
typedef std::vector<PhaseDefinition> NBTrafficLightLogic::PhaseDefinitionVector [private] |
Definition of a vector of traffic light phases.
Definition at line 204 of file NBTrafficLightLogic.h.
| NBTrafficLightLogic::NBTrafficLightLogic | ( | const std::string & | id, |
| const std::string & | subid, | ||
| unsigned int | noLinks | ||
| ) | throw () |
Constructor.
| [in] | id | The id of the traffic light |
| [in] | subid | The id of the program |
| [in] | noLinks | Number of links that are controlled by this tls. 0 means the value is not known beforehand |
Definition at line 67 of file NBTrafficLightLogic.cpp.
| NBTrafficLightLogic::NBTrafficLightLogic | ( | const NBTrafficLightLogic * | logic | ) |
Copy Constructor.
| [in] | logic | The logic to copy |
Definition at line 72 of file NBTrafficLightLogic.cpp.
| NBTrafficLightLogic::~NBTrafficLightLogic | ( | ) | throw () |
Destructor.
Definition at line 80 of file NBTrafficLightLogic.cpp.
| void NBTrafficLightLogic::addStep | ( | SUMOTime | duration, |
| const std::string & | state, | ||
| int | index = -1 |
||
| ) |
Adds a phase to the logic.
| [in] | duration | The duration of the phase to add |
| [in] | state | The state definition of a tls phase |
| [in] | index | The index of the new phase (-1 means append to end) |
Definition at line 84 of file NBTrafficLightLogic.cpp.
References ALLOWED_STATES, myNumLinks, myPhases, and toString().
Referenced by NBLoadedSUMOTLDef::addPhase(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), and NBLoadedSUMOTLDef::removeConnection().
| void NBTrafficLightLogic::closeBuilding | ( | ) | throw () |
closes the building process
Joins equal steps.
Definition at line 135 of file NBTrafficLightLogic.cpp.
References myPhases.
Referenced by NBLoadedTLDef::myCompute().
| void NBTrafficLightLogic::deletePhase | ( | unsigned int | index | ) |
Definition at line 108 of file NBTrafficLightLogic.cpp.
References myPhases, and toString().
| SUMOTime NBTrafficLightLogic::getDuration | ( | ) | const throw () |
Returns the duration of the complete cycle.
Definition at line 125 of file NBTrafficLightLogic.cpp.
References myPhases.
Referenced by NBTrafficLightLogicCont::computeSingleLogic(), and NBOwnTLDef::myCompute().
| const std::string& Named::getID | ( | ) | const [inline, inherited] |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 59 of file Named.h.
References Named::myID.
Referenced by RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NLHandler::addConnection(), NBLoadedSUMOTLDef::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), NIImporter_SUMO::addPhase(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), RORouteDef_Complete::buildCurrentRoute(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSVTypeProbe::execute(), Command_SaveTLSSwitches::execute(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), MSUnboundActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), Named::ComparatorIdLess::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(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), NWWriter_SUMO::prohibitionConnection(), NBNodeCont::remapEdge(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeDummyEdges(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBConnection::replaceFrom(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), 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(), and MSRouteProbe::writeXMLOutput().
| unsigned int NBTrafficLightLogic::getNumLinks | ( | ) | [inline] |
Returns the number of participating links.
Definition at line 188 of file NBTrafficLightLogic.h.
References myNumLinks.
Referenced by NBLoadedSUMOTLDef::addConnection(), and NBLoadedSUMOTLDef::setTLControllingInformation().
| SUMOTime NBTrafficLightLogic::getOffset | ( | ) | const [inline] |
Returns the offset of first switch.
Definition at line 181 of file NBTrafficLightLogic.h.
References myOffset.
Referenced by NBLoadedSUMOTLDef::removeConnection().
| const std::vector<PhaseDefinition>& NBTrafficLightLogic::getPhases | ( | ) | const [inline] |
Returns the phases.
Definition at line 173 of file NBTrafficLightLogic.h.
References myPhases.
Referenced by NBLoadedSUMOTLDef::removeConnection().
| const std::string& NBTrafficLightLogic::getProgramID | ( | ) | const [inline] |
Returns the ProgramID.
Definition at line 165 of file NBTrafficLightLogic.h.
References mySubID.
| void NBTrafficLightLogic::resetPhases | ( | ) |
Definition at line 118 of file NBTrafficLightLogic.cpp.
References myNumLinks, and myPhases.
| void Named::setID | ( | const std::string & | newID | ) | [inline, inherited] |
| void NBTrafficLightLogic::setOffset | ( | SUMOTime | offset | ) | throw () [inline] |
Sets the offset of this tls.
| [in] | offset | The offset of this cycle |
Definition at line 157 of file NBTrafficLightLogic.h.
References myOffset.
Referenced by NBTrafficLightLogicCont::computeSingleLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBLoadedSUMOTLDef::NBLoadedSUMOTLDef(), and NBLoadedSUMOTLDef::removeConnection().
| void NBTrafficLightLogic::setPhaseDuration | ( | unsigned int | phaseIndex, |
| SUMOTime | duration | ||
| ) |
Modifies the duration for an existing phase (used by NETEDIT)
| [in] | phaseIndex | The index of the phase to modify |
| [in] | duration | The new duration for this phase |
Definition at line 157 of file NBTrafficLightLogic.cpp.
References myPhases.
| void NBTrafficLightLogic::setPhaseState | ( | unsigned int | phaseIndex, |
| int | tlIndex, | ||
| LinkState | linkState | ||
| ) |
Modifies the state for an existing phase (used by NETEDIT)
| [in] | phaseIndex | The index of the phase to modify |
| [in] | tlIndex | The index at which to modify the state |
| [in] | linkState | The new link state for the given index |
Definition at line 148 of file NBTrafficLightLogic.cpp.
References myPhases.
const std::string NBTrafficLightLogic::ALLOWED_STATES [static, private] |
Definition at line 211 of file NBTrafficLightLogic.h.
Referenced by addStep().
const char NBTrafficLightLogic::allowedStatesInitializer [static, private] |
{LINKSTATE_TL_GREEN_MAJOR,
LINKSTATE_TL_GREEN_MINOR,
LINKSTATE_TL_RED,
LINKSTATE_TL_YELLOW_MAJOR,
LINKSTATE_TL_YELLOW_MINOR,
LINKSTATE_TL_OFF_BLINKING,
LINKSTATE_TL_OFF_NOSIGNAL
}
all allowed characters for phase state (see SUMOXMLDefinitions)
Definition at line 210 of file NBTrafficLightLogic.h.
std::string Named::myID [protected, inherited] |
The name of the object.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 81 of file Named.h.
Referenced by RORouteDef_OrigDest::buildCurrentRoute(), RORouteDef_Complete::buildCurrentRoute(), RORouteDef_Alternatives::buildCurrentRoute(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), MSRoute::release(), Named::setID(), NBEdge::splitGeometry(), NBNode::writeLogic(), and MSMeanData::writeXMLOutput().
unsigned int NBTrafficLightLogic::myNumLinks [private] |
The number of participating links.
Definition at line 195 of file NBTrafficLightLogic.h.
Referenced by addStep(), getNumLinks(), and resetPhases().
SUMOTime NBTrafficLightLogic::myOffset [private] |
The tls program's offset.
Definition at line 201 of file NBTrafficLightLogic.h.
Referenced by getOffset(), and setOffset().
The junction logic's storage for traffic light phase list.
Definition at line 207 of file NBTrafficLightLogic.h.
Referenced by addStep(), closeBuilding(), deletePhase(), getDuration(), getPhases(), resetPhases(), setPhaseDuration(), and setPhaseState().
const std::string NBTrafficLightLogic::mySubID [private] |
The tls program's subid.
Definition at line 198 of file NBTrafficLightLogic.h.
Referenced by getProgramID().