OpenTTD Source  20241121-master-g67a0fccfad
LinkGraphJob::NodeAnnotation Struct Reference

Annotation for a link graph node. More...

#include <linkgraphjob.h>

Public Member Functions

 NodeAnnotation (const LinkGraph::BaseNode &node, size_t size)
 
EdgeAnnotationoperator[] (NodeID to)
 Retrieve an edge starting at this node. More...
 
const EdgeAnnotationoperator[] (NodeID to) const
 Retrieve an edge starting at this node. More...
 
uint DemandTo (NodeID to) const
 Get the transport demand between end the points of the edge. More...
 
uint UnsatisfiedDemandTo (NodeID to) const
 Get the transport demand that hasn't been satisfied by flows, yet. More...
 
void SatisfyDemandTo (NodeID to, uint demand)
 Satisfy some demand. More...
 
void DeliverSupply (NodeID to, uint amount)
 Deliver some supply, adding demand to the respective edge. More...
 

Data Fields

const LinkGraph::BaseNodebase
 Reference to the node that is annotated.
 
uint undelivered_supply
 Amount of supply that hasn't been distributed yet.
 
PathList paths
 Paths through this node, sorted so that those with flow == 0 are in the back.
 
FlowStatMap flows
 Planned flows to other nodes.
 
std::vector< EdgeAnnotationedges
 Annotations for all edges originating at this node.
 
std::vector< DemandAnnotationdemands
 Annotations for the demand to all other nodes.
 

Detailed Description

Annotation for a link graph node.

Definition at line 80 of file linkgraphjob.h.

Member Function Documentation

◆ DeliverSupply()

void LinkGraphJob::NodeAnnotation::DeliverSupply ( NodeID  to,
uint  amount 
)
inline

Deliver some supply, adding demand to the respective edge.

Parameters
toDestination for supply.
amountAmount of supply to be delivered.

Definition at line 148 of file linkgraphjob.h.

◆ DemandTo()

uint LinkGraphJob::NodeAnnotation::DemandTo ( NodeID  to) const
inline

Get the transport demand between end the points of the edge.

Returns
Demand.

Definition at line 125 of file linkgraphjob.h.

◆ operator[]() [1/2]

EdgeAnnotation& LinkGraphJob::NodeAnnotation::operator[] ( NodeID  to)
inline

Retrieve an edge starting at this node.

Parameters
toRemote end of the edge.
Returns
Edge between this node and "to".

Definition at line 102 of file linkgraphjob.h.

◆ operator[]() [2/2]

const EdgeAnnotation& LinkGraphJob::NodeAnnotation::operator[] ( NodeID  to) const
inline

Retrieve an edge starting at this node.

Parameters
toRemote end of the edge.
Returns
Edge between this node and "to".

Definition at line 114 of file linkgraphjob.h.

◆ SatisfyDemandTo()

void LinkGraphJob::NodeAnnotation::SatisfyDemandTo ( NodeID  to,
uint  demand 
)
inline

Satisfy some demand.

Parameters
demandDemand to be satisfied.

Definition at line 137 of file linkgraphjob.h.

References demands.

◆ UnsatisfiedDemandTo()

uint LinkGraphJob::NodeAnnotation::UnsatisfiedDemandTo ( NodeID  to) const
inline

Get the transport demand that hasn't been satisfied by flows, yet.

Returns
Unsatisfied demand.

Definition at line 131 of file linkgraphjob.h.


The documentation for this struct was generated from the following file: