18#ifndef NeTrainSim_NetNode_h
19#define NeTrainSim_NetNode_h
23#include "../util/vector.h"
24#include "../util/map.h"
37 static unsigned int NumberOfNodesInSimulator;
103 void addSignal(std::shared_ptr<NetSignal> networkSignal);
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
Vector< std::shared_ptr< NetNode > > getNeighbors()
Gets the neighbors of the node.
Definition netnode.cpp:40
void setNodeSimulatorID(int newID)
Sets the simulator identifier of the node.
Definition netnode.cpp:36
void updateYScale(const double &newScale)
Updates the y-coordinate scale of the node.
Definition netnode.cpp:65
double y
The y-coordinate of the node.
Definition netnode.h:43
int userID
The user identifier of the node.
Definition netnode.h:41
double dwellTimeIfDepot
The dwell time at the depot.
Definition netnode.h:49
void addSignal(std::shared_ptr< NetSignal > networkSignal)
Adds a network signal to the node.
Definition netnode.cpp:55
std::string alphaDesc
The description of the node.
Definition netnode.h:44
double xScale
The x-value scale of the node.
Definition netnode.h:45
double graphSearchDistanceFromStart
The graph search distance from the start node.
Definition netnode.h:54
double yScale
The y-value scale of the node.
Definition netnode.h:46
Vector< std::shared_ptr< NetSignal > > networkSignals
The network signals associated with the node.
Definition netnode.h:47
void updateXScale(const double &newScale)
Updates the x-coordinate scale of the node.
Definition netnode.cpp:59
bool isDepot
Indicates whether the node is a stopping station or depot for all trains.
Definition netnode.h:48
double x
The x-coordinate of the node.
Definition netnode.h:42
bool refillTanksAndBatteries
Indicates whether trains refill tanks and batteries when passing through this node.
Definition netnode.h:50
Map< std::shared_ptr< NetNode >, Vector< std::shared_ptr< NetLink > > > linkTo
The neighbor nodes and their link connections.
Definition netnode.h:51
void clearGraphSearchParams()
Clears the graph search parameters.
Definition netnode.cpp:44
bool graphSearchVisited
Indicates whether the node has been visited in graph search.
Definition netnode.h:55
~NetNode()
Destructor.
Definition netnode.cpp:32
std::shared_ptr< NetNode > graphSearchPreviousNode
The previous node in the path during graph search.
Definition netnode.h:56
pair< double, double > coordinates()
Gets the coordinates of the node.
Definition netnode.cpp:71
static unsigned int getNumberOfNodesInSimulator()
Gets the number of nodes in the simulator.
Definition netnode.cpp:50
The NetSignal class represents a network signal in a simulation.
Definition netsignal.h:35
A vector.
Definition vector.h:24
ostream & operator<<(ostream &ostr, const NetNode &node)
Overloaded ostream operator for printing the NetNode object.
Definition netnode.cpp:75