Eclipse SUMO - Simulation of Urban MObility
MSRailSignalControl Class Reference

A signal for rails. More...

#include <MSRailSignalControl.h>

Inheritance diagram for MSRailSignalControl:
[legend]
Collaboration diagram for MSRailSignalControl:
[legend]

Public Member Functions

const std::set< const MSEdge * > & getUsedEdges () const
 
void registerProtectedDriveway (MSRailSignal *rs, int driveWayID, const MSEdge *protectedBidi)
 mark driveway that must receive additional checks if protectedBidi is ever used by a train route More...
 
void vehicleStateChanged (const SUMOVehicle *const vehicle, MSNet::VehicleState to, const std::string &info="")
 Called if a vehicle changes its state. More...
 
 ~MSRailSignalControl ()
 

Static Public Member Functions

static void cleanup ()
 
static MSRailSignalControlgetInstance ()
 
static bool hasInstance ()
 

Private Member Functions

 MSRailSignalControl ()
 Constructor. More...
 
void updateDriveways (const MSEdge *used)
 compute additioanl deadlock-check requirements for registered driveways More...
 

Private Attributes

std::map< const MSEdge *, std::vector< std::pair< MSRailSignal *, int > > > myProtectedDriveways
 map of driveways that must perform additional checks if the key edge is used by a train route More...
 
std::set< const MSEdge * > myUsedEdges
 all rail edges that are part of a known route More...
 

Static Private Attributes

static MSRailSignalControlmyInstance
 

Detailed Description

A signal for rails.

Definition at line 38 of file MSRailSignalControl.h.

Constructor & Destructor Documentation

◆ ~MSRailSignalControl()

MSRailSignalControl::~MSRailSignalControl ( )

Definition at line 61 of file MSRailSignalControl.cpp.

◆ MSRailSignalControl()

MSRailSignalControl::MSRailSignalControl ( )
private

Constructor.

Definition at line 43 of file MSRailSignalControl.cpp.

Referenced by getInstance().

Here is the caller graph for this function:

Member Function Documentation

◆ cleanup()

void MSRailSignalControl::cleanup ( )
static

Definition at line 56 of file MSRailSignalControl.cpp.

References myInstance.

Referenced by MSNet::clearAll().

Here is the caller graph for this function:

◆ getInstance()

MSRailSignalControl & MSRailSignalControl::getInstance ( void  )
static

Definition at line 47 of file MSRailSignalControl.cpp.

References MSNet::addVehicleStateListener(), MSNet::getInstance(), MSRailSignalControl(), and myInstance.

Referenced by MSRailSignal::LinkInfo::buildDriveWay(), MSRailSignal::DriveWay::buildRoute(), and MSStateHandler::closeVehicle().

Here is the caller graph for this function:

◆ getUsedEdges()

const std::set<const MSEdge*>& MSRailSignalControl::getUsedEdges ( ) const
inline

Definition at line 60 of file MSRailSignalControl.h.

References myUsedEdges.

Referenced by MSRailSignal::DriveWay::buildRoute().

Here is the caller graph for this function:

◆ hasInstance()

static bool MSRailSignalControl::hasInstance ( )
inlinestatic

Definition at line 44 of file MSRailSignalControl.h.

References myInstance.

Referenced by MSStateHandler::closeVehicle().

Here is the caller graph for this function:

◆ registerProtectedDriveway()

void MSRailSignalControl::registerProtectedDriveway ( MSRailSignal rs,
int  driveWayID,
const MSEdge protectedBidi 
)

mark driveway that must receive additional checks if protectedBidi is ever used by a train route

Definition at line 80 of file MSRailSignalControl.cpp.

References Named::getID(), and myProtectedDriveways.

Referenced by MSRailSignal::LinkInfo::buildDriveWay().

Here is the caller graph for this function:

◆ updateDriveways()

void MSRailSignalControl::updateDriveways ( const MSEdge used)
private

compute additioanl deadlock-check requirements for registered driveways

Definition at line 88 of file MSRailSignalControl.cpp.

References myProtectedDriveways.

Referenced by vehicleStateChanged().

Here is the caller graph for this function:

◆ vehicleStateChanged()

void MSRailSignalControl::vehicleStateChanged ( const SUMOVehicle *const  vehicle,
MSNet::VehicleState  to,
const std::string &  info = "" 
)
virtual

Called if a vehicle changes its state.

Parameters
[in]vehicleThe vehicle which changed its state
[in]toThe state the vehicle has changed to
[in]infoAdditional information on the state change

Implements MSNet::VehicleStateListener.

Definition at line 65 of file MSRailSignalControl.cpp.

References MSRoute::getEdges(), SUMOVehicle::getRoute(), SUMOTrafficObject::getVClass(), isRailway(), myProtectedDriveways, myUsedEdges, updateDriveways(), MSNet::VEHICLE_STATE_DEPARTED, and MSNet::VEHICLE_STATE_NEWROUTE.

Referenced by MSStateHandler::closeVehicle().

Here is the caller graph for this function:

Field Documentation

◆ myInstance

MSRailSignalControl * MSRailSignalControl::myInstance
staticprivate

Definition at line 77 of file MSRailSignalControl.h.

Referenced by cleanup(), getInstance(), and hasInstance().

◆ myProtectedDriveways

std::map<const MSEdge*, std::vector<std::pair<MSRailSignal*, int> > > MSRailSignalControl::myProtectedDriveways
private

map of driveways that must perform additional checks if the key edge is used by a train route

Definition at line 75 of file MSRailSignalControl.h.

Referenced by registerProtectedDriveway(), updateDriveways(), and vehicleStateChanged().

◆ myUsedEdges

std::set<const MSEdge*> MSRailSignalControl::myUsedEdges
private

all rail edges that are part of a known route

Definition at line 72 of file MSRailSignalControl.h.

Referenced by getUsedEdges(), and vehicleStateChanged().


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