The NetLink class represents a network link in a simulation.
More...
#include <netlink.h>
|
| NetLink (int simulatorID, int linkID, std::shared_ptr< NetNode > fromNode, std::shared_ptr< NetNode > toNode, double maxSpeed, int trafficSignalID, string signalAtEnd, double linkGrade, double linkCurvature, int linkNoOfDirections, double speedVariationfactor, bool isCatenaryAvailable, string linkInRegion, double maxSpeedScale) |
| Constructor.
|
|
| ~NetLink () |
| Destructor.
|
|
void | setLinkSimulatorID (int newID) |
| Sets the simulator identifier of the link.
|
|
void | updateLinksScaleFreeSpeed (double newScale) |
| Updates the links scale free speed.
|
|
map< int, double > | setGrade (double grade) |
| Sets the grade of the link.
|
|
double | getCost () |
| Gets the cost associated with the link.
|
|
std::pair< std::pair< double, double >, std::pair< double, double > > | vectorizeLinkOfOneSegment (std::shared_ptr< NetNode > startNode) |
| Creates a vector representation of a link with respect to a given start node.
|
|
pair< double, double > | findPositionOnLink (double travelledLength, std::shared_ptr< NetNode > startNode) |
|
|
static unsigned int | getNumberOfLinks () |
| Gets the number of links in the simulator.
|
|
The NetLink class represents a network link in a simulation.
◆ NetLink()
NetLink::NetLink |
( |
int |
simulatorID, |
|
|
int |
linkID, |
|
|
std::shared_ptr< NetNode > |
fromNode, |
|
|
std::shared_ptr< NetNode > |
toNode, |
|
|
double |
maxSpeed, |
|
|
int |
trafficSignalID, |
|
|
string |
signalAtEnd, |
|
|
double |
linkGrade, |
|
|
double |
linkCurvature, |
|
|
int |
linkNoOfDirections, |
|
|
double |
speedVariationfactor, |
|
|
bool |
isCatenaryAvailable, |
|
|
string |
linkInRegion, |
|
|
double |
maxSpeedScale |
|
) |
| |
Constructor.
- Parameters
-
simulatorID | The simulator identifier of the link. |
linkID | The identifier of the link. |
fromNode | The starting node of the link. |
toNode | The end node of the link. |
linkLength | The length of the link. |
maxSpeed | The maximum speed of the link. |
trafficSignalID | The traffic signal identifier of the link. |
signalAtEnd | Which End of the link, the signal is placed at |
linkGrade | The grade of the link. |
linkCurvature | The curvature of the link. |
linkNoOfDirections | The number of directions of the link. |
speedVariationfactor | The speed variation factor of the link. |
isCatenaryAvailable | Indicates whether catenary is available on the link. |
linkInRegion | The region in which the link is located. |
lengthScale | The length scale of the link. |
maxSpeedScale | The maximum speed scale of the link. |
◆ ~NetLink()
◆ findPositionOnLink()
pair< double, double > NetLink::findPositionOnLink |
( |
double |
travelledLength, |
|
|
std::shared_ptr< NetNode > |
startNode |
|
) |
| |
◆ getCost()
double NetLink::getCost |
( |
| ) |
|
Gets the cost associated with the link.
- Returns
- The cost value.
◆ getNumberOfLinks()
unsigned int NetLink::getNumberOfLinks |
( |
| ) |
|
|
static |
Gets the number of links in the simulator.
- Returns
- The number of links.
◆ setGrade()
map< int, double > NetLink::setGrade |
( |
double |
grade | ) |
|
Sets the grade of the link.
- Parameters
-
- Returns
- The grade map.
◆ setLinkSimulatorID()
void NetLink::setLinkSimulatorID |
( |
int |
newID | ) |
|
Sets the simulator identifier of the link.
- Parameters
-
newID | The new simulator identifier. |
◆ updateLinksScaleFreeSpeed()
void NetLink::updateLinksScaleFreeSpeed |
( |
double |
newScale | ) |
|
Updates the links scale free speed.
- Parameters
-
newScale | The new scale value. |
◆ vectorizeLinkOfOneSegment()
std::pair< std::pair< double, double >, std::pair< double, double > > NetLink::vectorizeLinkOfOneSegment |
( |
std::shared_ptr< NetNode > |
startNode | ) |
|
Creates a vector representation of a link with respect to a given start node.
- Parameters
-
startNode | A shared_ptr to a NetNode object representing the start node. |
- Returns
- A pair of pairs of doubles, where the first pair represents the coordinates of the start node, and the second pair represents the vector from the start node to the end node.
- Author
- Ahmed
- Date
- 2/14/2023
- Parameters
-
link | A shared_ptr to a NetLink object. |
startNode | A shared_ptr to a NetNode object representing the start node. |
- Returns
- A pair of pairs of doubles, where the first pair represents the coordinates of the start node, and the second pair represents the vector from the start node to the end node.
- Author
- Ahmed
- Date
- 2/14/2023
◆ catenaryCumConsumedEnergy
double NetLink::catenaryCumConsumedEnergy |
The amount of energy consumed by all trains on the network.
◆ catenaryCumRegeneratedEnergy
double NetLink::catenaryCumRegeneratedEnergy |
The amount of energy regenerated by all trains on the network.
◆ cost
The cost associated with this link.
◆ currentTrains
A vector of pointers to trains currently on this link.
◆ curvature
double NetLink::curvature |
The curvature of the link.
◆ direction
The direction of the link.
◆ freeFlowSpeed
double NetLink::freeFlowSpeed |
The free flow speed of the link.
◆ fromLoc
std::shared_ptr<NetNode> NetLink::fromLoc |
The starting node of the link.
◆ grade
map<int, double> NetLink::grade |
◆ hasCatenary
bool NetLink::hasCatenary |
Indicates whether the link has catenary.
◆ id
The identifier of the link.
◆ intermediatePoints
◆ length
This extends the line link to a polyline link.
The length of the link.
◆ linksScaleFreeSpeed
double NetLink::linksScaleFreeSpeed |
The free speed scale of the links.
◆ region
std::string NetLink::region |
The region in which the link is located.
◆ speedVariation
double NetLink::speedVariation |
The speed variation of the link.
◆ toLoc
std::shared_ptr<NetNode> NetLink::toLoc |
The end node of the link.
◆ trafficSignalAtEnd
Vector<int> NetLink::trafficSignalAtEnd |
◆ trafficSignalNo
int NetLink::trafficSignalNo |
The traffic network signal number of the link.
◆ userID
The user identifier of the link.