Update: Translations from eints
[openttd-github.git] / src / linkgraph / flowmapper.h
blobc59aa3f52757e5947e8db3d87072ff1cefcc780a
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file flowmapper.h Declaration of flow mapper; maps paths into flows at nodes. */
10 #ifndef FLOWMAPPER_H_
11 #define FLOWMAPPER_H_
13 #include "linkgraphjob_base.h"
15 /**
16 * Map the path trees generated by the MCF solver into flows. The path tree is
17 * useful to cache capacities and distances and allow quick disconnecting and
18 * reconnecting to other paths. The flows show how much cargo from which nodes
19 * is to be routed in which direction at a given node. This is what we need in
20 * the end.
22 class FlowMapper : public ComponentHandler {
23 public:
25 /**
26 * Create a flow mapper.
27 * @param scale Whether the flow mapper should scale all flows to monthly
28 * values. Only do that on the very last flow mapping.
30 FlowMapper(bool scale) : scale(scale) {}
31 void Run(LinkGraphJob &job) const override;
33 private:
35 /**
36 * Whether the flow mapper should scale all flows to monthly values.
38 const bool scale;
41 #endif /* FLOWMAPPER_H_ */