OpenTTD
Public Member Functions | Private Attributes
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.
uint Demand () const
 Get the transport demand between end the points of the edge.
uint UnsatisfiedDemand () const
 Get the transport demand that hasn't been satisfied by flows, yet.
uint Flow () const
 Get the total flow on the edge.
void AddFlow (uint flow)
 Add some flow.
void RemoveFlow (uint flow)
 Remove some flow.
void AddDemand (uint demand)
 Add some (not yet satisfied) demand.
void SatisfyDemand (uint demand)
 Satisfy some demand.
- Public Member Functions inherited from LinkGraph::EdgeWrapper< Tedge >
 EdgeWrapper (Tedge &edge)
 Wrap a an edge.
uint Capacity () const
 Get edge's capacity.
uint Usage () const
 Get edge's usage.
Date LastUnrestrictedUpdate () const
 Get the date of the last update to the edge's unrestricted capacity.
Date LastRestrictedUpdate () const
 Get the date of the last update to the edge's restricted capacity.
Date LastUpdate () const
 Get the date of the last update to any part of the edge's capacity.

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 77 of file linkgraphjob.h.

Constructor & Destructor Documentation

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 86 of file linkgraphjob.h.

Member Function Documentation

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

Add some (not yet satisfied) demand.

Parameters
demandDemand to be added.

Definition at line 127 of file linkgraphjob.h.

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

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

Add some flow.

Parameters
flowFlow to be added.

Definition at line 111 of file linkgraphjob.h.

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

Referenced by Path::AddFlow().

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

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

Returns
Demand.

Definition at line 93 of file linkgraphjob.h.

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

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

Get the total flow on the edge.

Returns
Flow.

Definition at line 105 of file linkgraphjob.h.

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

Referenced by Path::AddFlow().

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

Remove some flow.

Parameters
flowFlow to be removed.

Definition at line 117 of file linkgraphjob.h.

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

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

Satisfy some demand.

Parameters
demandDemand to be satisfied.

Definition at line 137 of file linkgraphjob.h.

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

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

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

Returns
Unsatisfied demand.

Definition at line 99 of file linkgraphjob.h.

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


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