17#ifndef NeTrainSim_NetSignalGroupController_h
18#define NeTrainSim_NetSignalGroupController_h
25#include "../util/vector.h"
26#include "../util/map.h"
46 static constexpr double timeout = 5;
48 static unsigned int NumberOfSignalsInSimulator;
74 void addNode(std::shared_ptr<NetNode> node);
83 double& simulationTime,
84 Vector<std::shared_ptr<NetSignal>>& sameDirectionSignals);
117 void turnOffSignals(
Vector<std::shared_ptr<NetSignal>> turnOffSignals);
A map.
Definition map.h:26
The NetLink class represents a network link in a simulation.
Definition netlink.h:36
The NetNode class represents a network node in a simulation.
Definition netnode.h:35
The NetSignalGroupController class represents a controller for handling network signal groups in a si...
Definition netsignalgroupcontroller.h:38
void clear()
Clears the controller to its initial state.
Definition netsignalgroupcontroller.cpp:115
std::pair< std::shared_ptr< NetSignal >, Vector< std::shared_ptr< NetSignal > > > getFeedback()
Gets the feedback on which signals should be turned on/off.
Definition netsignalgroupcontroller.cpp:92
Vector< std::shared_ptr< NetNode > > atNodes
The nodes confined by this group controller.
Definition netsignalgroupcontroller.h:52
void sendPassRequestToControlTo(std::shared_ptr< NetSignal > networkSignal, double &simulationTime, Vector< std::shared_ptr< NetSignal > > &sameDirectionSignals)
Sends a pass request to control a specific network signal.
Definition netsignalgroupcontroller.cpp:35
void updateTimeStep(double &timeStep)
Updates the controller state based on the time step.
Definition netsignalgroupcontroller.cpp:86
std::shared_ptr< NetSignal > lockedOnSignal
The locked network signal.
Definition netsignalgroupcontroller.h:56
void addNode(std::shared_ptr< NetNode > node)
Adds a node to the group controller.
Definition netsignalgroupcontroller.cpp:22
double timeStamp
The timestamp of the controller.
Definition netsignalgroupcontroller.h:55
Vector< std::shared_ptr< NetLink > > confinedLinks
The confined links in the group.
Definition netsignalgroupcontroller.h:53
Vector< std::shared_ptr< NetSignal > > networkSignalsGroup
The network signals in the group.
Definition netsignalgroupcontroller.h:51
Vector< std::shared_ptr< NetSignal > > otherDirectionSignals
The signals in the opposite direction.
Definition netsignalgroupcontroller.h:57
friend ostream & operator<<(ostream &ostr, const NetSignalGroupController &group)
Overloaded ostream operator for printing the NetSignalGroupController object.
void setSignalsInSameDirection(Vector< std::shared_ptr< NetSignal > > sameDirectionSignals)
Sets the signals in the same direction as the train.
Definition netsignalgroupcontroller.cpp:72
Map< std::shared_ptr< NetSignal >, bool > movements
The movement status of the signals.
Definition netsignalgroupcontroller.h:54
The NetSignal class represents a network signal in a simulation.
Definition netsignal.h:35
A vector.
Definition vector.h:24