OpenTTD
|
Link graph job node. More...
#include <linkgraphjob.h>
Public Member Functions | |
Node (LinkGraphJob *lgj, NodeID node) | |
Constructor. | |
Edge | operator[] (NodeID to) const |
Retrieve an edge starting at this node. | |
EdgeIterator | Begin () const |
Iterator for the "begin" of the edge array. | |
EdgeIterator | End () const |
Iterator for the "end" of the edge array. | |
uint | UndeliveredSupply () const |
Get amount of supply that hasn't been delivered, yet. | |
FlowStatMap & | Flows () |
Get the flows running through this node. | |
const FlowStatMap & | Flows () const |
Get a constant version of the flows running through this node. | |
PathList & | Paths () |
Get the paths this node is part of. | |
const PathList & | Paths () const |
Get a constant version of the paths this node is part of. | |
void | DeliverSupply (NodeID to, uint amount) |
Deliver some supply, adding demand to the respective edge. | |
![]() | |
ConstNode (const LinkGraph *lg, NodeID node) | |
Constructor. | |
![]() | |
NodeWrapper (const BaseNode &node, const BaseEdge *edges, NodeID index) | |
Wrap a node. | |
uint | Supply () const |
Get supply of wrapped node. | |
uint | Demand () const |
Get demand of wrapped node. | |
StationID | Station () const |
Get ID of station belonging to wrapped node. | |
Date | LastUpdate () const |
Get node's last update. | |
TileIndex | XY () const |
Get the location of the station associated with the node. |
Private Attributes | |
NodeAnnotation & | node_anno |
Annotation being wrapped. | |
EdgeAnnotation * | edge_annos |
Edge annotations belonging to this node. |
Additional Inherited Members | |
![]() | |
const BaseNode & | node |
Node being wrapped. | |
const BaseEdge * | edges |
Outgoing edges for wrapped node. | |
NodeID | index |
ID of wrapped node. |
Link graph job node.
Wraps a constant link graph node and a modifiable node annotation.
Definition at line 184 of file linkgraphjob.h.
|
inline |
Constructor.
lgj | Job to take the node from. |
node | ID of the node. |
Definition at line 195 of file linkgraphjob.h.
|
inline |
Iterator for the "begin" of the edge array.
Only edges with capacity are iterated. The others are skipped.
Reimplemented from LinkGraph::ConstNode.
Definition at line 213 of file linkgraphjob.h.
References edge_annos, LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges, and LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::index.
Referenced by LinkGraphJob::~LinkGraphJob().
|
inline |
Deliver some supply, adding demand to the respective edge.
to | Destination for supply. |
amount | Amount of supply to be delivered. |
Definition at line 258 of file linkgraphjob.h.
References node_anno, and LinkGraphJob::NodeAnnotation::undelivered_supply.
|
inline |
Iterator for the "end" of the edge array.
Only edges with capacity are iterated. The others are skipped.
Reimplemented from LinkGraph::ConstNode.
Definition at line 220 of file linkgraphjob.h.
References edge_annos, and LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges.
Referenced by LinkGraphJob::~LinkGraphJob().
|
inline |
Get the flows running through this node.
Definition at line 232 of file linkgraphjob.h.
References LinkGraphJob::NodeAnnotation::flows, and node_anno.
Referenced by LinkGraphJob::~LinkGraphJob().
|
inline |
Get a constant version of the flows running through this node.
Definition at line 238 of file linkgraphjob.h.
References LinkGraphJob::NodeAnnotation::flows, and node_anno.
|
inline |
Retrieve an edge starting at this node.
Mind that this returns an object, not a reference.
to | Remote end of the edge. |
Reimplemented from LinkGraph::ConstNode.
Definition at line 206 of file linkgraphjob.h.
References edge_annos, and LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges.
|
inline |
Get the paths this node is part of.
Paths are always expected to be sorted so that those with flow == 0 are in the back of the list.
Definition at line 245 of file linkgraphjob.h.
References node_anno, and LinkGraphJob::NodeAnnotation::paths.
|
inline |
Get a constant version of the paths this node is part of.
Definition at line 251 of file linkgraphjob.h.
References node_anno, and LinkGraphJob::NodeAnnotation::paths.
|
inline |
Get amount of supply that hasn't been delivered, yet.
Definition at line 226 of file linkgraphjob.h.
References node_anno, and LinkGraphJob::NodeAnnotation::undelivered_supply.