OpenTTD Source 20260206-master-g4d4e37dbf1
FlowStatMap Class Reference

Flow descriptions by origin stations. More...

#include <station_base.h>

Inheritance diagram for FlowStatMap:

Public Member Functions

uint GetFlow () const
 Get the sum of all flows from this FlowStatMap.
uint GetFlowVia (StationID via) const
 Get the sum of flows via a specific station from this FlowStatMap.
uint GetFlowFrom (StationID from) const
 Get the sum of flows from a specific station from this FlowStatMap.
uint GetFlowFromVia (StationID from, StationID via) const
 Get the flow from a specific station via a specific other station.
void AddFlow (StationID origin, StationID via, uint amount)
 Add some flow from "origin", going via "via".
void PassOnFlow (StationID origin, StationID via, uint amount)
 Pass on some flow, remembering it as invalid, for later subtraction from locally consumed flow.
std::vector< StationID > DeleteFlows (StationID via)
 Delete all flows at a station for specific cargo and destination.
void RestrictFlows (StationID via)
 Restrict all flows at a station for specific cargo and destination.
void ReleaseFlows (StationID via)
 Release all flows at a station for specific cargo and destination.
void FinalizeLocalConsumption (StationID self)
 Subtract invalid flows from locally consumed flow.

Detailed Description

Flow descriptions by origin stations.

Definition at line 149 of file station_base.h.

Member Function Documentation

◆ AddFlow()

void FlowStatMap::AddFlow ( StationID origin,
StationID via,
uint flow )

Add some flow from "origin", going via "via".

Parameters
originOrigin of the flow.
viaNext hop.
flowAmount of flow to be added.

Definition at line 5219 of file station_cmd.cpp.

◆ DeleteFlows()

std::vector< StationID > FlowStatMap::DeleteFlows ( StationID via)

Delete all flows at a station for specific cargo and destination.

Parameters
viaRemote station of flows to be deleted.
Returns
IDs of source stations for which the complete FlowStat, not only a share, has been erased.

Definition at line 5281 of file station_cmd.cpp.

References FlowStat::ChangeShare(), and FlowStat::GetShares().

Referenced by DeleteStaleLinks(), and LinkGraphJob::~LinkGraphJob().

◆ FinalizeLocalConsumption()

void FlowStatMap::FinalizeLocalConsumption ( StationID self)

Subtract invalid flows from locally consumed flow.

Parameters
selfID of own station.

Definition at line 5256 of file station_cmd.cpp.

References FlowStat::ChangeShare(), FlowStat::GetShare(), and FlowStat::GetShares().

Referenced by FlowMapper::Run().

◆ GetFlow()

uint FlowStatMap::GetFlow ( ) const

Get the sum of all flows from this FlowStatMap.

Returns
sum of all flows.

Definition at line 5323 of file station_cmd.cpp.

◆ GetFlowFrom()

uint FlowStatMap::GetFlowFrom ( StationID from) const

Get the sum of flows from a specific station from this FlowStatMap.

Parameters
fromOrigin station to look for.
Returns
all flows from 'from' added up.

Definition at line 5351 of file station_cmd.cpp.

◆ GetFlowFromVia()

uint FlowStatMap::GetFlowFromVia ( StationID from,
StationID via ) const

Get the flow from a specific station via a specific other station.

Parameters
fromOrigin station to look for.
viaRemote station to look for.
Returns
flow share originating at 'from' and going to 'via'.

Definition at line 5364 of file station_cmd.cpp.

◆ GetFlowVia()

uint FlowStatMap::GetFlowVia ( StationID via) const

Get the sum of flows via a specific station from this FlowStatMap.

Parameters
viaRemote station to look for.
Returns
all flows for 'via' added up.

Definition at line 5337 of file station_cmd.cpp.

Referenced by LinkGraphOverlay::AddLinks().

◆ PassOnFlow()

void FlowStatMap::PassOnFlow ( StationID origin,
StationID via,
uint flow )

Pass on some flow, remembering it as invalid, for later subtraction from locally consumed flow.

This is necessary because we can't have negative flows and we don't want to sort the flows before adding them up.

Parameters
originOrigin of the flow.
viaNext hop.
flowAmount of flow to be passed.

Definition at line 5238 of file station_cmd.cpp.

References FlowStat::AppendShare().

◆ ReleaseFlows()

void FlowStatMap::ReleaseFlows ( StationID via)

Release all flows at a station for specific cargo and destination.

Parameters
viaRemote station of flows to be released.

Definition at line 5312 of file station_cmd.cpp.

◆ RestrictFlows()

void FlowStatMap::RestrictFlows ( StationID via)

Restrict all flows at a station for specific cargo and destination.

Parameters
viaRemote station of flows to be restricted.

Definition at line 5301 of file station_cmd.cpp.

Referenced by DeleteStaleLinks(), and LinkGraphJob::~LinkGraphJob().


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