The NetNode class represents a network node in a simulation.
More...
#include <netnode.h>
The NetNode class represents a network node in a simulation.
◆ NetNode()
NetNode::NetNode |
( |
int |
simulatorID, |
|
|
int |
userID, |
|
|
double |
xCoord, |
|
|
double |
yCoord, |
|
|
string |
Desc, |
|
|
double |
xScale, |
|
|
double |
yScale |
|
) |
| |
Constructor.
- Parameters
-
simulatorID | The simulator identifier of the node. |
userID | The user identifier of the node. |
xCoord | The x-coordinate of the node. |
yCoord | The y-coordinate of the node. |
Desc | The description of the node. |
xScale | The x-value scale of the node. |
yScale | The y-value scale of the node. |
◆ ~NetNode()
◆ addSignal()
void NetNode::addSignal |
( |
std::shared_ptr< NetSignal > |
networkSignal | ) |
|
Adds a network signal to the node.
- Parameters
-
networkSignal | The network signal to add. |
◆ clearGraphSearchParams()
void NetNode::clearGraphSearchParams |
( |
| ) |
|
Clears the graph search parameters.
This should be called before running the graph search.
◆ coordinates()
pair< double, double > NetNode::coordinates |
( |
| ) |
|
Gets the coordinates of the node.
- Returns
- A pair containing the x and y coordinates.
◆ getNeighbors()
Gets the neighbors of the node.
- Returns
- A vector of shared pointers to the neighbor nodes.
◆ getNumberOfNodesInSimulator()
unsigned int NetNode::getNumberOfNodesInSimulator |
( |
| ) |
|
|
static |
Gets the number of nodes in the simulator.
- Returns
- The number of nodes.
◆ setNodeSimulatorID()
void NetNode::setNodeSimulatorID |
( |
int |
newID | ) |
|
Sets the simulator identifier of the node.
- Parameters
-
newID | The new simulator identifier. |
◆ updateXScale()
void NetNode::updateXScale |
( |
const double & |
newScale | ) |
|
Updates the x-coordinate scale of the node.
- Parameters
-
newScale | The new scale value. |
◆ updateYScale()
void NetNode::updateYScale |
( |
const double & |
newScale | ) |
|
Updates the y-coordinate scale of the node.
- Parameters
-
newScale | The new scale value. |
◆ alphaDesc
std::string NetNode::alphaDesc |
The description of the node.
◆ dwellTimeIfDepot
double NetNode::dwellTimeIfDepot |
The dwell time at the depot.
◆ graphSearchDistanceFromStart
double NetNode::graphSearchDistanceFromStart |
The graph search distance from the start node.
◆ graphSearchPreviousNode
std::shared_ptr<NetNode> NetNode::graphSearchPreviousNode |
The previous node in the path during graph search.
◆ graphSearchVisited
bool NetNode::graphSearchVisited |
Indicates whether the node has been visited in graph search.
◆ id
The identifier of the node.
◆ isDepot
Indicates whether the node is a stopping station or depot for all trains.
◆ linkTo
The neighbor nodes and their link connections.
◆ networkSignals
The network signals associated with the node.
◆ refillTanksAndBatteries
bool NetNode::refillTanksAndBatteries |
Indicates whether trains refill tanks and batteries when passing through this node.
◆ userID
The user identifier of the node.
The x-coordinate of the node.
◆ xScale
The x-value scale of the node.
The y-coordinate of the node.
◆ yScale
The y-value scale of the node.