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

#include <MSSwarmTrafficLightLogic.h>

Inheritance diagram for MSSwarmTrafficLightLogic:
Inheritance graph
Collaboration diagram for MSSwarmTrafficLightLogic:
Collaboration graph

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 activate (MSSOTLPolicy *policy)
 
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 addPolicy (MSSOTLPolicy *policy)
 
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
void clearParameter ()
 Clears the parameter map. More...
 
SUMOReal getBetaNo ()
 
SUMOReal getBetaSp ()
 
SUMOReal getChangePlanProbability ()
 
MSSOTLPolicygetCurrentPolicy ()
 Returns the low-level policy currently selected by this high-level tll. More...
 
SUMOReal getForgettingCox ()
 
SUMOReal getGammaNo ()
 
SUMOReal getGammaSp ()
 
const std::string & getID () const
 Returns the id. More...
 
SUMOReal getLearningCox ()
 
const std::string getLogicType () const
 Returns the type of the logic as a string. More...
 
const std::map< std::string,
std::string > & 
getMap () const
 Returns the inner key/value map. More...
 
SUMOTime getMaxCongestionDuration ()
 
const std::string & getParameter (const std::string &key, const std::string &defaultValue) const
 Returns the value for a given key. More...
 
SUMOReal getPheroMaxVal ()
 
std::vector< MSSOTLPolicy * > & getPolicies ()
 Returns the vector of the low-level policies used by this high-level tll. More...
 
SUMOReal getScaleFactorDispersionIn ()
 
SUMOReal getScaleFactorDispersionOut ()
 
SUMOReal getThetaInit ()
 
SUMOReal getThetaMax ()
 
SUMOReal getThetaMin ()
 
void init (NLDetectorBuilder &nb) throw (ProcessError)
 Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation according to the type of sensor specified in the simulation parameter. More...
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
 MSSwarmTrafficLightLogic (MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const Phases &phases, int step, SUMOTime delay, const std::map< std::string, std::string > &parameters)
 Constructor without sensors passed. More...
 
void setID (const std::string &newID)
 resets the id More...
 
void setPhases (const Phases &phases, int index)
 Replaces the phases and set the phase index. More...
 
SUMOTime trySwitch ()
 Switches to the next phase. More...
 
 ~MSSwarmTrafficLightLogic ()
 
Static Information Retrieval

Switches to the next phase

Parameters
[in]isActiveWhether this program is the currently used one
Returns
The time of the next switch
See also
MSTrafficLightLogic::trySwitch
int getPhaseNumber () const
 Returns the number of phases. More...
 
const PhasesgetPhases () const
 Returns the phases of this tls program. More...
 
const MSPhaseDefinitiongetPhase (int givenstep) const
 Returns the definition of the phase from the given position within the plan. More...
 
Dynamic Information Retrieval
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 (int index) const
 Returns the position (start of a phase during a cycle) from of a given step. More...
 
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, int step, SUMOTime stepDuration)
 Changes the current phase and her duration. More...
 
Handling of controlled links
virtual void addLink (MSLink *link, MSLane *lane, int pos)
 Adds a link on building. More...
 
virtual void adaptLinkInformationFrom (const MSTrafficLightLogic &logic)
 Applies information about controlled links and lanes from the given logic. 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 (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 (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 Types

typedef std::map< const
std::string, std::vector
< MSPushButton * > > 
PhasePushButtons
 

Protected Member Functions

bool allowLine (MSLane *)
 Check if a lane is allowed to be added to the maps pheromoneInputLanes and pheromoneOutputLanes Control in this function if the lane is a walking area, a crossing, or if only pedestrian are allowed. Return true if the lane has to be added, false otherwise. More...
 
SUMOReal calculateEtaDiff ()
 Method that should calculate the valor of eta a coefficient to evaluate the current policy's work. This eta is based on the difference between the number of vehicles that enters a tl and the ones that exit it. It consider vehicles on a lane with a tl set to red as well to determinate policy work. More...
 
SUMOReal calculateEtaRatio ()
 
SUMOReal calculatePhi (int factor)
 Method that should calculate the valor of phi a coefficient to amplify/attenuate eta based on a factor. The factor depends on the situation when the function is called; should be the number of cars in the target lanes or the number of cars in the lanes with a red tl. More...
 
bool canRelease ()
 
void choosePolicy (SUMOReal phero_in, SUMOReal phero_out, SUMOReal dispersion_in, SUMOReal dispersion_out)
 
void choosePolicy (SUMOReal phero_in, SUMOReal phero_out)
 
virtual SUMOTime computeReturnTime ()
 
int countVehicles (MSPhaseDefinition phase)
 
int decideNextPhase ()
 
void decidePolicy ()
 Decide the current policy according to pheromone levels The decision reflects on currentPolicy value. More...
 
MSSOTLE2SensorsgetCountSensors ()
 Return the sensors that count the passage of vehicles in and out of the tl. More...
 
SUMOTime getCurrentPhaseElapsed ()
 
SUMOReal getDispersionForInputLanes (SUMOReal average_phero_in)
 
SUMOReal getDispersionForOutputLanes (SUMOReal average_phero_out)
 
SUMOReal getDistanceOfMaxPheroForInputLanes ()
 
SUMOReal getDistanceOfMaxPheroForOutputLanes ()
 
SUMOReal getInputSensorsLength ()
 
std::string getLaneLightState (const std::string &laneId)
 
SUMOReal getOutputSensorsLength ()
 
int getPhaseIndexWithMaxCTS ()
 
SUMOReal getPheromoneForInputLanes ()
 
SUMOReal getPheromoneForOutputLanes ()
 
std::string getPoliciesParam ()
 
int getReinforcementMode ()
 
MSSOTLSensorsgetSensors ()
 
SUMOReal getSpeedThreshold ()
 
int getThreshold ()
 
void initScaleFactorDispersionIn (int lanes_in)
 
void initScaleFactorDispersionOut (int lanes_out)
 
bool isPushButtonPressed ()
 
bool isThresholdPassed ()
 
void logStatus ()
 
void proceedToNextStep ()
 Proceed to the next step. More...
 
void resetLaneCheck ()
 
void resetPheromone ()
 Resets pheromone levels. More...
 
void setStep (int step)
 Forces a specific step. More...
 
void updatePheromoneLevels ()
 Update pheromone levels Pheromone on input lanes is costantly updated Pheromone follows a discrete-time dynamic law "pheromone(k+1) = beta*pheromone(k) + gamma * sensed_val(k)". More...
 
void updatePheromoneLevels (MSLaneId_PheromoneMap &, std::string, const SUMOReal, const SUMOReal)
 Utility method to avoid code duplication. More...
 
void updateSensitivities ()
 

Protected Attributes

int carsIn
 
int carsOut
 
SUMOTime congestion_steps
 
bool gotTargetLane
 When true indicates that we've already acquired the target lanes for this particular phase. More...
 
int inTarget
 
LaneCheckMap laneCheck
 Map to check if a lane was already controlled during the elaboration of eta. More...
 
SUMOTime lastThetaSensitivityUpdate
 
bool logData
 
SUMOReal m_derivativeAlpha
 
std::map< std::string,
CircularBuffer< SUMOReal > * > 
m_derivativeHistory
 
std::map< std::string,
std::vector< int > > 
m_laneIndexMap
 
int m_losCounter
 
int m_losMaxLimit
 
std::map< std::string,
CircularBuffer< SUMOReal > * > 
m_meanSpeedHistory
 
std::map< std::string,
std::string > 
m_pheroLevelLog
 
PhasePushButtons m_pushButtons
 
bool m_useVehicleTypesWeights
 
bool mustChange
 When true, indicates that the current policy MUST be changed.
It's used to force the exit from the congestion policy. More...
 
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...
 
Phases myPhases
 The list of phases this logic uses. More...
 
std::string myProgramID
 The id of the logic. More...
 
int myStep
 The current step. More...
 
SwitchCommandmySwitchCommand
 The current switch command. More...
 
int notTarget
 
MSLaneId_PheromoneMap pheromoneInputLanes
 This pheronome is an indicator of congestion on input lanes.
Its levels refer to the average speed of vehicles passing the input lane: the lower the speed the higher the pheromone.
These levels are updated on every input lane, independently on lights state. More...
 
MSLaneId_PheromoneMap pheromoneOutputLanes
 This pheromone is an indicator of congestion on output lanes.
Its levels refer to the average speed of vehicles passing the output lane: the lower the speed the higher the pheromone.
These levels are updated on every output lane, independently on lights state. More...
 
SUMOReal scaleFactorDispersionIn
 
SUMOReal scaleFactorDispersionOut
 
bool skipEta
 When true indicates that we can skip the evaluation of eta since we've a congestion policy that is lasting too much. More...
 
std::ofstream swarmLogFile
 
LaneIdVector targetLanes
 A copy of the target lanes of this phase. More...
 

Static Protected Attributes

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

Detailed Description

Definition at line 108 of file MSSwarmTrafficLightLogic.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::map<const std::string, std::vector<MSPushButton*> > MSSOTLTrafficLightLogic::PhasePushButtons
protectedinherited

Definition at line 122 of file MSSOTLTrafficLightLogic.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

MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic ( MSTLLogicControl tlcontrol,
const std::string &  id,
const std::string &  subid,
const Phases phases,
int  step,
SUMOTime  delay,
const std::map< std::string, std::string > &  parameters 
)

Constructor without sensors passed.

Parameters
[in]tlcontrolThe tls control responsible for this tls
[in]idThis tls' id
[in]subidThis tls' sub-id (program id)
[in]phasesDefinitions of the phases
[in]stepThe initial phase index
[in]delayThe time to wait before the first switch
[in]parametersParameters defined for the tll

Definition at line 31 of file MSSwarmTrafficLightLogic.cpp.

References MSSOTLHiLevelTrafficLightLogic::addPolicy(), congestion_steps, DBG, MSSOTLPolicy::getDesirabilityAlgorithm(), MSSOTLPolicyDesirability::getMessage(), MSSOTLPolicy::getName(), Parameterised::getParameter(), MSSOTLHiLevelTrafficLightLogic::getPolicies(), getPoliciesParam(), MSSOTLPolicy::getThetaSensitivity(), gotTargetLane, m_useVehicleTypesWeights, mustChange, MSSOTLHiLevelTrafficLightLogic::policies, skipEta, WRITE_ERROR, and WRITE_MESSAGE.

MSSwarmTrafficLightLogic::~MSSwarmTrafficLightLogic ( )

Member Function Documentation

void MSSOTLHiLevelTrafficLightLogic::activate ( MSSOTLPolicy policy)
inherited
void MSTrafficLightLogic::adaptLinkInformationFrom ( const MSTrafficLightLogic logic)
virtualinherited

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.

Parameters
[in]logicThe logic to use the information about controlled links/lanes from

Reimplemented in MSRailSignal, MSRailCrossing, and MSOffTrafficLightLogic.

Definition at line 205 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myLanes, and MSTrafficLightLogic::myLinks.

Referenced by MSOffTrafficLightLogic::adaptLinkInformationFrom(), MSRailCrossing::adaptLinkInformationFrom(), MSRailSignal::adaptLinkInformationFrom(), and MSTLLogicControl::TLSLogicVariants::addLogic().

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

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

Reimplemented in MSRailCrossing.

Definition at line 187 of file MSTrafficLightLogic.cpp.

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

Referenced by MSRailCrossing::addLink().

void MSTrafficLightLogic::addOverridingDuration ( SUMOTime  duration)
inherited

Changes the duration of the next phase.

Parameters
[in]durationThe new duration

Definition at line 278 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 MSSOTLHiLevelTrafficLightLogic::addPolicy ( MSSOTLPolicy policy)
inherited
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 129 of file Named.h.

References Named::StoringVisitor::add().

bool MSSwarmTrafficLightLogic::allowLine ( MSLane lane)
protected

Check if a lane is allowed to be added to the maps pheromoneInputLanes and pheromoneOutputLanes Control in this function if the lane is a walking area, a crossing, or if only pedestrian are allowed. Return true if the lane has to be added, false otherwise.

Definition at line 94 of file MSSwarmTrafficLightLogic.cpp.

References MSLane::getEdge(), MSLane::getPermissions(), MSEdge::isCrossing(), MSEdge::isWalkingArea(), SVC_BICYCLE, and SVC_PEDESTRIAN.

SUMOReal MSSwarmTrafficLightLogic::calculateEtaDiff ( )
protected

Method that should calculate the valor of eta a coefficient to evaluate the current policy's work. This eta is based on the difference between the number of vehicles that enters a tl and the ones that exit it. It consider vehicles on a lane with a tl set to red as well to determinate policy work.

Definition at line 683 of file MSSwarmTrafficLightLogic.cpp.

References calculatePhi(), carsIn, carsOut, DBG, MSSOTLTrafficLightLogic::getCountSensors(), MSSOTLHiLevelTrafficLightLogic::getCurrentPolicy(), Named::getID(), MSNet::getInstance(), MSSOTLPolicy::getName(), MSSOTLE2Sensors::getPassedVeh(), inTarget, laneCheck, min, MSTrafficLightLogic::myLanes, notTarget, resetLaneCheck(), MSSOTLE2Sensors::subtractPassedVeh(), SUMOReal, targetLanes, time2string(), and WRITE_MESSAGE.

Referenced by updateSensitivities().

SUMOReal MSSwarmTrafficLightLogic::calculatePhi ( int  factor)
protected

Method that should calculate the valor of phi a coefficient to amplify/attenuate eta based on a factor. The factor depends on the situation when the function is called; should be the number of cars in the target lanes or the number of cars in the lanes with a red tl.

Parameters
[in]factor- the value to consider to compute this coefficient.

Definition at line 672 of file MSSwarmTrafficLightLogic.cpp.

References SUMOReal.

Referenced by calculateEtaDiff(), and calculateEtaRatio().

void MSPhasedTrafficLightLogic::changeStepAndDuration ( MSTLLogicControl tlcontrol,
SUMOTime  simStep,
int  step,
SUMOTime  stepDuration 
)
virtualinherited

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 195 of file MSPhasedTrafficLightLogic.cpp.

References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), MSTrafficLightLogic::SwitchCommand::deschedule(), MSNet::getBeginOfTimestepEvents(), MSNet::getInstance(), MSPhasedTrafficLightLogic::myStep, and MSTrafficLightLogic::mySwitchCommand.

void MSSwarmTrafficLightLogic::choosePolicy ( SUMOReal  phero_in,
SUMOReal  phero_out,
SUMOReal  dispersion_in,
SUMOReal  dispersion_out 
)
protected
void MSSwarmTrafficLightLogic::choosePolicy ( SUMOReal  phero_in,
SUMOReal  phero_out 
)
protected

Definition at line 1137 of file MSSwarmTrafficLightLogic.cpp.

References choosePolicy().

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 212 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myLinks.

virtual SUMOTime MSSwarmTrafficLightLogic::computeReturnTime ( )
inlineprotectedvirtual

Reimplemented from MSSOTLTrafficLightLogic.

Definition at line 235 of file MSSwarmTrafficLightLogic.h.

References DELTA_T.

SUMOReal MSSwarmTrafficLightLogic::getBetaNo ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getBetaSp ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getChangePlanProbability ( )
inline

Definition at line 160 of file MSSwarmTrafficLightLogic.h.

References TplConvert::_2SUMOReal(), and Parameterised::getParameter().

Referenced by decidePolicy().

MSSOTLE2Sensors* MSSOTLTrafficLightLogic::getCountSensors ( )
inlineprotectedinherited

Return the sensors that count the passage of vehicles in and out of the tl.

Definition at line 188 of file MSSOTLTrafficLightLogic.h.

References MSSOTLTrafficLightLogic::myCountSensors.

Referenced by calculateEtaDiff(), calculateEtaRatio(), and updatePheromoneLevels().

int MSPhasedTrafficLightLogic::getCurrentPhaseIndex ( ) const
virtualinherited
MSSOTLPolicy* MSSOTLHiLevelTrafficLightLogic::getCurrentPolicy ( )
inlineinherited
SUMOTime MSTrafficLightLogic::getDefaultCycleTime ( ) const
inlineinherited

Returns the cycle time (in ms)

Returns
The (maybe changing) cycle time of this tls

Definition at line 267 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myDefaultCycleTime.

Referenced by NLJunctionControlBuilder::closeTrafficLightLogic(), and MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP().

SUMOReal MSSwarmTrafficLightLogic::getDispersionForInputLanes ( SUMOReal  average_phero_in)
protected
SUMOReal MSSwarmTrafficLightLogic::getDispersionForOutputLanes ( SUMOReal  average_phero_out)
protected
SUMOReal MSSwarmTrafficLightLogic::getDistanceOfMaxPheroForInputLanes ( )
protected

Definition at line 567 of file MSSwarmTrafficLightLogic.cpp.

References DBG, pheromoneInputLanes, SUMOReal, and WRITE_MESSAGE.

Referenced by decidePolicy().

SUMOReal MSSwarmTrafficLightLogic::getDistanceOfMaxPheroForOutputLanes ( )
protected

Definition at line 602 of file MSSwarmTrafficLightLogic.cpp.

References DBG, pheromoneOutputLanes, SUMOReal, and WRITE_MESSAGE.

Referenced by decidePolicy().

SUMOReal MSSwarmTrafficLightLogic::getForgettingCox ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getGammaNo ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getGammaSp ( )
inline
const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Definition at line 66 of file Named.h.

References Named::myID.

Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), PCPolyContainer::add(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), MSDetectorControl::add(), Named::StoringVisitor::add(), ShapeContainer::add(), IntermodalRouter< E, L, N, V >::addAccess(), NLTriggerBuilder::addAccess(), 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(), ROVehicle::addStop(), MSVehicle::addStop(), NBEdge::addStraightConnections(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciBusOrContainerStop(), MSVehicle::addTraciStop(), AGActivityTripWriter::addTrip(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), NLEdgeControlBuilder::build(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), NBNode::buildCrossings(), NBNode::buildCrossingsAndWalkingAreas(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), GNETLSEditorFrame::buildIinternalLanes(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MELoop::buildSegmentsFor(), MSSOTLE2Sensors::buildSensorForLane(), MSSOTLE2Sensors::buildSensorForOutLane(), NBNode::buildWalkingAreas(), MSBaseVehicle::calculateArrivalParams(), calculateEtaDiff(), calculateEtaRatio(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), choosePolicy(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBLoadedSUMOTLDef::collectEdges(), NBTrafficLightDefinition::collectEdges(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBOwnTLDef::computeLogicAndConts(), NBNode::computeNodeShape(), NBNodeShapeComputer::computeNodeShapeDefault(), NBNodeShapeComputer::computeNodeShapeSmall(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBNode::computeSmoothShape(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NLDetectorBuilder::convUncontE2PosLength(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSSOTLE2Sensors::countVehicles(), GUINet::createTLWrapper(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), decidePolicy(), NIVissimDistrictConnection::dict_BuildDistricts(), NBEdge::divideOnEdges(), NBEdge::divideSelectedLanesOnEdges(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSE3Collector::enter(), METriggeredCalibrator::execute(), 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(), TraCIServerAPI_Vehicle::findCloserLane(), NBRampsComputer::fulfillsRampConstraints(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), GNEConnection::getAttribute(), MSVehicle::getBackPosition(), MSNet::getBusStopID(), MSVehicle::getCenterOnEdge(), MSDevice_Battery::getChargingStationID(), MSNet::getChargingStationID(), NBEdge::getConnection(), NBEdge::getConnectionRef(), MSNet::getContainerStopID(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), MSE2Collector::getEstimateQueueLength(), NBEdge::getFirstNonPedestrianLane(), MSLane::getFollower(), MSLane::getFollowerOnConsecutive(), MSLane::getFollowersOnConsecutive(), GNEEdge::getGNEJunctionDest(), GNEEdge::getGNEJunctionSource(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPerson::getNextEdge(), MSPModel_Striping::getNextLane(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getOppositePos(), GUIVehicle::getParameterWindow(), GUILane::getParentName(), MSLane::getPartialBehind(), MSSOTLTrafficLightLogic::getPhaseIndexWithMaxCTS(), getPheromoneForInputLanes(), getPheromoneForOutputLanes(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), MSVehicleControl::getWaitingVehicle(), MSLink::getZipperSpeed(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSLane::handleCollisionBetween(), NBEdgeCont::ignoreFilterMatch(), MSDeterministicHiLevelTrafficLightLogic::init(), MSRailSignal::init(), MSActuatedTrafficLightLogic::init(), MSTrafficLightLogic::init(), init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBNodeCont::insert(), NBTrafficLightLogicCont::insert(), NBEdgeCont::insert(), MSEdge::insertVehicle(), IntermodalNetwork< E, L, N, V >::IntermodalNetwork(), GNEJunction::invalidateTLS(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), MSPedestrianPushButton::isActiveForEdge(), MSPedestrianPushButton::isActiveOnAnySideOfTheRoad(), RODFNet::isDestination(), RODFNet::isFalseSource(), MSLane::isInsertionSuccess(), RODFNet::isSource(), MSSOTLTrafficLightLogic::isThresholdPassed(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), MSE3Collector::leaveFront(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSPedestrianPushButton::loadCrossingEdgeMap(), NIImporter_OpenDrive::loadNetwork(), MSPedestrianPushButton::loadPushButtons(), NBEdge::MainDirections::MainDirections(), ODDistrictCont::makeDistricts(), NBNodeCont::mapToNumericalIDs(), NBEdgeCont::mapToNumericalIDs(), GNEJunction::markAsModified(), MSSOTLE2Sensors::meanVehiclesSpeed(), METriggeredCalibrator::METriggeredCalibrator(), 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_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Example::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), MSE2Collector::notifyMove(), GUIViewTraffic::onGamingClick(), GNEViewNet::onLeftBtnPress(), 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()(), NBNode::nodes_by_id_sorter::operator()(), MSEdge::by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), MSRouteHandler::parseWalkPositions(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_SL2015::patchSpeed(), MSLCM_LC2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSVehicle::planMove(), MSLane::planMovements(), MSRightOfWayJunction::postloadInit(), NBEdge::prepareEdgePriorities(), MSAbstractLaneChangeModel::primaryLaneChanged(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_ArealDetector::processGet(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), NIXMLNodesHandler::processTrafficLightDefinitions(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NIImporter_OpenStreetMap::reconstructLayerElevation(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNodeCont::removeIsolatedRoads(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::rename(), NBEdgeCont::rename(), GNENet::renameEdge(), GNENet::renameJunction(), RORouteDef::repairCurrentRoute(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), MSBaseVehicle::reroute(), MSLane::resetPartialOccupation(), NBEdge::restoreRestrictedLane(), GNEEdge::retrieveConnection(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), RONet::saveAndRemoveRoutesUntil(), ROPerson::Ride::saveAsXML(), MSBaseVehicle::saveState(), MSLane::saveState(), MSDevice_Battery::setAirDragCoefficient(), NBNodeCont::setAsTLControlled(), MSChargingStation::setChargeDelay(), MSChargingStation::setChargingPower(), MSDevice_Battery::setConstantPowerIntake(), NBEdge::setControllingTLInformation(), MSChargingStation::setEfficency(), MSDevice_Battery::setFrontSurfaceArea(), MSDevice_Battery::setInternalMomentOfInertia(), GNEJunction::setLogicValid(), MSDevice_Battery::setMass(), MSDevice_Battery::setMaximumBatteryCapacity(), NIXMLEdgesHandler::setNodes(), MSLane::setPartialOccupation(), MSDevice_Battery::setPowerMax(), MSDevice_Battery::setPropulsionEfficiency(), MSDevice_Battery::setRadialDragCoefficient(), MSDevice_Battery::setRecuperationEfficiency(), MSLink::setRequestInformation(), MSDevice_Battery::setRollDragCoefficient(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBOwnTLDef::setTLControllingInformation(), NBTrafficLightLogicCont::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdge::shiftPositionAtNode(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSSOTLTrafficLightLogic::trySwitch(), MSVehicle::updateBestLanes(), MSSOTLTrafficLightLogic::updateCTS(), GNETLSEditorFrame::updateDescription(), updatePheromoneLevels(), updateSensitivities(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSEmissionExport::write(), MSBatteryExport::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(), MSFCDExport::writeTransportable(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), PointOfInterest::writeXML(), SUMO::Polygon::writeXML(), MSRouteProbe::writeXMLOutput(), MSE2Collector::writeXMLOutput(), MSInductLoop::writeXMLOutput(), and RONet::~RONet().

int MSPhasedTrafficLightLogic::getIndexFromOffset ( SUMOTime  offset) const
virtualinherited

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 172 of file MSPhasedTrafficLightLogic.cpp.

References MSPhaseDefinition::duration, MSPhasedTrafficLightLogic::getPhase(), MSTrafficLightLogic::myDefaultCycleTime, and MSPhasedTrafficLightLogic::myPhases.

SUMOReal MSSOTLTrafficLightLogic::getInputSensorsLength ( )
inlineprotectedinherited
std::string MSSwarmTrafficLightLogic::getLaneLightState ( const std::string &  laneId)
protected
const LaneVector& MSTrafficLightLogic::getLanesAt ( 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 190 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 181 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myLanes.

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

SUMOReal MSSwarmTrafficLightLogic::getLearningCox ( )
inline
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 254 of file MSTrafficLightLogic.cpp.

References MSTrafficLightLogic::myLinks.

Referenced by GUITrafficLightLogicWrapper::getLinkIndex().

const LinkVectorVector& MSTrafficLightLogic::getLinks ( ) const
inlineinherited
const LinkVector& MSTrafficLightLogic::getLinksAt ( 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 211 of file MSTrafficLightLogic.h.

References MSTrafficLightLogic::myLinks.

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

Returns the type of the logic as a string.

Returns
The type of the logic

Implements MSTrafficLightLogic.

Definition at line 195 of file MSSwarmTrafficLightLogic.h.

SUMOTime MSSwarmTrafficLightLogic::getMaxCongestionDuration ( )
inline

Definition at line 136 of file MSSwarmTrafficLightLogic.h.

References TplConvert::_2int(), and Parameterised::getParameter().

Referenced by decideNextPhase().

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 271 of file MSTrafficLightLogic.cpp.

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

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

SUMOTime MSPhasedTrafficLightLogic::getOffsetFromIndex ( int  index) const
virtualinherited

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 161 of file MSPhasedTrafficLightLogic.cpp.

References MSPhaseDefinition::duration, MSPhasedTrafficLightLogic::getPhase(), and MSPhasedTrafficLightLogic::myPhases.

Referenced by MSPhasedTrafficLightLogic::getPhaseIndexAtTime().

SUMOReal MSSOTLTrafficLightLogic::getOutputSensorsLength ( )
inlineprotectedinherited
const std::string & Parameterised::getParameter ( const std::string &  key,
const std::string &  defaultValue 
) const
inherited

Returns the value for a given key.

Parameters
[in]keyThe key to ask for
[in]defaultValueThe default value to return if no value is stored under the key
Returns
The value stored under the key

Definition at line 81 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by MSDevice_Battery::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), getBetaNo(), getBetaSp(), getChangePlanProbability(), MSSOTLTrafficLightLogic::getDecayConstant(), getForgettingCox(), getGammaNo(), getGammaSp(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), getLearningCox(), getMaxCongestionDuration(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLRequestTrafficLightLogic::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), getPheroMaxVal(), getPoliciesParam(), getReinforcementMode(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), getThetaInit(), getThetaMax(), getThetaMin(), MSSOTLTrafficLightLogic::getThreshold(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Lane::processGet(), MSSOTLPolicyDesirability::readParameter(), and TraCIServerAPI_Vehicle::vtdMap().

const MSPhaseDefinition & MSPhasedTrafficLightLogic::getPhase ( int  givenstep) const
virtualinherited
SUMOTime MSPhasedTrafficLightLogic::getPhaseIndexAtTime ( SUMOTime  simStep) const
virtualinherited

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 151 of file MSPhasedTrafficLightLogic.cpp.

References MSPhasedTrafficLightLogic::getOffsetFromIndex(), MSPhasedTrafficLightLogic::getPhase(), MSTrafficLightLogic::myDefaultCycleTime, MSPhaseDefinition::myLastSwitch, and MSPhasedTrafficLightLogic::myStep.

int MSPhasedTrafficLightLogic::getPhaseNumber ( ) const
virtualinherited

Returns the number of phases.

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

Implements MSTrafficLightLogic.

Definition at line 119 of file MSPhasedTrafficLightLogic.cpp.

References MSPhasedTrafficLightLogic::myPhases.

const MSPhasedTrafficLightLogic::Phases & MSPhasedTrafficLightLogic::getPhases ( ) const
virtualinherited

Returns the phases of this tls program.

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

Implements MSTrafficLightLogic.

Definition at line 125 of file MSPhasedTrafficLightLogic.cpp.

References MSPhasedTrafficLightLogic::myPhases.

Referenced by MSSOTLTrafficLightLogic::checkPhases(), MSSOTLTrafficLightLogic::setToATargetPhase(), and MSSOTLTrafficLightLogic::setupCTS().

SUMOReal MSSwarmTrafficLightLogic::getPheroMaxVal ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getPheromoneForInputLanes ( )
protected
SUMOReal MSSwarmTrafficLightLogic::getPheromoneForOutputLanes ( )
protected
std::vector<MSSOTLPolicy*>& MSSOTLHiLevelTrafficLightLogic::getPolicies ( )
inlineinherited

Returns the vector of the low-level policies used by this high-level tll.

Definition at line 90 of file MSSOTLHiLevelTrafficLightLogic.h.

References MSSOTLHiLevelTrafficLightLogic::policies.

Referenced by MSDeterministicHiLevelTrafficLightLogic::choosePolicy(), choosePolicy(), MSSwarmTrafficLightLogic(), and updateSensitivities().

std::string MSSwarmTrafficLightLogic::getPoliciesParam ( )
inlineprotected

Definition at line 326 of file MSSwarmTrafficLightLogic.h.

References Parameterised::getParameter().

Referenced by MSSwarmTrafficLightLogic().

const std::string& MSTrafficLightLogic::getProgramID ( ) const
inlineinherited
int MSSwarmTrafficLightLogic::getReinforcementMode ( )
inlineprotected
SUMOReal MSSwarmTrafficLightLogic::getScaleFactorDispersionIn ( )
inline

Definition at line 184 of file MSSwarmTrafficLightLogic.h.

References scaleFactorDispersionIn.

Referenced by getDispersionForInputLanes().

SUMOReal MSSwarmTrafficLightLogic::getScaleFactorDispersionOut ( )
inline

Definition at line 188 of file MSSwarmTrafficLightLogic.h.

References scaleFactorDispersionOut.

Referenced by getDispersionForOutputLanes().

SUMOReal MSSOTLTrafficLightLogic::getSpeedThreshold ( )
inlineprotectedinherited
SUMOReal MSSwarmTrafficLightLogic::getThetaInit ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getThetaMax ( )
inline
SUMOReal MSSwarmTrafficLightLogic::getThetaMin ( )
inline
int MSSOTLTrafficLightLogic::getThreshold ( )
inlineprotectedinherited
void MSSwarmTrafficLightLogic::init ( NLDetectorBuilder nb)
throw (ProcessError
)
virtual

Initialises the tls with sensors on incoming and outgoing lanes Sensors are built in the simulation according to the type of sensor specified in the simulation parameter.

Parameters
[in]nbThe detector builder
Exceptions
ProcessErrorIf something fails on initialisation

Reimplemented from MSSOTLHiLevelTrafficLightLogic.

Definition at line 118 of file MSSwarmTrafficLightLogic.cpp.

References TplConvert::_2int(), TplConvert::_2SUMOReal(), ANALYSIS_DBG, MSNet::getCurrentTimeStep(), Named::getID(), MSNet::getInstance(), MSSOTLHiLevelTrafficLightLogic::init(), and WRITE_MESSAGE.

void MSSwarmTrafficLightLogic::initScaleFactorDispersionIn ( int  lanes_in)
inlineprotected

Definition at line 340 of file MSSwarmTrafficLightLogic.h.

References getPheroMaxVal(), scaleFactorDispersionIn, and SUMOReal.

void MSSwarmTrafficLightLogic::initScaleFactorDispersionOut ( int  lanes_out)
inlineprotected

Definition at line 368 of file MSSwarmTrafficLightLogic.h.

References getPheroMaxVal(), scaleFactorDispersionOut, and SUMOReal.

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 MSSOTLTrafficLightLogic::logStatus ( )
protectedinherited

Definition at line 89 of file MSSOTLTrafficLightLogic.cpp.

void MSPhasedTrafficLightLogic::proceedToNextStep ( )
protectedinherited

Proceed to the next step.

MEMBER FACTORIZED TO PARENT CLASS (MSTrafficLightLogic)

Definition at line 104 of file MSPhasedTrafficLightLogic.cpp.

References MSPhasedTrafficLightLogic::myStep, and MSPhasedTrafficLightLogic::setStep().

void MSSwarmTrafficLightLogic::resetLaneCheck ( )
protected

Definition at line 1066 of file MSSwarmTrafficLightLogic.cpp.

References laneCheck, and MSTrafficLightLogic::myLanes.

Referenced by calculateEtaDiff(), and calculateEtaRatio().

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 241 of file MSTrafficLightLogic.cpp.

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

void MSSwarmTrafficLightLogic::resetPheromone ( )
protected

Resets pheromone levels.

Definition at line 204 of file MSSwarmTrafficLightLogic.cpp.

References pheromoneInputLanes, and pheromoneOutputLanes.

Referenced by decideNextPhase().

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

References Named::myID.

Referenced by NBNodeCont::mapToNumericalIDs(), NBEdgeCont::mapToNumericalIDs(), NBNodeCont::rename(), and NBEdgeCont::rename().

void MSPhasedTrafficLightLogic::setPhases ( const Phases phases,
int  index 
)
inherited

Replaces the phases and set the phase index.

Definition at line 209 of file MSPhasedTrafficLightLogic.cpp.

References MSPhasedTrafficLightLogic::deletePhases(), MSPhasedTrafficLightLogic::myPhases, and MSPhasedTrafficLightLogic::myStep.

bool MSTrafficLightLogic::setTrafficLightSignals ( SUMOTime  t) const
inherited
void MSSwarmTrafficLightLogic::updatePheromoneLevels ( )
protected

Update pheromone levels Pheromone on input lanes is costantly updated Pheromone follows a discrete-time dynamic law "pheromone(k+1) = beta*pheromone(k) + gamma * sensed_val(k)".

Definition at line 288 of file MSSwarmTrafficLightLogic.cpp.

References getBetaNo(), getBetaSp(), getGammaNo(), getGammaSp(), pheromoneInputLanes, and pheromoneOutputLanes.

Referenced by decideNextPhase().

void MSSwarmTrafficLightLogic::updateSensitivities ( )
protected

Field Documentation

int MSSwarmTrafficLightLogic::carsIn
protected
int MSSwarmTrafficLightLogic::carsOut
protected
SUMOTime MSSwarmTrafficLightLogic::congestion_steps
protected
bool MSSwarmTrafficLightLogic::gotTargetLane
protected

When true indicates that we've already acquired the target lanes for this particular phase.

Definition at line 428 of file MSSwarmTrafficLightLogic.h.

Referenced by decideNextPhase(), and MSSwarmTrafficLightLogic().

int MSSwarmTrafficLightLogic::inTarget
protected
LaneCheckMap MSSwarmTrafficLightLogic::laneCheck
protected

Map to check if a lane was already controlled during the elaboration of eta.

Definition at line 414 of file MSSwarmTrafficLightLogic.h.

Referenced by calculateEtaDiff(), calculateEtaRatio(), and resetLaneCheck().

SUMOTime MSSwarmTrafficLightLogic::lastThetaSensitivityUpdate
protected

This member keeps track of the last thresholds update, s.t. updates can be correctly performed even on time-variable interations.

See also
MSSwarmTrafficLightLogic::updateSensitivities()

Definition at line 222 of file MSSwarmTrafficLightLogic.h.

Referenced by updateSensitivities().

bool MSSwarmTrafficLightLogic::logData
protected

Definition at line 402 of file MSSwarmTrafficLightLogic.h.

Referenced by ~MSSwarmTrafficLightLogic().

SUMOReal MSSwarmTrafficLightLogic::m_derivativeAlpha
protected

Definition at line 449 of file MSSwarmTrafficLightLogic.h.

Referenced by updatePheromoneLevels().

std::map<std::string, CircularBuffer<SUMOReal>* > MSSwarmTrafficLightLogic::m_derivativeHistory
protected

Definition at line 448 of file MSSwarmTrafficLightLogic.h.

Referenced by updatePheromoneLevels(), and ~MSSwarmTrafficLightLogic().

std::map<std::string, std::vector<int> > MSSwarmTrafficLightLogic::m_laneIndexMap
protected

Definition at line 441 of file MSSwarmTrafficLightLogic.h.

Referenced by getLaneLightState().

int MSSwarmTrafficLightLogic::m_losCounter
protected

Definition at line 450 of file MSSwarmTrafficLightLogic.h.

Referenced by updatePheromoneLevels().

int MSSwarmTrafficLightLogic::m_losMaxLimit
protected

Definition at line 451 of file MSSwarmTrafficLightLogic.h.

Referenced by updatePheromoneLevels().

std::map<std::string, CircularBuffer<SUMOReal>* > MSSwarmTrafficLightLogic::m_meanSpeedHistory
protected

Definition at line 447 of file MSSwarmTrafficLightLogic.h.

Referenced by updatePheromoneLevels(), and ~MSSwarmTrafficLightLogic().

std::map<std::string, std::string> MSSwarmTrafficLightLogic::m_pheroLevelLog
protected

Definition at line 444 of file MSSwarmTrafficLightLogic.h.

Referenced by updatePheromoneLevels().

PhasePushButtons MSSOTLTrafficLightLogic::m_pushButtons
protectedinherited
bool MSSwarmTrafficLightLogic::m_useVehicleTypesWeights
protected

Definition at line 452 of file MSSwarmTrafficLightLogic.h.

Referenced by choosePolicy(), and MSSwarmTrafficLightLogic().

bool MSSwarmTrafficLightLogic::mustChange
protected

When true, indicates that the current policy MUST be changed.
It's used to force the exit from the congestion policy.

Definition at line 408 of file MSSwarmTrafficLightLogic.h.

Referenced by decideNextPhase(), decidePolicy(), and MSSwarmTrafficLightLogic().

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

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

int MSSwarmTrafficLightLogic::notTarget
protected
MSLaneId_PheromoneMap MSSwarmTrafficLightLogic::pheromoneInputLanes
protected

This pheronome is an indicator of congestion on input lanes.
Its levels refer to the average speed of vehicles passing the input lane: the lower the speed the higher the pheromone.
These levels are updated on every input lane, independently on lights state.

Definition at line 207 of file MSSwarmTrafficLightLogic.h.

Referenced by getDispersionForInputLanes(), getDistanceOfMaxPheroForInputLanes(), getPheromoneForInputLanes(), resetPheromone(), and updatePheromoneLevels().

MSLaneId_PheromoneMap MSSwarmTrafficLightLogic::pheromoneOutputLanes
protected

This pheromone is an indicator of congestion on output lanes.
Its levels refer to the average speed of vehicles passing the output lane: the lower the speed the higher the pheromone.
These levels are updated on every output lane, independently on lights state.

Definition at line 215 of file MSSwarmTrafficLightLogic.h.

Referenced by getDispersionForOutputLanes(), getDistanceOfMaxPheroForOutputLanes(), getPheromoneForOutputLanes(), resetPheromone(), and updatePheromoneLevels().

SUMOReal MSSwarmTrafficLightLogic::scaleFactorDispersionIn
protected

to scale pheromoneDispersion in range [0, 10]

Definition at line 437 of file MSSwarmTrafficLightLogic.h.

Referenced by getScaleFactorDispersionIn(), and initScaleFactorDispersionIn().

SUMOReal MSSwarmTrafficLightLogic::scaleFactorDispersionOut
protected
bool MSSwarmTrafficLightLogic::skipEta
protected

When true indicates that we can skip the evaluation of eta since we've a congestion policy that is lasting too much.

Definition at line 423 of file MSSwarmTrafficLightLogic.h.

Referenced by decideNextPhase(), decidePolicy(), MSSwarmTrafficLightLogic(), and updateSensitivities().

std::ofstream MSSwarmTrafficLightLogic::swarmLogFile
protected

Definition at line 403 of file MSSwarmTrafficLightLogic.h.

Referenced by ~MSSwarmTrafficLightLogic().

LaneIdVector MSSwarmTrafficLightLogic::targetLanes
protected

A copy of the target lanes of this phase.

Definition at line 418 of file MSSwarmTrafficLightLogic.h.

Referenced by calculateEtaDiff(), calculateEtaRatio(), and decideNextPhase().


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