OpenTTD Source: LinkGraphJob::NodeAnnotation Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
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)
EdgeAnnotation & | operator[] (NodeID to)
| Retrieve an edge starting at this node.
const EdgeAnnotation & | operator[] (NodeID to) const
| Retrieve an edge starting at this node.
uint | DemandTo (NodeID to) const
| Get the transport demand between end the points of the edge.
uint | UnsatisfiedDemandTo (NodeID to) const
| Get the transport demand that hasn't been satisfied by flows, yet.
void | SatisfyDemandTo (NodeID to, uint demand)
| Satisfy some demand.
void | DeliverSupply (NodeID to, uint amount)
| Deliver some supply, adding demand to the respective edge.

## Data Fields
const LinkGraph::BaseNode & | base
| Reference to the node that is annotated.
uint | undelivered_supply = 0
| 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< EdgeAnnotation > | edges {}
| Annotations for all edges originating at this node.
std::vector< DemandAnnotation > | demands {}
| Annotations for the demand to all other nodes.

## Detailed Description

Annotation for a link graph node.

Definition at line 79 of file linkgraphjob.h.

## Constructor & Destructor Documentation

## ◆ NodeAnnotation()

LinkGraphJob::NodeAnnotation::NodeAnnotation | ( | const LinkGraph::BaseNode & | node,
|  | size_t | size
| ) |  |
| inline

Definition at line 89 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

  to | Destination for supply.
  amount | Amount of supply to be delivered.

Definition at line 147 of file linkgraphjob.h.

References demands.

## ◆ 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 124 of file linkgraphjob.h.

References demands.

## ◆ operator[]() [1/2]

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

Retrieve an edge starting at this node.

Parameters

  to | Remote end of the edge.

Returns
  Edge between this node and "to".

Definition at line 101 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::base, LinkGraph::BaseEdge::dest_node, and edges.

## ◆ operator[]() [2/2]

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

Retrieve an edge starting at this node.

Parameters

  to | Remote end of the edge.

Returns
  Edge between this node and "to".

Definition at line 113 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::base, LinkGraph::BaseEdge::dest_node, and edges.

## ◆ SatisfyDemandTo()

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

Satisfy some demand.

Parameters

  demand | Demand to be satisfied.

Definition at line 136 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 130 of file linkgraphjob.h.

References demands.

## Field Documentation

## ◆ base

const LinkGraph::BaseNode& LinkGraphJob::NodeAnnotation::base

Reference to the node that is annotated.

Definition at line 80 of file linkgraphjob.h.

Referenced by LinkGraphJob::~LinkGraphJob().

## ◆ demands

std::vector<DemandAnnotation> LinkGraphJob::NodeAnnotation::demands {}

Annotations for the demand to all other nodes.

Definition at line 87 of file linkgraphjob.h.

Referenced by DeliverSupply(), DemandTo(), SatisfyDemandTo(), and UnsatisfiedDemandTo().

## ◆ edges

std::vector<EdgeAnnotation> LinkGraphJob::NodeAnnotation::edges {}

Annotations for all edges originating at this node.

Definition at line 86 of file linkgraphjob.h.

Referenced by operator[](), operator[](), and LinkGraphJob::~LinkGraphJob().

## ◆ flows

FlowStatMap LinkGraphJob::NodeAnnotation::flows {}

Planned flows to other nodes.

Definition at line 84 of file linkgraphjob.h.

Referenced by LinkGraphJob::~LinkGraphJob().

## ◆ paths

PathList LinkGraphJob::NodeAnnotation::paths {}

Paths through this node, sorted so that those with flow == 0 are in the back.

Definition at line 83 of file linkgraphjob.h.

## ◆ undelivered_supply

uint LinkGraphJob::NodeAnnotation::undelivered_supply = 0

Amount of supply that hasn't been distributed yet.

Definition at line 82 of file linkgraphjob.h.

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

- src/linkgraph/linkgraphjob.h