OpenTTD Source
20241108-master-g80f628063a
|
Flow descriptions by origin stations. More...
#include <station_base.h>
Public Member Functions | |
uint | GetFlow () const |
Get the sum of all flows from this FlowStatMap. More... | |
uint | GetFlowVia (StationID via) const |
Get the sum of flows via a specific station from this FlowStatMap. More... | |
uint | GetFlowFrom (StationID from) const |
Get the sum of flows from a specific station from this FlowStatMap. More... | |
uint | GetFlowFromVia (StationID from, StationID via) const |
Get the flow from a specific station via a specific other station. More... | |
void | AddFlow (StationID origin, StationID via, uint amount) |
Add some flow from "origin", going via "via". More... | |
void | PassOnFlow (StationID origin, StationID via, uint amount) |
Pass on some flow, remembering it as invalid, for later subtraction from locally consumed flow. More... | |
StationIDStack | DeleteFlows (StationID via) |
Delete all flows at a station for specific cargo and destination. More... | |
void | RestrictFlows (StationID via) |
Restrict all flows at a station for specific cargo and destination. More... | |
void | ReleaseFlows (StationID via) |
Release all flows at a station for specific cargo and destination. More... | |
void | FinalizeLocalConsumption (StationID self) |
Subtract invalid flows from locally consumed flow. More... | |
Flow descriptions by origin stations.
Definition at line 148 of file station_base.h.
Add some flow from "origin", going via "via".
origin | Origin of the flow. |
via | Next hop. |
flow | Amount of flow to be added. |
Definition at line 5011 of file station_cmd.cpp.
StationIDStack FlowStatMap::DeleteFlows | ( | StationID | via | ) |
Delete all flows at a station for specific cargo and destination.
via | Remote station of flows to be deleted. |
Definition at line 5073 of file station_cmd.cpp.
References FlowStat::ChangeShare(), FlowStat::GetShares(), and SmallStack< Titem, Tindex, Tinvalid, Tgrowth_step, Tmax_size >::Push().
void FlowStatMap::FinalizeLocalConsumption | ( | StationID | self | ) |
Subtract invalid flows from locally consumed flow.
self | ID of own station. |
Definition at line 5048 of file station_cmd.cpp.
References FlowStat::GetShare().
Referenced by FlowMapper::Run().
uint FlowStatMap::GetFlow | ( | ) | const |
Get the sum of all flows from this FlowStatMap.
Definition at line 5115 of file station_cmd.cpp.
uint FlowStatMap::GetFlowFrom | ( | StationID | from | ) | const |
Get the sum of flows from a specific station from this FlowStatMap.
from | Origin station to look for. |
Definition at line 5143 of file station_cmd.cpp.
Get the flow from a specific station via a specific other station.
from | Origin station to look for. |
via | Remote station to look for. |
Definition at line 5156 of file station_cmd.cpp.
uint FlowStatMap::GetFlowVia | ( | StationID | via | ) | const |
Get the sum of flows via a specific station from this FlowStatMap.
via | Remote station to look for. |
Definition at line 5129 of file station_cmd.cpp.
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.
origin | Origin of the flow. |
via | Next hop. |
flow | Amount of flow to be passed. |
Definition at line 5030 of file station_cmd.cpp.
References FlowStat::AppendShare().
void FlowStatMap::ReleaseFlows | ( | StationID | via | ) |
Release all flows at a station for specific cargo and destination.
via | Remote station of flows to be released. |
Definition at line 5104 of file station_cmd.cpp.
void FlowStatMap::RestrictFlows | ( | StationID | via | ) |
Restrict all flows at a station for specific cargo and destination.
via | Remote station of flows to be restricted. |
Definition at line 5093 of file station_cmd.cpp.