NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
NetSignalGroupControllerWithQueuing Class Reference

Responsible for controlling and queuing network signals and managing train movements. More...

#include <netsignalgroupcontrollerwithqueuing.h>

Public Member Functions

 NetSignalGroupControllerWithQueuing (std::set< std::shared_ptr< NetNode > > nodes, double timeStep)
 Constructor.
 
Vector< std::shared_ptr< NetSignal > > getControllerSignals ()
 Get the signals this controller is managing.
 
void addNode (std::shared_ptr< NetNode > node)
 Clear Movements.
 
void addTrain (std::shared_ptr< Train > train, double simulatorTime)
 Add Train.
 
void sendPassRequestToControlTo (std::shared_ptr< Train > train, std::shared_ptr< NetSignal > networkSignal, double &simulatorTime, Vector< std::shared_ptr< NetSignal > > &sameDirectionSignals)
 Send Pass Request to Control.
 
void clearTimeoutTrains (double simulatorTime)
 
void updateTimeStep (std::shared_ptr< Train > train, std::shared_ptr< NetSignal > networkSignal, double &simulatorTime, Vector< std::shared_ptr< NetSignal > > &sameDirectionSignals)
 Update Time Step.
 
std::pair< Vector< std::shared_ptr< NetSignal > >, Vector< std::shared_ptr< NetSignal > > > getFeedback ()
 Get Feedback.
 
void turnOffSignals (Vector< std::shared_ptr< NetSignal > > turnOffSignals)
 Turn off signal.
 

Detailed Description

Responsible for controlling and queuing network signals and managing train movements.

Constructor & Destructor Documentation

◆ NetSignalGroupControllerWithQueuing()

NetSignalGroupControllerWithQueuing::NetSignalGroupControllerWithQueuing ( std::set< std::shared_ptr< NetNode > >  nodes,
double  timeStep 
)

Constructor.

Author
Ahmed Aredah
Date
7/5/2023
Parameters
nodesSet of shared pointers to NetNode.
timeStepTime step for the signal controller.

Member Function Documentation

◆ addNode()

void NetSignalGroupControllerWithQueuing::addNode ( std::shared_ptr< NetNode node)

Clear Movements.

Author
Ahmed Aredah
Date
7/5/2023

◆ addTrain()

void NetSignalGroupControllerWithQueuing::addTrain ( std::shared_ptr< Train train,
double  simulatorTime 
)

Add Train.

Author
Ahmed Aredah
Date
7/5/2023
Parameters
trainShared pointer to a Train.
simulatorTimeSimulation time.

◆ clearTimeoutTrains()

void NetSignalGroupControllerWithQueuing::clearTimeoutTrains ( double  simulatorTime)

◆ getControllerSignals()

Vector< std::shared_ptr< NetSignal > > NetSignalGroupControllerWithQueuing::getControllerSignals ( )

Get the signals this controller is managing.

Author
Ahmed Aredah
Date
7/5/2023
Returns
networkSignals Vector of shared pointers to NetSignals.

◆ getFeedback()

std::pair< Vector< std::shared_ptr< NetSignal > >, Vector< std::shared_ptr< NetSignal > > > NetSignalGroupControllerWithQueuing::getFeedback ( )

Get Feedback.

Author
Ahmed Aredah
Date
7/5/2023
Returns
pair of Vectors of shared pointers to NetSignal.

◆ sendPassRequestToControlTo()

void NetSignalGroupControllerWithQueuing::sendPassRequestToControlTo ( std::shared_ptr< Train train,
std::shared_ptr< NetSignal networkSignal,
double &  simulatorTime,
Vector< std::shared_ptr< NetSignal > > &  sameDirectionSignals 
)

Send Pass Request to Control.

Author
Ahmed Aredah
Date
7/5/2023
Parameters
trainShared pointer to a Train.
networkSignalShared pointer to a NetSignal.
simulatorTimeReference to simulation time.
sameDirectionSignalsVector of shared pointers to NetSignal.

◆ turnOffSignals()

void NetSignalGroupControllerWithQueuing::turnOffSignals ( Vector< std::shared_ptr< NetSignal > >  turnOffSignals)

Turn off signal.

Author
Ahmed Aredah
Date
2/28/2023
Parameters
networkSignalsThe network signals to be turned off.

◆ updateTimeStep()

void NetSignalGroupControllerWithQueuing::updateTimeStep ( std::shared_ptr< Train train,
std::shared_ptr< NetSignal networkSignal,
double &  simulatorTime,
Vector< std::shared_ptr< NetSignal > > &  sameDirectionSignals 
)

Update Time Step.

Author
Ahmed Aredah
Date
7/5/2023
Parameters
trainShared pointer to a Train.
networkSignalShared pointer to a NetSignal.
simulatorTimeReference to simulation time.
sameDirectionSignalsVector of shared pointers to NetSignal.