OpenTTD Source 20241224-master-gf74b0cf984
|
Map the path trees generated by the MCF solver into flows. More...
#include <flowmapper.h>
Public Member Functions | |
FlowMapper (bool scale) | |
Create a flow mapper. | |
void | Run (LinkGraphJob &job) const override |
Map the paths generated by the MCF solver into flows associated with nodes. | |
Public Member Functions inherited from ComponentHandler | |
virtual | ~ComponentHandler ()=default |
Destroy the handler. | |
Private Attributes | |
const bool | scale |
Whether the flow mapper should scale all flows to monthly values. | |
Map the path trees generated by the MCF solver into flows.
The path tree is useful to cache capacities and distances and allow quick disconnecting and reconnecting to other paths. The flows show how much cargo from which nodes is to be routed in which direction at a given node. This is what we need in the end.
Definition at line 22 of file flowmapper.h.
|
inline |
Create a flow mapper.
scale | Whether the flow mapper should scale all flows to monthly values. Only do that on the very last flow mapping. |
Definition at line 30 of file flowmapper.h.
|
overridevirtual |
Map the paths generated by the MCF solver into flows associated with nodes.
job | the link graph component to be used. |
Implements ComponentHandler.
Definition at line 19 of file flowmapper.cpp.
References FlowStatMap::FinalizeLocalConsumption(), LinkGraphJob::JoinDate(), LinkGraphJob::LastCompression(), LinkGraphSettings::recalc_time, scale, TimerGameConst< struct Calendar >::SECONDS_PER_DAY, LinkGraphJob::Settings(), LinkGraphJob::Size(), and LinkGraph::BaseNode::station.
|
private |
Whether the flow mapper should scale all flows to monthly values.
Definition at line 38 of file flowmapper.h.
Referenced by Run().