SUMO - Simulation of Urban MObility
|
The parent class for traffic light logics. More...
#include <MSTrafficLightLogic.h>
Data Structures | |
class | SwitchCommand |
Class realising the switch between the traffic light phases. More... |
Public Types | |
Structure definitions | |
typedef std::vector < MSPhaseDefinition * > | Phases |
Definition of a list of phases, being the junction logic. | |
typedef std::vector< MSLink * > | LinkVector |
Definition of the list of links that participate in this tl-light. | |
typedef std::vector< LinkVector > | LinkVectorVector |
Definition of a list that holds lists of links that do have the same attribute. | |
typedef std::vector< MSLane * > | LaneVector |
Definition of the list of links that participate in this tl-light. | |
typedef std::vector< LaneVector > | LaneVectorVector |
Definition of a list that holds lists of links that do have the same attribute. |
Public Member Functions | |
void | addParameter (const std::string &key, const std::string &value) |
Adds a parameter. | |
void | addParameter (const std::map< std::string, std::string > &mapArg) |
Adds all given parameter. | |
void | addParameter (const Parameterised &p) |
Adds all given parameter. | |
void | addTo (const StoringVisitor &cont) const |
Adds this object to the given container. | |
void | clearParameter () |
Clears the parameter map. | |
const std::string & | getID () const |
Returns the id. | |
const std::map< std::string, std::string > & | getMap () const |
Returns the inner key/value map. | |
const std::string & | getParameter (const std::string &key, const std::string &defaultValue) const |
Returns the value for a given key. | |
virtual void | init (NLDetectorBuilder &nb) |
Initialises the tls with information about incoming lanes. | |
bool | knowsParameter (const std::string &key) const |
Returns whether the parameter is known. | |
MSTrafficLightLogic (MSTLLogicControl &tlcontrol, const std::string &id, const std::string &programID, SUMOTime delay, const std::map< std::string, std::string > ¶meters) | |
Constructor. | |
void | setID (const std::string &newID) |
resets the id | |
virtual | ~MSTrafficLightLogic () |
Destructor. | |
Handling of controlled links | |
void | addLink (MSLink *link, MSLane *lane, unsigned int pos) |
Adds a link on building. | |
virtual void | adaptLinkInformationFrom (const MSTrafficLightLogic &logic) |
Applies information about controlled links and lanes from the given logic. | |
std::map< MSLink *, LinkState > | collectLinkStates () const |
Returns the (uncontrolled) states of the controlled links. | |
void | resetLinkStates (const std::map< MSLink *, LinkState > &vals) const |
Resets the states of controlled links. | |
Switching and setting current rows | |
virtual SUMOTime | trySwitch (bool isActive)=0 |
Switches to the next phase. | |
bool | setTrafficLightSignals (SUMOTime t) const |
Applies the current signal states to controlled links. | |
Static Information Retrieval | |
const std::string & | getProgramID () const |
Returns this tl-logic's id. | |
const LaneVectorVector & | getLaneVectors () const |
Returns the list of lists of all lanes controlled by this tls. | |
const LaneVector & | getLanesAt (unsigned int i) const |
Returns the list of lanes that are controlled by the signals at the given position. | |
const LinkVectorVector & | getLinks () const |
Returns the list of lists of all affected links. | |
const LinkVector & | getLinksAt (unsigned int i) const |
Returns the list of links that are controlled by the signals at the given position. | |
int | getLinkIndex (const MSLink *const link) const |
Returns the index of the given link. | |
virtual unsigned int | getPhaseNumber () const =0 |
Returns the number of phases. | |
virtual const Phases & | getPhases () const =0 |
Returns the phases of this tls program. | |
virtual const MSPhaseDefinition & | getPhase (unsigned int givenstep) const =0 |
Returns the definition of the phase from the given position within the plan. | |
Dynamic Information Retrieval | |
virtual unsigned int | getCurrentPhaseIndex () const =0 |
Returns the current index within the program. | |
virtual const MSPhaseDefinition & | getCurrentPhaseDef () const =0 |
Returns the definition of the current phase. | |
SUMOTime | getDefaultCycleTime () const |
Returns the cycle time (in ms) | |
SUMOTime | getNextSwitchTime () const |
Returns the assumed next switch time. | |
Conversion between time and phase | |
virtual SUMOTime | getPhaseIndexAtTime (SUMOTime simStep) const =0 |
Returns the index of the logic at the given simulation step. | |
virtual SUMOTime | getOffsetFromIndex (unsigned int index) const =0 |
Returns the position (start of a phase during a cycle) from of a given step. | |
virtual unsigned int | getIndexFromOffset (SUMOTime offset) const =0 |
Returns the step (the phasenumber) of a given position of the cycle. | |
Changing phases and phase durations | |
void | addOverridingDuration (SUMOTime duration) |
Changes the duration of the next phase. | |
void | setCurrentDurationIncrement (SUMOTime delay) |
Delays current phase by the given delay. | |
virtual void | changeStepAndDuration (MSTLLogicControl &tlcontrol, SUMOTime simStep, unsigned int step, SUMOTime stepDuration)=0 |
Changes the current phase and her duration. |
Protected Attributes | |
SUMOTime | myCurrentDurationIncrement |
A value for enlarge the current duration. | |
SUMOTime | myDefaultCycleTime |
The cycle time (without changes) | |
std::string | myID |
The name of the object. | |
LaneVectorVector | myLanes |
The list of links which do participate in this traffic light. | |
LinkVectorVector | myLinks |
The list of links which do participate in this traffic light. | |
std::vector< SUMOTime > | myOverridingTimes |
A list of duration overrides. | |
std::string | myProgramID |
The id of the logic. | |
SwitchCommand * | mySwitchCommand |
The current switch command. |
Private Member Functions | |
MSTrafficLightLogic (const MSTrafficLightLogic &s) | |
invalidated copy constructor | |
MSTrafficLightLogic & | operator= (const MSTrafficLightLogic &s) |
invalidated assignment operator |
The parent class for traffic light logics.
Definition at line 63 of file MSTrafficLightLogic.h.
typedef std::vector<MSLane*> MSTrafficLightLogic::LaneVector |
Definition of the list of links that participate in this tl-light.
Definition at line 78 of file MSTrafficLightLogic.h.
typedef std::vector<LaneVector> MSTrafficLightLogic::LaneVectorVector |
Definition of a list that holds lists of links that do have the same attribute.
Definition at line 81 of file MSTrafficLightLogic.h.
typedef std::vector<MSLink*> MSTrafficLightLogic::LinkVector |
Definition of the list of links that participate in this tl-light.
Definition at line 72 of file MSTrafficLightLogic.h.
typedef std::vector<LinkVector> MSTrafficLightLogic::LinkVectorVector |
Definition of a list that holds lists of links that do have the same attribute.
Definition at line 75 of file MSTrafficLightLogic.h.
typedef std::vector<MSPhaseDefinition*> MSTrafficLightLogic::Phases |
Definition of a list of phases, being the junction logic.
Definition at line 69 of file MSTrafficLightLogic.h.
MSTrafficLightLogic::MSTrafficLightLogic | ( | MSTLLogicControl & | tlcontrol, |
const std::string & | id, | ||
const std::string & | programID, | ||
SUMOTime | delay, | ||
const std::map< std::string, std::string > & | parameters | ||
) |
Constructor.
[in] | tlcontrol | The tls control responsible for this tls |
[in] | id | This tls' id |
[in] | programID | This tls' sub-id (program id) |
[in] | delay | The time to wait before the first switch |
Definition at line 103 of file MSTrafficLightLogic.cpp.
References MSEventControl::addEvent(), MSNet::getBeginOfTimestepEvents(), MSNet::getInstance(), mySwitchCommand, and MSEventControl::NO_CHANGE.
|
virtual |
Destructor.
Definition at line 144 of file MSTrafficLightLogic.cpp.
|
private |
invalidated copy constructor
|
virtual |
Applies information about controlled links and lanes from the given logic.
If we load a logic after the network has been loaded, we do not get the information about controlled links afterwards. We have to copy them from a previously loaded logic.
[in] | logic | The logic to use the information about controlled links/lanes from |
Reimplemented in MSOffTrafficLightLogic.
Definition at line 170 of file MSTrafficLightLogic.cpp.
References myLanes, and myLinks.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic().
Adds a link on building.
[in] | link | The controlled link |
[in] | lane | The lane this link starts at |
[in] | pos | The link's index (signal group) within this program |
Definition at line 152 of file MSTrafficLightLogic.cpp.
References getCurrentPhaseDef(), MSNet::getInstance(), myLanes, myLinks, and MSLink::setTLState().
void MSTrafficLightLogic::addOverridingDuration | ( | SUMOTime | duration | ) |
Changes the duration of the next phase.
[in] | duration | The new duration |
Definition at line 243 of file MSTrafficLightLogic.cpp.
References myOverridingTimes.
|
inherited |
Adds a parameter.
[in] | key | The parameter's name |
[in] | value | The parameter's value |
Definition at line 53 of file Parameterised.cpp.
References Parameterised::myMap.
Referenced by NLHandler::addParam(), SUMORouteHandler::addParam(), PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NBTrafficLightDefinition::compute(), NIImporter_OpenDrive::loadNetwork(), and NIImporter_MATSim::EdgesHandler::myStartElement().
|
inherited |
Adds all given parameter.
[in] | mapArg | The keys/values to insert |
Definition at line 59 of file Parameterised.cpp.
References Parameterised::myMap.
|
inherited |
Adds all given parameter.
[in] | p | The keys/values to insert |
Definition at line 67 of file Parameterised.cpp.
References Parameterised::myMap.
|
inlineinherited |
Adds this object to the given container.
in,filled] | cont The container to add this item to |
Definition at line 121 of file Named.h.
References Named::StoringVisitor::add().
|
pure virtual |
Changes the current phase and her duration.
[in] | tlcontrol | The responsible traffic lights control |
[in] | simStep | The current simulation step |
[in] | step | Index of the phase to use |
[in] | stepDuration | The left duration of the phase |
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by TraCIServerAPI_TLS::processSet(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
|
inherited |
Clears the parameter map.
Definition at line 91 of file Parameterised.cpp.
References Parameterised::myMap.
Returns the (uncontrolled) states of the controlled links.
Definition at line 177 of file MSTrafficLightLogic.cpp.
References myLinks.
|
pure virtual |
Returns the definition of the current phase.
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by addLink(), GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSTLLogicControl::getPhaseDef(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), TraCIServerAPI_TLS::processGet(), setTrafficLightSignals(), and MSFullExport::writeTLS().
|
pure virtual |
Returns the current index within the program.
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), TraCIServerAPI_TLS::processGet(), and TraCIServerAPI_TLS::processSet().
|
inline |
Returns the cycle time (in ms)
Definition at line 259 of file MSTrafficLightLogic.h.
References myDefaultCycleTime.
Referenced by MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP().
|
inlineinherited |
Returns the id.
Definition at line 60 of file Named.h.
References Named::myID.
Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::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(), NBNode::buildCrossings(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), NBNode::buildInnerEdges(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBNode::buildWalkingAreas(), 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(), 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(), MSPModel_Striping::MovePedestrians::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), PedestrianEdge< E, L, N >::getEffort(), NBEdge::getFirstNonPedestrianLane(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPModel_Striping::getNextLane(), GUIVehicle::getParameterWindow(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), init(), PedestrianEdge< E, L, N >::initPedestrianNetwork(), 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(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTreceiver::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Example::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::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()(), MSEdge::by_id_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(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_JE2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSRightOfWayJunction::postloadInit(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processSet(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), MSCalibrator::removePending(), 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(), MSLink::setRequestInformation(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap_matchingEdgeLane(), TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(), MSLCM_JE2013::wantsChange(), MSFCDExport::write(), MSEmissionExport::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().
Returns the step (the phasenumber) of a given position of the cycle.
[in] | offset | The offset (time) for which the according phase shall be returned |
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
|
inline |
Returns the list of lanes that are controlled by the signals at the given position.
[in] | i | The index of the signal |
Definition at line 191 of file MSTrafficLightLogic.h.
References myLanes.
Referenced by MSAgentbasedTrafficLightLogic::collectData(), GUITrafficLightLogicWrapper::drawGL(), MSActuatedTrafficLightLogic::duration(), Command_SaveTLSSwitches::execute(), MSActuatedTrafficLightLogic::gapControl(), and GUIViewTraffic::onGamingClick().
|
inline |
Returns the list of lists of all lanes controlled by this tls.
Definition at line 182 of file MSTrafficLightLogic.h.
References myLanes.
Referenced by GUITrafficLightLogicWrapper::getCenteringBoundary(), TraCIServerAPI_TLS::processGet(), and MSFullExport::writeTLS().
Returns the index of the given link.
[in] | link | The link to retrieve the index for |
Definition at line 219 of file MSTrafficLightLogic.cpp.
References myLinks.
Referenced by GUITrafficLightLogicWrapper::getLinkIndex().
|
inline |
Returns the list of lists of all affected links.
Definition at line 199 of file MSTrafficLightLogic.h.
References myLinks.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), GUINet::createTLWrapper(), GUITLLogicPhasesTrackerWindow::drawValues(), Command_SaveTLSSwitches::execute(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), TraCIServerAPI_TLS::processGet(), and MSOffTrafficLightLogic::rebuildPhase().
|
inline |
Returns the list of links that are controlled by the signals at the given position.
[in] | i | The index of the signal |
Definition at line 208 of file MSTrafficLightLogic.h.
References myLinks.
|
inlineinherited |
Returns the inner key/value map.
Definition at line 107 of file Parameterised.h.
References Parameterised::myMap.
Referenced by NBTrafficLightDefinition::compute(), GUIVehicle::getParameterWindow(), and PCPolyContainer::save().
SUMOTime MSTrafficLightLogic::getNextSwitchTime | ( | ) | const |
Returns the assumed next switch time.
The time may change in case of adaptive/actuated traffic lights.
Definition at line 236 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::SwitchCommand::getNextSwitchTime(), and mySwitchCommand.
Referenced by MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), and TraCIServerAPI_TLS::processGet().
Returns the position (start of a phase during a cycle) from of a given step.
[in] | index | The index of the phase to return the begin of |
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by MSTLLogicControl::WAUTSwitchProcedure::getDiffToStartOfPhase(), and MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP().
|
inherited |
Returns the value for a given key.
[in] | key | The key to ask for |
[in] | defaultValue | The default value to return if no value is stored under the key |
Definition at line 81 of file Parameterised.cpp.
References Parameterised::myMap.
Referenced by MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSAgentbasedTrafficLightLogic::MSAgentbasedTrafficLightLogic(), and TraCIServerAPI_Vehicle::vtdMap_matchingNearest().
|
pure virtual |
Returns the definition of the phase from the given position within the plan.
[in] | givenstep | The index of the phase within the plan |
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_TLS::processSet(), and MSTLLogicControl::WAUTSwitchProcedure::switchToPos().
Returns the index of the logic at the given simulation step.
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
|
pure virtual |
Returns the number of phases.
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by TraCIServerAPI_TLS::processGet(), and TraCIServerAPI_TLS::processSet().
|
pure virtual |
Returns the phases of this tls program.
Implemented in MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
Referenced by GUITrafficLightLogicWrapper::drawGL(), and init().
|
inline |
Returns this tl-logic's id.
Definition at line 174 of file MSTrafficLightLogic.h.
References myProgramID.
Referenced by Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), init(), GUIViewTraffic::onGamingClick(), and TraCIServerAPI_TLS::processGet().
|
virtual |
Initialises the tls with information about incoming lanes.
[in] | nb | The detector builder |
[in] | edgeContinuations | Information about edge predecessors/successors |
ProcessError | If something fails on initialisation |
Reimplemented in MSAgentbasedTrafficLightLogic, MSActuatedTrafficLightLogic, and MSOffTrafficLightLogic.
Definition at line 116 of file MSTrafficLightLogic.cpp.
References Named::getID(), getPhases(), getProgramID(), LINKSTATE_TL_GREEN_MAJOR, LINKSTATE_TL_GREEN_MINOR, LINKSTATE_TL_RED, MIN2(), myLanes, SVC_PEDESTRIAN, toString(), and WRITE_WARNING.
Referenced by NLJunctionControlBuilder::closeTrafficLightLogic().
|
inherited |
Returns whether the parameter is known.
[in] | key | The key to ask for |
Definition at line 75 of file Parameterised.cpp.
References Parameterised::myMap.
Referenced by MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), and TraCIServerAPI_Vehicle::vtdMap_matchingNearest().
|
private |
invalidated assignment operator
Resets the states of controlled links.
[in] | vals | The state of controlled links to use |
Definition at line 206 of file MSTrafficLightLogic.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), and myLinks.
void MSTrafficLightLogic::setCurrentDurationIncrement | ( | SUMOTime | delay | ) |
Delays current phase by the given delay.
[in] | delay | The time by which the current phase shall be delayed |
Definition at line 249 of file MSTrafficLightLogic.cpp.
References myCurrentDurationIncrement.
|
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().
Applies the current signal states to controlled links.
[in] | t | The current time |
Definition at line 190 of file MSTrafficLightLogic.cpp.
References getCurrentPhaseDef(), MSPhaseDefinition::getState(), and myLinks.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), and MSSimpleTrafficLightLogic::changeStepAndDuration().
Switches to the next phase.
[in] | isActive | Whether this program is the currently used one |
Implemented in MSAgentbasedTrafficLightLogic, MSActuatedTrafficLightLogic, MSOffTrafficLightLogic, and MSSimpleTrafficLightLogic.
|
protected |
A value for enlarge the current duration.
Definition at line 402 of file MSTrafficLightLogic.h.
Referenced by setCurrentDurationIncrement(), and MSSimpleTrafficLightLogic::trySwitch().
|
protected |
The cycle time (without changes)
Definition at line 408 of file MSTrafficLightLogic.h.
Referenced by getDefaultCycleTime(), MSSimpleTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSOffTrafficLightLogic::MSOffTrafficLightLogic(), and MSSimpleTrafficLightLogic::MSSimpleTrafficLightLogic().
|
protectedinherited |
The name of the object.
Definition at line 128 of file Named.h.
Referenced by GUI_E2_ZS_CollectorOverLanes::buildCollector(), RODFDetector::buildDestinationDistribution(), NGEdge::buildNBEdge(), NGNode::buildNBNode(), NBNode::computeNodeShape(), 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(), MSMeanData::openInterval(), RORouteDef::preComputeCurrentRoute(), NBEdge::reinitNodes(), MSRoute::release(), RORouteDef::repairCurrentRoute(), Named::setID(), NBEdge::splitGeometry(), RODFDetector::writeEmitterDefinition(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), RODFDetector::writeSingleSpeedTrigger(), MSCalibrator::writeXMLOutput(), and MSE3Collector::writeXMLOutput().
|
protected |
The list of links which do participate in this traffic light.
Definition at line 396 of file MSTrafficLightLogic.h.
Referenced by adaptLinkInformationFrom(), addLink(), getLanesAt(), getLaneVectors(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), and init().
|
protected |
The list of links which do participate in this traffic light.
Definition at line 393 of file MSTrafficLightLogic.h.
Referenced by adaptLinkInformationFrom(), addLink(), collectLinkStates(), getLinkIndex(), getLinks(), getLinksAt(), resetLinkStates(), and setTrafficLightSignals().
|
protected |
A list of duration overrides.
Definition at line 399 of file MSTrafficLightLogic.h.
Referenced by addOverridingDuration(), and MSSimpleTrafficLightLogic::trySwitch().
|
protected |
The id of the logic.
Definition at line 390 of file MSTrafficLightLogic.h.
Referenced by getProgramID(), MSActuatedTrafficLightLogic::init(), and MSAgentbasedTrafficLightLogic::init().
|
protected |
The current switch command.
Definition at line 405 of file MSTrafficLightLogic.h.
Referenced by MSSimpleTrafficLightLogic::changeStepAndDuration(), getNextSwitchTime(), and MSTrafficLightLogic().