OpenTTD Source  12.0-beta2
LinkGraphJob::Edge Class Reference

A job edge. More...

#include <linkgraphjob.h>

Inheritance diagram for LinkGraphJob::Edge:
LinkGraph::EdgeWrapper< Tedge >

Public Member Functions

 Edge (const LinkGraph::BaseEdge &edge, EdgeAnnotation &anno)
 Constructor. More...
 
uint Demand () const
 Get the transport demand between end the points of the edge. More...
 
uint UnsatisfiedDemand () const
 Get the transport demand that hasn't been satisfied by flows, yet. More...
 
uint Flow () const
 Get the total flow on the edge. More...
 
void AddFlow (uint flow)
 Add some flow. More...
 
void RemoveFlow (uint flow)
 Remove some flow. More...
 
void AddDemand (uint demand)
 Add some (not yet satisfied) demand. More...
 
void SatisfyDemand (uint demand)
 Satisfy some demand. More...
 
- Public Member Functions inherited from LinkGraph::EdgeWrapper< Tedge >
 EdgeWrapper (Tedge &edge)
 Wrap a an edge. More...
 
uint Capacity () const
 Get edge's capacity. More...
 
uint Usage () const
 Get edge's usage. More...
 
uint32 TravelTime () const
 Get edge's average travel time. More...
 
Date LastUnrestrictedUpdate () const
 Get the date of the last update to the edge's unrestricted capacity. More...
 
Date LastRestrictedUpdate () const
 Get the date of the last update to the edge's restricted capacity. More...
 
Date LastUpdate () const
 Get the date of the last update to any part of the edge's capacity. More...
 

Private Attributes

EdgeAnnotationanno
 Annotation being wrapped.
 

Additional Inherited Members

- Protected Attributes inherited from LinkGraph::EdgeWrapper< Tedge >
Tedge & edge
 Actual edge to be used.
 

Detailed Description

A job edge.

Wraps a link graph edge and an edge annotation. The annotation can be modified, the edge is constant.

Definition at line 78 of file linkgraphjob.h.

Constructor & Destructor Documentation

◆ Edge()

LinkGraphJob::Edge::Edge ( const LinkGraph::BaseEdge edge,
EdgeAnnotation anno 
)
inline

Constructor.

Parameters
edgeLink graph edge to be wrapped.
annoAnnotation to be wrapped.

Definition at line 87 of file linkgraphjob.h.

Member Function Documentation

◆ AddDemand()

void LinkGraphJob::Edge::AddDemand ( uint  demand)
inline

Add some (not yet satisfied) demand.

Parameters
demandDemand to be added.

Definition at line 128 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::demand, and LinkGraphJob::EdgeAnnotation::unsatisfied_demand.

◆ AddFlow()

void LinkGraphJob::Edge::AddFlow ( uint  flow)
inline

Add some flow.

Parameters
flowFlow to be added.

Definition at line 112 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::flow.

Referenced by Path::AddFlow().

◆ Demand()

uint LinkGraphJob::Edge::Demand ( ) const
inline

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

Returns
Demand.

Definition at line 94 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::demand.

◆ Flow()

uint LinkGraphJob::Edge::Flow ( ) const
inline

Get the total flow on the edge.

Returns
Flow.

Definition at line 106 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::flow.

Referenced by Path::AddFlow().

◆ RemoveFlow()

void LinkGraphJob::Edge::RemoveFlow ( uint  flow)
inline

Remove some flow.

Parameters
flowFlow to be removed.

Definition at line 118 of file linkgraphjob.h.

References anno, and LinkGraphJob::EdgeAnnotation::flow.

◆ SatisfyDemand()

void LinkGraphJob::Edge::SatisfyDemand ( uint  demand)
inline

Satisfy some demand.

Parameters
demandDemand to be satisfied.

Definition at line 138 of file linkgraphjob.h.

References anno, and LinkGraphJob::EdgeAnnotation::unsatisfied_demand.

◆ UnsatisfiedDemand()

uint LinkGraphJob::Edge::UnsatisfiedDemand ( ) const
inline

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

Returns
Unsatisfied demand.

Definition at line 100 of file linkgraphjob.h.

References LinkGraphJob::EdgeAnnotation::unsatisfied_demand.


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