OpenTTD Source 20260311-master-g511d3794ce
linkgraph_type.h File Reference

Declaration of link graph types used for cargo distribution. More...

Go to the source code of this file.

Typedefs

using LinkGraphID = PoolID<uint16_t, struct LinkGraphIDTag, 0xFFFF, 0xFFFF>
using LinkGraphJobID = PoolID<uint16_t, struct LinkGraphJobIDTag, 0xFFFF, 0xFFFF>
typedef uint16_t NodeID
using EdgeUpdateModes = EnumBitSet<EdgeUpdateMode, uint8_t>

Enumerations

enum class  DistributionType : uint8_t {
  Min = 0 , Manual = 0 , Asymmetric = 1 , MaxNonSymmetric = 1 ,
  Symmetric = 2 , Max = 2
}
 Distribution types. More...
enum class  EdgeUpdateMode : uint8_t { Increase , Refresh , Restricted , Unrestricted }
 Special modes for updating links. More...

Variables

static const NodeID INVALID_NODE = UINT16_MAX

Detailed Description

Declaration of link graph types used for cargo distribution.

Definition in file linkgraph_type.h.

Typedef Documentation

◆ EdgeUpdateModes

using EdgeUpdateModes = EnumBitSet<EdgeUpdateMode, uint8_t>

Definition at line 53 of file linkgraph_type.h.

◆ LinkGraphID

using LinkGraphID = PoolID<uint16_t, struct LinkGraphIDTag, 0xFFFF, 0xFFFF>

Definition at line 15 of file linkgraph_type.h.

◆ LinkGraphJobID

using LinkGraphJobID = PoolID<uint16_t, struct LinkGraphJobIDTag, 0xFFFF, 0xFFFF>

Definition at line 16 of file linkgraph_type.h.

◆ NodeID

typedef uint16_t NodeID

Definition at line 18 of file linkgraph_type.h.

Enumeration Type Documentation

◆ DistributionType

enum class DistributionType : uint8_t
strong

Distribution types.

Enumerator
Min 

Minimal value of Distribution type.

Manual 

Manual distribution. No link graph calculations are run.

Asymmetric 

Asymmetric distribution. Usually cargo will only travel in one direction.

MaxNonSymmetric 

Maximum non-symmetric distribution.

Symmetric 

Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes.

Max 

Maximal value of Distribution type.

Definition at line 24 of file linkgraph_type.h.

◆ EdgeUpdateMode

enum class EdgeUpdateMode : uint8_t
strong

Special modes for updating links.

'Restricted' means that vehicles with 'no loading' orders are serving the link. If a link is only served by such vehicles it's 'fully restricted'. This means the link can be used by cargo arriving in such vehicles, but not by cargo generated or transferring at the source station of the link. In order to find out about this condition we keep two update timestamps in each link, one for the restricted and one for the unrestricted part of it. If either one times out while the other is still valid the link becomes fully restricted or fully unrestricted, respectively. Refreshing a link makes just sure a minimum capacity is kept. Increasing actually adds the given capacity.

Enumerator
Increase 

Increase capacity.

Refresh 

Refresh capacity.

Restricted 

Use restricted link.

Unrestricted 

Use unrestricted link.

Definition at line 46 of file linkgraph_type.h.

Variable Documentation

◆ INVALID_NODE

const NodeID INVALID_NODE = UINT16_MAX
static

Definition at line 19 of file linkgraph_type.h.