![]() |
SUMO - Simulation of Urban MObility
|
A signal for rails. More...
#include <MSRailSignal.h>
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< LinkVector > | LinkVectorVector |
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< LaneVector > | LaneVectorVector |
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... | |
void | init (NLDetectorBuilder &nb) |
Initialises the rail signal with information about adjacent rail signals. More... | |
bool | knowsParameter (const std::string &key) const |
Returns whether the parameter is known. More... | |
MSRailSignal (MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const std::map< std::string, std::string > ¶meters) | |
Constructor. More... | |
void | setID (const std::string &newID) |
resets the id More... | |
~MSRailSignal () | |
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 | |
std::string | getAppropriateState () |
returns the state of the signal that actually required More... | |
void | updateCurrentPhase () |
updates the current phase of the signal More... | |
SUMOTime | trySwitch () |
Switches to the next phase. More... | |
Static Information Retrieval | |
unsigned int | getPhaseNumber () const |
Returns the number of phases. More... | |
const Phases & | getPhases () const |
Returns the phases of this tls program. More... | |
const MSPhaseDefinition & | getPhase (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 MSPhaseDefinition & | getCurrentPhaseDef () 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 *, LinkState > | collectLinkStates () 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 LaneVectorVector & | getLaneVectors () const |
Returns the list of lists of all lanes controlled by this tls. More... | |
const LaneVector & | getLanesAt (unsigned int i) const |
Returns the list of lanes that are controlled by the signals at the given position. More... | |
const LinkVectorVector & | getLinks () const |
Returns the list of lists of all affected links. More... | |
const LinkVector & | getLinksAt (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... | |
Static Public Member Functions | |
template<class T > | |
static std::string | getIDSecure (const T *obj, const std::string &fallBack="NULL") |
get an identifier for Named-like object which may be Null More... | |
Protected Attributes | |
std::map< MSLink *, std::vector< MSLane * > > | myAfferentBlocks |
A map that maps a link from the junction to its vector of lanes leading from a previous signal to this link. More... | |
SUMOTime | myCurrentDurationIncrement |
A value for enlarge the current duration. More... | |
MSPhaseDefinition | myCurrentPhase |
The current phase. 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... | |
std::map< MSLink *, unsigned int > | myLinkIndices |
A map that maps a link to its link index. More... | |
LinkVectorVector | myLinks |
The list of LinkVectors; each vector contains the links that belong to the same link index. More... | |
std::map< MSLane *, std::vector< MSLink * > > | myLinksToLane |
A map that maps an outgoing lane from the junction to its set of links that lead to this lane. More... | |
std::vector< MSLane * > | myOutgoingLanes |
The set of lanes going out from the junction. More... | |
std::vector< SUMOTime > | myOverridingTimes |
A list of duration overrides. More... | |
Phases | myPhases |
The list of phases this logic uses. More... | |
std::string | myProgramID |
The id of the logic. More... | |
std::map< MSLane *, std::vector< const MSLane * > > | mySucceedingBlocks |
A map that maps an outgoing lane from the junction to its vector of lanes leading to the next signal. More... | |
SwitchCommand * | mySwitchCommand |
The current switch command. More... | |
Static Protected Attributes | |
static const LaneVector | myEmptyLaneVector |
An empty lane vector. More... | |
A signal for rails.
Definition at line 54 of file MSRailSignal.h.
|
inherited |
Definition of the list of links that participate in this tl-light.
Definition at line 78 of file MSTrafficLightLogic.h.
|
inherited |
Definition of a list that holds lists of links that do have the same attribute.
Definition at line 81 of file MSTrafficLightLogic.h.
|
inherited |
Definition of the list of links that participate in this tl-light.
Definition at line 72 of file MSTrafficLightLogic.h.
|
inherited |
Definition of a list that holds lists of links that do have the same attribute.
Definition at line 75 of file MSTrafficLightLogic.h.
|
inherited |
Definition of a list of phases, being the junction logic.
Definition at line 69 of file MSTrafficLightLogic.h.
MSRailSignal::MSRailSignal | ( | MSTLLogicControl & | tlcontrol, |
const std::string & | id, | ||
const std::string & | subid, | ||
const std::map< std::string, std::string > & | parameters | ||
) |
Constructor.
[in] | tlcontrol | The tls control responsible for this tls |
[in] | id | This tls' id |
[in] | subid | This tls' sub-id (program id) |
[in] | parameters | This tls' parameters |
Definition at line 54 of file MSRailSignal.cpp.
References DELTA_T, and MSTrafficLightLogic::myDefaultCycleTime.
MSRailSignal::~MSRailSignal | ( | ) |
Destructor.
Definition at line 149 of file MSRailSignal.cpp.
|
virtual |
Applies information about controlled links and lanes from the given logic.
[in] | logic | The logic to use the information about controlled links/lanes from |
Reimplemented from MSTrafficLightLogic.
Definition at line 154 of file MSRailSignal.cpp.
References MSTrafficLightLogic::adaptLinkInformationFrom(), and updateCurrentPhase().
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 183 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::getCurrentPhaseDef(), MSNet::getInstance(), MSTrafficLightLogic::myLanes, MSTrafficLightLogic::myLinks, and MSLink::setTLState().
|
inherited |
Changes the duration of the next phase.
[in] | duration | The new duration |
Definition at line 274 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::myOverridingTimes.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), MSTrafficLightLogic::getDefaultCycleTime(), and MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic().
|
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 SUMORouteHandler::addParam(), NLHandler::addParam(), PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NBTrafficLightDefinition::compute(), NIImporter_OpenDrive::loadNetwork(), NIImporter_MATSim::EdgesHandler::myStartElement(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_Lane::processSet().
|
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.
Definition at line 126 of file Named.h.
References Named::StoringVisitor::add().
|
inlinevirtual |
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 |
Implements MSTrafficLightLogic.
Definition at line 202 of file MSRailSignal.h.
References UNUSED_PARAMETER.
|
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 208 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::myLinks.
Referenced by MSTLLogicControl::TLSLogicVariants::saveInitialStates().
std::string MSRailSignal::getAppropriateState | ( | ) |
returns the state of the signal that actually required
Returns the state of the rail signal that is actually required based on the occupation of the adjoining blocks.
Definition at line 169 of file MSRailSignal.cpp.
References myAfferentBlocks, myLinkIndices, MSTrafficLightLogic::myLinks, myLinksToLane, myOutgoingLanes, and mySucceedingBlocks.
Referenced by updateCurrentPhase().
|
virtual |
Returns the definition of the current phase.
Implements MSTrafficLightLogic.
Definition at line 257 of file MSRailSignal.cpp.
References myCurrentPhase.
Referenced by getLogicType().
|
virtual |
Returns the current index within the program.
Implements MSTrafficLightLogic.
Definition at line 252 of file MSRailSignal.cpp.
Referenced by getLogicType().
|
inlineinherited |
Returns the cycle time (in ms)
Definition at line 268 of file MSTrafficLightLogic.h.
References MSTrafficLightLogic::addOverridingDuration(), MSTrafficLightLogic::changeStepAndDuration(), MSTrafficLightLogic::getIndexFromOffset(), MSTrafficLightLogic::getNextSwitchTime(), MSTrafficLightLogic::getOffsetFromIndex(), MSTrafficLightLogic::getPhaseIndexAtTime(), MSTrafficLightLogic::myDefaultCycleTime, and MSTrafficLightLogic::setCurrentDurationIncrement().
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), NLJunctionControlBuilder::closeTrafficLightLogic(), and MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP().
|
inlineinherited |
Returns the id.
Definition at line 65 of file Named.h.
References Named::myID.
Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), MSDetectorControl::add(), Named::StoringVisitor::add(), RORouteDef::addAlternative(), MSLane::addApproachingLane(), MSNet::addBusStop(), MSNet::addChargingStation(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), MSNet::addContainerStop(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), GUIEdge::addRerouter(), NBEdge::addRestrictedLane(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NIXMLEdgesHandler::addSplit(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), MSVehicle::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciBusOrContainerStop(), 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(), NBNode::buildCrossingsAndWalkingAreas(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), GNEConnector::buildIinternalLanes(), GNETLSEditor::buildIinternalLanes(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBNode::buildWalkingAreas(), MSBaseVehicle::calculateArrivalParams(), 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(), 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(), MSTrafficLightLogic::SwitchCommand::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), NBRampsComputer::fulfillsRampConstraints(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), MSNet::getChargingStationID(), NBEdge::getConnection(), MSNet::getContainerStopID(), NBEdge::getCrossingAngle(), GNEEdge::getDest(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), PedestrianEdge< E, L, N >::getEffort(), NBEdge::getFirstNonPedestrianLane(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPerson::getNextEdge(), MSPModel_Striping::getNextLane(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUI_E2_ZS_Collector::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), GNEEdge::getSource(), MSVehicleControl::getWaitingVehicle(), MSLink::getZipperSpeed(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSLane::handleCollision(), NBEdgeCont::ignoreFilterMatch(), 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(), GNEJunction::invalidateTLS(), 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(), MSPModel_Striping::moveInDirectionOnLane(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSChargingStation::MSChargingStation(), MSDevice_Battery::MSDevice_Battery(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTsender::notifyEnter(), MSDevice_BTreceiver::notifyEnter(), MSDevice_Example::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Container::notifyLeave(), MSDevice_Person::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTsender::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSMeanData::MeanDataValues::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()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_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(), MSRouteHandler::parseWalkPositions(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_JE2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSRightOfWayJunction::postloadInit(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_ArealDetector::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processSet(), NIXMLNodesHandler::processTrafficLightDefinitions(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNodeCont::removeIsolatedRoads(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), GNENet::renameEdge(), GNENet::renameJunction(), RORouteDef::repairCurrentRoute(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), MSDevice_Battery::setActualBatteryCapacity(), MSDevice_Battery::setAirDragCoefficient(), NBNodeCont::setAsTLControlled(), MSChargingStation::setChrgPower(), MSDevice_Battery::setConstantPowerIntake(), NBEdge::setControllingTLInformation(), MSChargingStation::setEfficency(), MSDevice_Battery::setFrontSurfaceArea(), MSDevice_Battery::setInternalMomentOfInertia(), GNEJunction::setLogicValid(), MSDevice_Battery::setMass(), MSDevice_Battery::setMaximumBatteryCapacity(), NIXMLEdgesHandler::setNodes(), MSDevice_Battery::setPowerMax(), MSDevice_Battery::setPropulsionEfficiency(), MSDevice_Battery::setRadialDragCoefficient(), MSDevice_Battery::setRecuperationEfficiency(), MSLink::setRequestInformation(), MSDevice_Battery::setRollDragCoefficient(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBTrafficLightLogicCont::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), GNETLSEditor::updateDescription(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap(), TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(), MSPModel_Striping::PState::walk(), MSLCM_JE2013::wantsChange(), MSBatteryExport::write(), 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(), writeInterval(), 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(), PointOfInterest::writeXML(), SUMO::Polygon::writeXML(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().
|
inlinestaticinherited |
|
virtual |
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 |
Implements MSTrafficLightLogic.
Definition at line 273 of file MSRailSignal.cpp.
Referenced by getLogicType().
|
inlineinherited |
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 MSTrafficLightLogic::myEmptyLaneVector, and MSTrafficLightLogic::myLanes.
Referenced by GUITrafficLightLogicWrapper::drawGL(), Command_SaveTLSSwitches::execute(), MSActuatedTrafficLightLogic::gapControl(), and GUIViewTraffic::onGamingClick().
|
inlineinherited |
Returns the list of lists of all lanes controlled by this tls.
Definition at line 182 of file MSTrafficLightLogic.h.
References MSTrafficLightLogic::myLanes.
Referenced by GUITrafficLightLogicWrapper::getCenteringBoundary(), TraCIServerAPI_TLS::processGet(), and MSFullExport::writeTLS().
|
inherited |
Returns the index of the given link.
[in] | link | The link to retrieve the index for |
Definition at line 250 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::myLinks.
Referenced by GUITrafficLightLogicWrapper::getLinkIndex(), and MSTrafficLightLogic::getLinksAt().
|
inlineinherited |
Returns the list of lists of all affected links.
Definition at line 203 of file MSTrafficLightLogic.h.
References MSTrafficLightLogic::myLinks.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), GUINet::createTLWrapper(), GUITLLogicPhasesTrackerWindow::drawValues(), Command_SaveTLSSwitches::execute(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), TraCIServerAPI_TLS::processGet(), and MSOffTrafficLightLogic::rebuildPhase().
|
inlineinherited |
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 212 of file MSTrafficLightLogic.h.
References MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getLinkIndex(), MSTrafficLightLogic::getLogicType(), MSTrafficLightLogic::getPhase(), MSTrafficLightLogic::getPhaseNumber(), MSTrafficLightLogic::getPhases(), and MSTrafficLightLogic::myLinks.
|
inlinevirtual |
Returns the type of the logic as a string.
Implements MSTrafficLightLogic.
Definition at line 142 of file MSRailSignal.h.
References getCurrentPhaseDef(), getCurrentPhaseIndex(), getIndexFromOffset(), getOffsetFromIndex(), and getPhaseIndexAtTime().
|
inlineinherited |
Returns the inner key/value map.
Definition at line 107 of file Parameterised.h.
References Parameterised::myMap.
Referenced by NBTrafficLightDefinition::compute(), GUIPerson::getParameterWindow(), GUIVehicle::getParameterWindow(), TraCIServerAPI_TLS::processGet(), ROVehicle::saveAllAsXML(), SUMOVTypeParameter::write(), PointOfInterest::writeXML(), and SUMO::Polygon::writeXML().
|
inherited |
Returns the assumed next switch time.
The time may change in case of adaptive/actuated traffic lights.
Definition at line 267 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::SwitchCommand::getNextSwitchTime(), and MSTrafficLightLogic::mySwitchCommand.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTrafficLightLogic::getDefaultCycleTime(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), and TraCIServerAPI_TLS::processGet().
|
virtual |
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 |
Implements MSTrafficLightLogic.
Definition at line 268 of file MSRailSignal.cpp.
Referenced by getLogicType().
|
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 MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), MSDevice_Example::buildVehicleDevices(), MSDevice_Battery::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Lane::processGet(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and TraCIServerAPI_Vehicle::vtdMap().
|
virtual |
Returns the definition of the phase from the given position within the plan.
Returns the current phase as there does not exist a plan of the phases.
[in] | givenstep | The index of the phase within the plan |
Implements MSTrafficLightLogic.
Definition at line 246 of file MSRailSignal.cpp.
References myCurrentPhase.
Returns the index of the logic at the given simulation step.
Implements MSTrafficLightLogic.
Definition at line 263 of file MSRailSignal.cpp.
Referenced by getLogicType().
|
virtual |
Returns the number of phases.
Implements MSTrafficLightLogic.
Definition at line 236 of file MSRailSignal.cpp.
|
virtual |
Returns the phases of this tls program.
Implements MSTrafficLightLogic.
Definition at line 241 of file MSRailSignal.cpp.
References myPhases.
|
inlineinherited |
Returns this tl-logic's id.
Definition at line 174 of file MSTrafficLightLogic.h.
References MSTrafficLightLogic::myProgramID.
Referenced by Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSTrafficLightLogic::init(), GUIViewTraffic::onGamingClick(), and TraCIServerAPI_TLS::processGet().
|
virtual |
Initialises the rail signal with information about adjacent rail signals.
[in] | nb | The detector builder |
ProcessError | If something fails on initialisation |
Reimplemented from MSTrafficLightLogic.
Definition at line 63 of file MSRailSignal.cpp.
References MSLink::getApproachingLane(), MSLane::getEdge(), Named::getID(), MSLane::getIncomingLanes(), MSNet::getInstance(), MSLink::getLane(), MSLane::getLinkCont(), MSLane::getOutgoingLanes(), MSEdge::getToJunction(), MSJunction::getType(), myAfferentBlocks, MSTrafficLightLogic::myLanes, myLinkIndices, MSTrafficLightLogic::myLinks, myLinksToLane, myOutgoingLanes, mySucceedingBlocks, NODETYPE_RAIL_SIGNAL, MSTrafficLightLogic::setTrafficLightSignals(), updateCurrentPhase(), and WRITE_WARNING.
|
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(), and MSDevice::equippedByDefaultAssignmentOptions().
|
inherited |
Resets the states of controlled links.
[in] | vals | The state of controlled links to use |
Definition at line 237 of file MSTrafficLightLogic.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), and MSTrafficLightLogic::myLinks.
|
inherited |
Delays current phase by the given delay.
[in] | delay | The time by which the current phase shall be delayed |
Definition at line 280 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::myCurrentDurationIncrement.
Referenced by MSTrafficLightLogic::getDefaultCycleTime().
|
inlineinherited |
resets the id
[in] | newID | The new id of this object |
Definition at line 73 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
|
inherited |
Applies the current signal states to controlled links.
[in] | t | The current time |
Definition at line 221 of file MSTrafficLightLogic.cpp.
References MSTrafficLightLogic::getCurrentPhaseDef(), MSPhaseDefinition::getState(), and MSTrafficLightLogic::myLinks.
Referenced by MSTLLogicControl::TLSLogicVariants::addLogic(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSTrafficLightLogic::SwitchCommand::execute(), init(), MSTLLogicControl::TLSLogicVariants::switchTo(), and trySwitch().
|
virtual |
Switches to the next phase.
Implements MSTrafficLightLogic.
Definition at line 162 of file MSRailSignal.cpp.
References DELTA_T, MSNet::getInstance(), MSTrafficLightLogic::setTrafficLightSignals(), and updateCurrentPhase().
void MSRailSignal::updateCurrentPhase | ( | ) |
updates the current phase of the signal
Definition at line 229 of file MSRailSignal.cpp.
References DELTA_T, getAppropriateState(), and myCurrentPhase.
Referenced by adaptLinkInformationFrom(), init(), and trySwitch().
A map that maps a link from the junction to its vector of lanes leading from a previous signal to this link.
Definition at line 222 of file MSRailSignal.h.
Referenced by getAppropriateState(), and init().
|
protectedinherited |
A value for enlarge the current duration.
Definition at line 411 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::setCurrentDurationIncrement(), and MSSimpleTrafficLightLogic::trySwitch().
|
protected |
The current phase.
Definition at line 237 of file MSRailSignal.h.
Referenced by getCurrentPhaseDef(), getPhase(), and updateCurrentPhase().
|
protectedinherited |
The cycle time (without changes)
Definition at line 417 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::getDefaultCycleTime(), MSSimpleTrafficLightLogic::getIndexFromOffset(), MSSimpleTrafficLightLogic::getPhaseIndexAtTime(), MSOffTrafficLightLogic::MSOffTrafficLightLogic(), MSRailSignal(), and MSSimpleTrafficLightLogic::MSSimpleTrafficLightLogic().
|
staticprotectedinherited |
An empty lane vector.
Definition at line 420 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::getLanesAt().
|
protectedinherited |
The name of the object.
Definition at line 133 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(), MSCalibrator::init(), NBEdge::init(), MSCalibrator::myStartElement(), 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().
|
protectedinherited |
The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index.
Definition at line 405 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::adaptLinkInformationFrom(), MSTrafficLightLogic::addLink(), MSTrafficLightLogic::getLanesAt(), MSTrafficLightLogic::getLaneVectors(), init(), MSActuatedTrafficLightLogic::init(), and MSTrafficLightLogic::init().
|
protected |
A map that maps a link to its link index.
Definition at line 216 of file MSRailSignal.h.
Referenced by getAppropriateState(), and init().
|
protectedinherited |
The list of LinkVectors; each vector contains the links that belong to the same link index.
Definition at line 402 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::adaptLinkInformationFrom(), MSTrafficLightLogic::addLink(), MSTrafficLightLogic::collectLinkStates(), getAppropriateState(), MSTrafficLightLogic::getLinkIndex(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getLinksAt(), init(), MSTrafficLightLogic::resetLinkStates(), and MSTrafficLightLogic::setTrafficLightSignals().
A map that maps an outgoing lane from the junction to its set of links that lead to this lane.
Definition at line 219 of file MSRailSignal.h.
Referenced by getAppropriateState(), and init().
|
protected |
The set of lanes going out from the junction.
Definition at line 213 of file MSRailSignal.h.
Referenced by getAppropriateState(), and init().
|
protectedinherited |
A list of duration overrides.
Definition at line 408 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::addOverridingDuration(), and MSSimpleTrafficLightLogic::trySwitch().
|
protected |
The list of phases this logic uses.
This vector is always empty and only constructed because the superclass MSTrafficLightLogic requires it.
Definition at line 234 of file MSRailSignal.h.
Referenced by getPhases().
|
protectedinherited |
The id of the logic.
Definition at line 399 of file MSTrafficLightLogic.h.
Referenced by MSTrafficLightLogic::getProgramID(), and MSActuatedTrafficLightLogic::init().
A map that maps an outgoing lane from the junction to its vector of lanes leading to the next signal.
Definition at line 225 of file MSRailSignal.h.
Referenced by getAppropriateState(), and init().
|
protectedinherited |
The current switch command.
Definition at line 414 of file MSTrafficLightLogic.h.
Referenced by MSSimpleTrafficLightLogic::changeStepAndDuration(), MSTrafficLightLogic::getNextSwitchTime(), and MSTrafficLightLogic::MSTrafficLightLogic().