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. More... | |
void | addTo (const StoringVisitor &cont) const |
Adds this object to the given container. More... | |
void | closeBuilding () |
closes the building process More... | |
void | deletePhase (unsigned int index) |
SUMOTime | getDuration () const |
Returns the duration of the complete cycle. More... | |
const std::string & | getID () const |
Returns the id. More... | |
unsigned int | getNumLinks () |
Returns the number of participating links. More... | |
SUMOTime | getOffset () const |
Returns the offset of first switch. More... | |
const std::vector < PhaseDefinition > & | getPhases () const |
Returns the phases. More... | |
const std::string & | getProgramID () const |
Returns the ProgramID. More... | |
TrafficLightType | getType () const |
get the algorithm type (static etc..) More... | |
NBTrafficLightLogic (const std::string &id, const std::string &subid, unsigned int noLinks, SUMOTime offset=0, TrafficLightType type=TLTYPE_STATIC) | |
Constructor. More... | |
NBTrafficLightLogic (const NBTrafficLightLogic *logic) | |
Copy Constructor. More... | |
void | resetPhases () |
void | setID (const std::string &newID) |
resets the id More... | |
void | setOffset (SUMOTime offset) |
Sets the offset of this tls. More... | |
void | setPhaseDuration (unsigned int phaseIndex, SUMOTime duration) |
Modifies the duration for an existing phase (used by NETEDIT) More... | |
void | setPhaseState (unsigned int phaseIndex, unsigned int tlIndex, LinkState linkState) |
Modifies the state for an existing phase (used by NETEDIT) More... | |
void | setType (TrafficLightType type) |
set the algorithm type (static etc..) More... | |
~NBTrafficLightLogic () | |
Destructor. More... | |
Protected Attributes | |
std::string | myID |
The name of the object. More... | |
Private Types | |
typedef std::vector < PhaseDefinition > | PhaseDefinitionVector |
Definition of a vector of traffic light phases. More... | |
Private Member Functions | |
NBTrafficLightLogic & | operator= (const NBTrafficLightLogic &s) |
Invalidated assignment operator. More... | |
Private Attributes | |
unsigned int | myNumLinks |
The number of participating links. More... | |
SUMOTime | myOffset |
The tls program's offset. More... | |
PhaseDefinitionVector | myPhases |
The junction logic's storage for traffic light phase list. More... | |
const std::string | mySubID |
The tls program's subid. More... | |
TrafficLightType | myType |
The algorithm type for the traffic light. More... | |
Static Private Attributes | |
static const std::string | ALLOWED_STATES |
static const char | allowedStatesInitializer [] |
all allowed characters for phase state (see SUMOXMLDefinitions) More... | |
A SUMO-compliant built logic for a traffic light.
Definition at line 58 of file NBTrafficLightLogic.h.
|
private |
Definition of a vector of traffic light phases.
Definition at line 219 of file NBTrafficLightLogic.h.
NBTrafficLightLogic::NBTrafficLightLogic | ( | const std::string & | id, |
const std::string & | subid, | ||
unsigned int | noLinks, | ||
SUMOTime | offset = 0 , |
||
TrafficLightType | type = TLTYPE_STATIC |
||
) |
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 |
[in] | offset | The offset of the program (delay) |
[in] | type | The algorithm type for the computed traffic light |
Definition at line 70 of file NBTrafficLightLogic.cpp.
NBTrafficLightLogic::NBTrafficLightLogic | ( | const NBTrafficLightLogic * | logic | ) |
Copy Constructor.
[in] | logic | The logic to copy |
Definition at line 77 of file NBTrafficLightLogic.cpp.
NBTrafficLightLogic::~NBTrafficLightLogic | ( | ) |
Destructor.
Definition at line 86 of file NBTrafficLightLogic.cpp.
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 90 of file NBTrafficLightLogic.cpp.
References ALLOWED_STATES, Named::getID(), myNumLinks, myPhases, and toString().
Referenced by NBLoadedSUMOTLDef::addPhase(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), and NBLoadedSUMOTLDef::removeConnection().
|
inlineinherited |
Adds this object to the given container.
in,filled] | cont The container to add this item to |
Definition at line 114 of file Named.h.
References Named::StoringVisitor::add().
void NBTrafficLightLogic::closeBuilding | ( | ) |
closes the building process
Joins equal steps.
Definition at line 141 of file NBTrafficLightLogic.cpp.
References myPhases.
Referenced by NBLoadedSUMOTLDef::myCompute(), and NBLoadedTLDef::myCompute().
void NBTrafficLightLogic::deletePhase | ( | unsigned int | index | ) |
Definition at line 114 of file NBTrafficLightLogic.cpp.
References myPhases, and toString().
SUMOTime NBTrafficLightLogic::getDuration | ( | ) | const |
Returns the duration of the complete cycle.
Definition at line 131 of file NBTrafficLightLogic.cpp.
References myPhases.
Referenced by NBTrafficLightLogicCont::computeSingleLogic(), and NBOwnTLDef::myCompute().
|
inlineinherited |
Returns the id.
Definition at line 60 of file Named.h.
References Named::myID.
Referenced by NIImporter_SUMO::_loadNetwork(), Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), GUITrafficLightLogicWrapper::begin2TrackPhases(), 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(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), 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(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NBEdge::connections_sorter(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), GUINet::createTLWrapper(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), RODFNet::getDetectorEdge(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), RODFDetectorCon::guessEmptyFlows(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), 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_Example::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Person::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Example::notifyMove(), GUIViewTraffic::onGamingClick(), 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(), NBLoadedTLDef::SignalGroup::patchTYellow(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Vehicle::processSet(), NWWriter_SUMO::prohibitionConnection(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::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(), RODFNet::revalidateFlows(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), GUITrafficLightLogicWrapper::switchTLSLogic(), 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(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_SUMO::writeInternalConnections(), 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(), MSInductLoop::writeTypedXMLOutput(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().
|
inline |
Returns the number of participating links.
Definition at line 194 of file NBTrafficLightLogic.h.
References myNumLinks.
Referenced by NBLoadedSUMOTLDef::addConnection(), and NBLoadedSUMOTLDef::setTLControllingInformation().
|
inline |
Returns the offset of first switch.
Definition at line 187 of file NBTrafficLightLogic.h.
References myOffset.
Referenced by NBLoadedSUMOTLDef::NBLoadedSUMOTLDef().
|
inline |
Returns the phases.
Definition at line 179 of file NBTrafficLightLogic.h.
References myPhases.
Referenced by NBLoadedSUMOTLDef::removeConnection().
|
inline |
Returns the ProgramID.
Definition at line 171 of file NBTrafficLightLogic.h.
References mySubID.
|
inline |
get the algorithm type (static etc..)
Definition at line 199 of file NBTrafficLightLogic.h.
References myType.
Referenced by NBLoadedSUMOTLDef::NBLoadedSUMOTLDef().
|
private |
Invalidated assignment operator.
void NBTrafficLightLogic::resetPhases | ( | ) |
Definition at line 124 of file NBTrafficLightLogic.cpp.
References myNumLinks, and myPhases.
Referenced by NIXMLTrafficLightsHandler::myStartElement().
|
inlineinherited |
resets the id
[in] | newID | The new id of this object |
Definition at line 68 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
inline |
Sets the offset of this tls.
[in] | offset | The offset of this cycle |
Definition at line 163 of file NBTrafficLightLogic.h.
References myOffset.
Referenced by NBTrafficLightLogicCont::computeSingleLogic(), and NBLoadedSUMOTLDef::setOffset().
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 163 of file NBTrafficLightLogic.cpp.
References myPhases.
void NBTrafficLightLogic::setPhaseState | ( | unsigned int | phaseIndex, |
unsigned 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 154 of file NBTrafficLightLogic.cpp.
References myPhases.
|
inline |
set the algorithm type (static etc..)
Definition at line 204 of file NBTrafficLightLogic.h.
References myType.
|
staticprivate |
Definition at line 229 of file NBTrafficLightLogic.h.
Referenced by addStep().
|
staticprivate |
all allowed characters for phase state (see SUMOXMLDefinitions)
Definition at line 228 of file NBTrafficLightLogic.h.
|
protectedinherited |
The name of the object.
Definition at line 121 of file Named.h.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), RODFDetector::buildDestinationDistribution(), NGEdge::buildNBEdge(), NGNode::buildNBNode(), MSCalibrator::execute(), Named::getID(), NBEdge::getLaneID(), NBEdge::getLaneIDInsecure(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSCalibrator::init(), NBEdge::init(), MSCalibrator::myStartElement(), MSCalibrator::VehicleRemover::notifyEnter(), RORouteDef::preComputeCurrentRoute(), NBEdge::reinitNodes(), MSRoute::release(), RORouteDef::repairCurrentRoute(), Named::setID(), NBEdge::splitGeometry(), RODFDetector::writeEmitterDefinition(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), RODFDetector::writeSingleSpeedTrigger(), MSCalibrator::writeXMLOutput(), MSE3Collector::writeXMLOutput(), and MSMeanData::writeXMLOutput().
|
private |
The number of participating links.
Definition at line 210 of file NBTrafficLightLogic.h.
Referenced by addStep(), getNumLinks(), and resetPhases().
|
private |
The tls program's offset.
Definition at line 216 of file NBTrafficLightLogic.h.
Referenced by getOffset(), and setOffset().
|
private |
The junction logic's storage for traffic light phase list.
Definition at line 222 of file NBTrafficLightLogic.h.
Referenced by addStep(), closeBuilding(), deletePhase(), getDuration(), getPhases(), resetPhases(), setPhaseDuration(), and setPhaseState().
|
private |
The tls program's subid.
Definition at line 213 of file NBTrafficLightLogic.h.
Referenced by getProgramID().
|
private |
The algorithm type for the traffic light.
Definition at line 225 of file NBTrafficLightLogic.h.