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

A traffic lights logic which represents a tls in an off-mode. More...

#include <MSOffTrafficLightLogic.h>

Inheritance diagram for MSOffTrafficLightLogic:
MSTrafficLightLogic Named Parameterised

Public Types

Structure definitions
typedef std::vector
< MSPhaseDefinition * > 
Phases
 Definition of a list of phases, being the junction logic. More...
 
typedef std::vector< MSLink * > LinkVector
 Definition of the list of links that participate in this tl-light. More...
 
typedef std::vector< LinkVectorLinkVectorVector
 Definition of a list that holds lists of links that do have the same attribute. More...
 
typedef std::vector< MSLane * > LaneVector
 Definition of the list of links that participate in this tl-light. More...
 
typedef std::vector< LaneVectorLaneVectorVector
 Definition of a list that holds lists of links that do have the same attribute. More...
 

Public Member Functions

void addParameter (const std::string &key, const std::string &value)
 Adds a parameter. More...
 
void addParameter (const std::map< std::string, std::string > &mapArg)
 Adds all given parameter. More...
 
void addParameter (const Parameterised &p)
 Adds all given parameter. More...
 
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
void clearParameter ()
 Clears the parameter map. More...
 
const std::string & getID () const
 Returns the id. More...
 
const std::map< std::string,
std::string > & 
getMap () const
 Returns the inner key/value map. More...
 
const std::string & getParameter (const std::string &key, const std::string &defaultValue) const
 Returns the value for a given key. More...
 
virtual void init (NLDetectorBuilder &nb)
 Initialises the tls with information about incoming lanes. More...
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
 MSOffTrafficLightLogic (MSTLLogicControl &tlcontrol, const std::string &id)
 Constructor. More...
 
void setID (const std::string &newID)
 resets the id More...
 
 ~MSOffTrafficLightLogic ()
 Destructor. More...
 
Handling of controlled links
void adaptLinkInformationFrom (const MSTrafficLightLogic &logic)
 Applies information about controlled links and lanes from the given logic. More...
 
Switching and setting current rows
SUMOTime trySwitch ()
 Switches to the next phase. More...
 
Static Information Retrieval
unsigned int getPhaseNumber () const
 Returns the number of phases. More...
 
const PhasesgetPhases () const
 Returns the phases of this tls program. More...
 
const MSPhaseDefinitiongetPhase (unsigned int givenstep) const
 Returns the definition of the phase from the given position within the plan. More...
 
const std::string getLogicType () const
 Returns the type of the logic as a string. More...
 
Dynamic Information Retrieval
unsigned int getCurrentPhaseIndex () const
 Returns the current index within the program. More...
 
const MSPhaseDefinitiongetCurrentPhaseDef () const
 Returns the definition of the current phase. More...
 
Conversion between time and phase
SUMOTime getPhaseIndexAtTime (SUMOTime simStep) const
 Returns the index of the logic at the given simulation step. More...
 
SUMOTime getOffsetFromIndex (unsigned int index) const
 Returns the position (start of a phase during a cycle) from of a given step. More...
 
unsigned int getIndexFromOffset (SUMOTime offset) const
 Returns the step (the phasenumber) of a given position of the cycle. More...
 
Changing phases and phase durations
void changeStepAndDuration (MSTLLogicControl &tlcontrol, SUMOTime simStep, unsigned int step, SUMOTime stepDuration)
 Changes the current phase and her duration. More...
 
Handling of controlled links
void addLink (MSLink *link, MSLane *lane, unsigned int pos)
 Adds a link on building. More...
 
std::map< MSLink *, LinkStatecollectLinkStates () const
 Returns the (uncontrolled) states of the controlled links. More...
 
void resetLinkStates (const std::map< MSLink *, LinkState > &vals) const
 Resets the states of controlled links. More...
 
Switching and setting current rows
bool setTrafficLightSignals (SUMOTime t) const
 Applies the current signal states to controlled links. More...
 
Static Information Retrieval
const std::string & getProgramID () const
 Returns this tl-logic's id. More...
 
const LaneVectorVectorgetLaneVectors () const
 Returns the list of lists of all lanes controlled by this tls. More...
 
const LaneVectorgetLanesAt (unsigned int i) const
 Returns the list of lanes that are controlled by the signals at the given position. More...
 
const LinkVectorVectorgetLinks () const
 Returns the list of lists of all affected links. More...
 
const LinkVectorgetLinksAt (unsigned int i) const
 Returns the list of links that are controlled by the signals at the given position. More...
 
int getLinkIndex (const MSLink *const link) const
 Returns the index of the given link. More...
 
Dynamic Information Retrieval
SUMOTime getDefaultCycleTime () const
 Returns the cycle time (in ms) More...
 
SUMOTime getNextSwitchTime () const
 Returns the assumed next switch time. More...
 
Changing phases and phase durations
void addOverridingDuration (SUMOTime duration)
 Changes the duration of the next phase. More...
 
void setCurrentDurationIncrement (SUMOTime delay)
 Delays current phase by the given delay. More...
 

Protected Attributes

SUMOTime myCurrentDurationIncrement
 A value for enlarge the current duration. More...
 
SUMOTime myDefaultCycleTime
 The cycle time (without changes) More...
 
std::string myID
 The name of the object. More...
 
LaneVectorVector myLanes
 The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index. More...
 
LinkVectorVector myLinks
 The list of LinkVectors; each vector contains the links that belong to the same link index. More...
 
std::vector< SUMOTimemyOverridingTimes
 A list of duration overrides. More...
 
std::string myProgramID
 The id of the logic. More...
 
SwitchCommandmySwitchCommand
 The current switch command. More...
 

Static Protected Attributes

static const LaneVector myEmptyLaneVector
 An empty lane vector. More...
 

Private Member Functions

void rebuildPhase ()
 (Re)builds the internal phase definition More...
 

Private Attributes

MSTrafficLightLogic::Phases myPhaseDefinition
 The phase definition (only one) More...
 

Detailed Description

A traffic lights logic which represents a tls in an off-mode.

Definition at line 53 of file MSOffTrafficLightLogic.h.

Member Typedef Documentation

typedef std::vector<MSLane*> MSTrafficLightLogic::LaneVector
inherited

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
inherited

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
inherited

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
inherited

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
inherited

Definition of a list of phases, being the junction logic.

Definition at line 69 of file MSTrafficLightLogic.h.

Constructor & Destructor Documentation

MSOffTrafficLightLogic::MSOffTrafficLightLogic ( MSTLLogicControl tlcontrol,
const std::string &  id 
)

Constructor.

Parameters
[in]tlcontrolThe tls control responsible for this tls
[in]idThis tls' id The sub-id is always "off".

Definition at line 47 of file MSOffTrafficLightLogic.cpp.

References MSTrafficLightLogic::myDefaultCycleTime, and TIME2STEPS.

MSOffTrafficLightLogic::~MSOffTrafficLightLogic ( )

Destructor.

Definition at line 54 of file MSOffTrafficLightLogic.cpp.

References myPhaseDefinition.

Member Function Documentation

void MSOffTrafficLightLogic::adaptLinkInformationFrom ( const MSTrafficLightLogic logic)
virtual

Applies information about controlled links and lanes from the given logic.

Parameters
[in]logicThe logic to use the information about controlled links/lanes from
See also
MSTrafficLightLogic::adaptLinkInformationFrom

Reimplemented from MSTrafficLightLogic.

Definition at line 69 of file MSOffTrafficLightLogic.cpp.

References MSTrafficLightLogic::adaptLinkInformationFrom(), and rebuildPhase().

void MSTrafficLightLogic::addLink ( MSLink link,
MSLane lane,
unsigned int  pos 
)
inherited

Adds a link on building.

Parameters
[in]linkThe controlled link
[in]laneThe lane this link starts at
[in]posThe link's index (signal group) within this program

Definition at line 163 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::getCurrentPhaseDef(), MSNet::getInstance(), MSTrafficLightLogic::myLanes, MSTrafficLightLogic::myLinks, and MSLink::setTLState().

void MSTrafficLightLogic::addOverridingDuration ( SUMOTime  duration)
inherited

Changes the duration of the next phase.

Parameters
[in]durationThe new duration

Definition at line 254 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myOverridingTimes.

void Parameterised::addParameter ( const std::map< std::string, std::string > &  mapArg)
inherited

Adds all given parameter.

Parameters
[in]mapArgThe keys/values to insert

Definition at line 59 of file Parameterised.cpp.

References Parameterised::myMap.

void Parameterised::addParameter ( const Parameterised p)
inherited

Adds all given parameter.

Parameters
[in]pThe keys/values to insert

Definition at line 67 of file Parameterised.cpp.

References Parameterised::myMap.

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 121 of file Named.h.

References Named::StoringVisitor::add().

void MSOffTrafficLightLogic::changeStepAndDuration ( MSTLLogicControl tlcontrol,
SUMOTime  simStep,
unsigned int  step,
SUMOTime  stepDuration 
)
inlinevirtual

Changes the current phase and her duration.

Parameters
[in]tlcontrolThe responsible traffic lights control
[in]simStepThe current simulation step
[in]stepIndex of the phase to use
[in]stepDurationThe left duration of the phase
See also
MSTrafficLightLogic::changeStepAndDuration

Implements MSTrafficLightLogic.

Definition at line 192 of file MSOffTrafficLightLogic.h.

References UNUSED_PARAMETER.

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 91 of file Parameterised.cpp.

References Parameterised::myMap.

std::map< MSLink *, LinkState > MSTrafficLightLogic::collectLinkStates ( ) const
inherited

Returns the (uncontrolled) states of the controlled links.

Returns
The controlled link's states

Definition at line 188 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myLinks.

const MSPhaseDefinition & MSOffTrafficLightLogic::getCurrentPhaseDef ( ) const
virtual

Returns the definition of the current phase.

Returns
The current phase
See also
MSTrafficLightLogic::getCurrentPhaseDef

Implements MSTrafficLightLogic.

Definition at line 118 of file MSOffTrafficLightLogic.cpp.

References myPhaseDefinition.

unsigned int MSOffTrafficLightLogic::getCurrentPhaseIndex ( ) const
virtual

Returns the current index within the program.

Returns
The index of the current phase within the tls
See also
MSTrafficLightLogic::getCurrentPhaseIndex

Implements MSTrafficLightLogic.

Definition at line 112 of file MSOffTrafficLightLogic.cpp.

SUMOTime MSTrafficLightLogic::getDefaultCycleTime ( ) const
inlineinherited

Returns the cycle time (in ms)

Returns
The (maybe changing) cycle time of this tls

Definition at line 268 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myDefaultCycleTime.

Referenced by MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP().

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 NIImporter_SUMO::_loadNetwork(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSLane::addApproachingLane(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), MSNet::addContainerStop(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBEdge::addSidewalk(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), MSVehicle::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), AGActivityTripWriter::addTrip(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSContainer::MSContainerStage_Driving::beginEventOutput(), MSContainer::MSContainerStage_Waiting::beginEventOutput(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NLEdgeControlBuilder::build(), 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(), NBLoadedSUMOTLDef::collectEdges(), NBTrafficLightDefinition::collectEdges(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBOwnTLDef::computeLogicAndConts(), NBNode::computeNodeShape(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBNode::computeSmoothShape(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), GUINet::createTLWrapper(), NIVissimDistrictConnection::dict_BuildDistricts(), MSContainer::MSContainerStage_Driving::endEventOutput(), MSContainer::MSContainerStage_Waiting::endEventOutput(), 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(), MSNet::getContainerStopID(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), PedestrianEdge< E, L, N >::getEffort(), NBEdge::getFirstNonPedestrianLane(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPModel_Striping::getNextLane(), GUIVehicle::getParameterWindow(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), MSVehicleControl::getWaitingVehicle(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSLane::handleCollision(), NBEdgeCont::ignoreFilterMatch(), MSRailSignal::init(), MSActuatedTrafficLightLogic::init(), MSTrafficLightLogic::init(), PedestrianEdge< E, L, N >::initPedestrianNetwork(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBNodeCont::insert(), NBTrafficLightLogicCont::insert(), NBEdgeCont::insert(), MSEdge::insertVehicle(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), NIImporter_OpenDrive::loadNetwork(), ODDistrictCont::makeDistricts(), MSPModel_Striping::moveInDirection(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSContainer::MSContainerStage_Waiting::MSContainerStage_Waiting(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTsender::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSDevice_BTreceiver::notifyEnter(), MSDevice_Example::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Container::notifyLeave(), MSDevice_Person::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTsender::notifyMove(), MSDevice_BTreceiver::notifyMove(), GUIViewTraffic::onGamingClick(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_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_Person::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(), NBTrafficLightLogicCont::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap(), MSLCM_JE2013::wantsChange(), 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(), SUMO::Polygon::writeXML(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

unsigned int MSOffTrafficLightLogic::getIndexFromOffset ( SUMOTime  offset) const
virtual

Returns the step (the phasenumber) of a given position of the cycle.

Parameters
[in]offsetThe offset (time) for which the according phase shall be returned
Returns
The according phase
See also
MSTrafficLightLogic::getIndexFromOffset

Implements MSTrafficLightLogic.

Definition at line 137 of file MSOffTrafficLightLogic.cpp.

const LaneVector& MSTrafficLightLogic::getLanesAt ( unsigned int  i) const
inlineinherited

Returns the list of lanes that are controlled by the signals at the given position.

Parameters
[in]iThe index of the signal
Returns
The lanes controlled by the signal at the given index

Definition at line 191 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myEmptyLaneVector, and MSTrafficLightLogic::myLanes.

Referenced by GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSSwitches::execute(), MSActuatedTrafficLightLogic::gapControl(), and GUIViewTraffic::onGamingClick().

const LaneVectorVector& MSTrafficLightLogic::getLaneVectors ( ) const
inlineinherited

Returns the list of lists of all lanes controlled by this tls.

Returns
All lanes controlled by this tls, sorted by the signal index

Definition at line 182 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myLanes.

Referenced by GUITrafficLightLogicWrapper::getCenteringBoundary(), TraCIServerAPI_TLS::processGet(), and MSFullExport::writeTLS().

int MSTrafficLightLogic::getLinkIndex ( const MSLink *const  link) const
inherited

Returns the index of the given link.

Parameters
[in]linkThe link to retrieve the index for
Returns
The index of the given link (-1 if it is not controlled by this tls)

Definition at line 230 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myLinks.

Referenced by GUITrafficLightLogicWrapper::getLinkIndex().

const LinkVectorVector& MSTrafficLightLogic::getLinks ( ) const
inlineinherited
const LinkVector& MSTrafficLightLogic::getLinksAt ( unsigned int  i) const
inlineinherited

Returns the list of links that are controlled by the signals at the given position.

Parameters
[in]iThe index of the signal
Returns
The links controlled by the signal at the given index

Definition at line 212 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myLinks.

const std::string MSOffTrafficLightLogic::getLogicType ( ) const
inlinevirtual

Returns the type of the logic as a string.

Returns
The type of the logic

Implements MSTrafficLightLogic.

Definition at line 128 of file MSOffTrafficLightLogic.h.

const std::map<std::string, std::string>& Parameterised::getMap ( ) const
inlineinherited
SUMOTime MSTrafficLightLogic::getNextSwitchTime ( ) const
inherited

Returns the assumed next switch time.

The time may change in case of adaptive/actuated traffic lights.

Returns
The assumed next switch time (simulation time)

Definition at line 247 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::SwitchCommand::getNextSwitchTime(), and MSTrafficLightLogic::mySwitchCommand.

Referenced by MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), and TraCIServerAPI_TLS::processGet().

SUMOTime MSOffTrafficLightLogic::getOffsetFromIndex ( unsigned int  index) const
virtual

Returns the position (start of a phase during a cycle) from of a given step.

Parameters
[in]indexThe index of the phase to return the begin of
Returns
The begin time of the phase
See also
MSTrafficLightLogic::getOffsetFromIndex

Implements MSTrafficLightLogic.

Definition at line 131 of file MSOffTrafficLightLogic.cpp.

const MSPhaseDefinition & MSOffTrafficLightLogic::getPhase ( unsigned int  givenstep) const
virtual

Returns the definition of the phase from the given position within the plan.

Parameters
[in]givenstepThe index of the phase within the plan
Returns
The definition of the phase at the given position
See also
MSTrafficLightLogic::getPhase

Implements MSTrafficLightLogic.

Definition at line 105 of file MSOffTrafficLightLogic.cpp.

References myPhaseDefinition.

SUMOTime MSOffTrafficLightLogic::getPhaseIndexAtTime ( SUMOTime  simStep) const
virtual

Returns the index of the logic at the given simulation step.

Returns
The (estimated) index of the tls at the given simulation time step
See also
MSTrafficLightLogic::getPhaseIndexAtTime

Implements MSTrafficLightLogic.

Definition at line 125 of file MSOffTrafficLightLogic.cpp.

unsigned int MSOffTrafficLightLogic::getPhaseNumber ( ) const
virtual

Returns the number of phases.

Returns
The number of this tls program's phases
See also
MSTrafficLightLogic::getPhaseNumber

Implements MSTrafficLightLogic.

Definition at line 93 of file MSOffTrafficLightLogic.cpp.

const MSOffTrafficLightLogic::Phases & MSOffTrafficLightLogic::getPhases ( ) const
virtual

Returns the phases of this tls program.

Returns
The phases of this tls program
See also
MSTrafficLightLogic::getPhases

Implements MSTrafficLightLogic.

Definition at line 99 of file MSOffTrafficLightLogic.cpp.

References myPhaseDefinition.

const std::string& MSTrafficLightLogic::getProgramID ( ) const
inlineinherited
void MSOffTrafficLightLogic::init ( NLDetectorBuilder nb)
virtual

Initialises the tls with information about incoming lanes.

Parameters
[in]nbThe detector builder
[in]edgeContinuationsInformation about edge predecessors/successors

Reimplemented from MSTrafficLightLogic.

Definition at line 62 of file MSOffTrafficLightLogic.cpp.

References rebuildPhase().

bool Parameterised::knowsParameter ( const std::string &  key) const
inherited

Returns whether the parameter is known.

Parameters
[in]keyThe key to ask for
Returns
Whether the key is known

Definition at line 75 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by MSDevice_Example::buildVehicleDevices(), and MSDevice::equippedByDefaultAssignmentOptions().

void MSOffTrafficLightLogic::rebuildPhase ( )
private

(Re)builds the internal phase definition

Definition at line 76 of file MSOffTrafficLightLogic.cpp.

References MSTrafficLightLogic::getLinks(), myPhaseDefinition, and TIME2STEPS.

Referenced by adaptLinkInformationFrom(), and init().

void MSTrafficLightLogic::resetLinkStates ( const std::map< MSLink *, LinkState > &  vals) const
inherited

Resets the states of controlled links.

Parameters
[in]valsThe state of controlled links to use

Definition at line 217 of file MSTrafficLightLogic.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), and MSTrafficLightLogic::myLinks.

void MSTrafficLightLogic::setCurrentDurationIncrement ( SUMOTime  delay)
inherited

Delays current phase by the given delay.

Parameters
[in]delayThe time by which the current phase shall be delayed

Definition at line 260 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myCurrentDurationIncrement.

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().

bool MSTrafficLightLogic::setTrafficLightSignals ( SUMOTime  t) const
inherited

Applies the current signal states to controlled links.

Parameters
[in]tThe current time
Returns
Always true
See also
LinkState
MSLink::setTLState

Definition at line 201 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::getCurrentPhaseDef(), MSPhaseDefinition::getState(), and MSTrafficLightLogic::myLinks.

Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSRailSignal::init(), and MSRailSignal::trySwitch().

SUMOTime MSOffTrafficLightLogic::trySwitch ( )
inlinevirtual

Switches to the next phase.

Returns
The time of the next switch (always 120)
See also
MSTrafficLightLogic::trySwitch

Implements MSTrafficLightLogic.

Definition at line 94 of file MSOffTrafficLightLogic.h.

References DELTA_T.

Field Documentation

SUMOTime MSTrafficLightLogic::myCurrentDurationIncrement
protectedinherited

A value for enlarge the current duration.

Definition at line 411 of file MSTrafficLightLogic.h.

Referenced by MSTrafficLightLogic::setCurrentDurationIncrement(), and MSSimpleTrafficLightLogic::trySwitch().

const MSTrafficLightLogic::LaneVector MSTrafficLightLogic::myEmptyLaneVector
staticprotectedinherited

An empty lane vector.

Definition at line 420 of file MSTrafficLightLogic.h.

Referenced by MSTrafficLightLogic::getLanesAt().

LaneVectorVector MSTrafficLightLogic::myLanes
protectedinherited
std::vector<SUMOTime> MSTrafficLightLogic::myOverridingTimes
protectedinherited

A list of duration overrides.

Definition at line 408 of file MSTrafficLightLogic.h.

Referenced by MSTrafficLightLogic::addOverridingDuration(), and MSSimpleTrafficLightLogic::trySwitch().

MSTrafficLightLogic::Phases MSOffTrafficLightLogic::myPhaseDefinition
private

The phase definition (only one)

Definition at line 209 of file MSOffTrafficLightLogic.h.

Referenced by getCurrentPhaseDef(), getPhase(), getPhases(), rebuildPhase(), and ~MSOffTrafficLightLogic().

std::string MSTrafficLightLogic::myProgramID
protectedinherited

The id of the logic.

Definition at line 399 of file MSTrafficLightLogic.h.

Referenced by MSTrafficLightLogic::getProgramID(), and MSActuatedTrafficLightLogic::init().

SwitchCommand* MSTrafficLightLogic::mySwitchCommand
protectedinherited

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