(svn r27729) -Codechange: Do not count static NewGRF when checking for the maximum...
[openttd.git] / src / linkgraph / flowmapper.h
blob6f874e5b305e92fd91885a4769259fdb7b174749
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file flowmapper.h Declaration of flow mapper; maps paths into flows at nodes. */
12 #ifndef FLOWMAPPER_H_
13 #define FLOWMAPPER_H_
15 #include "linkgraphjob_base.h"
17 /**
18 * Map the path trees generated by the MCF solver into flows. The path tree is
19 * useful to cache capacities and distances and allow quick disconnecting and
20 * reconnecting to other paths. The flows show how much cargo from which nodes
21 * is to be routed in which direction at a given node. This is what we need in
22 * the end.
24 class FlowMapper : public ComponentHandler {
25 public:
27 /**
28 * Create a flow mapper.
29 * @param scale Whether the flow mapper should scale all flows to monthly
30 * values. Only do that on the very last flow mapping.
32 FlowMapper(bool scale) : scale(scale) {}
33 virtual void Run(LinkGraphJob &job) const;
35 /**
36 * Virtual destructor has to be defined because of virtual Run().
38 virtual ~FlowMapper() {}
39 private:
41 /**
42 * Whether the flow mapper should scale all flows to monthly values.
44 const bool scale;
47 #endif /* FLOWMAPPER_H_ */