Definition of link graph classes used for cargo distribution. More...
#include "../stdafx.h"
#include "../map_func.h"
#include "../core/bitmath_func.hpp"
#include "../debug.h"
#include "../window_func.h"
#include "../window_gui.h"
#include "../moving_average.h"
#include "linkgraph.h"
#include "demands.h"
#include "mcf.h"
#include "flowmapper.h"
#include <queue>
Go to the source code of this file.
Functions | |
void | OnTick_LinkGraph () |
Spawn or join a link graph component if any link graph is due to do so. | |
void | InitializeLinkGraphs () |
Initialize all link graphs. | |
Variables | |
LinkGraph | _link_graphs [NUM_CARGO] |
Global array of link graphs, one for each cargo. |
Definition of link graph classes used for cargo distribution.
Definition in file linkgraph.cpp.
void InitializeLinkGraphs | ( | ) |
Initialize all link graphs.
Used when loading a game.
Definition at line 535 of file linkgraph.cpp.
References LinkGraphJob::AddHandler(), LinkGraphJob::ClearHandlers(), and NUM_CARGO.
Referenced by ShutdownGame().
void OnTick_LinkGraph | ( | ) |
Spawn or join a link graph component if any link graph is due to do so.
Spawning is done on COMPONENTS_SPAWN_TICK every day, joining on COMPONENT_JOIN_TICK. Each link graph is due every recalc_interval days.
Definition at line 171 of file linkgraph.cpp.
References _date, _date_fract, _settings_game, LinkGraph::COMPONENTS_JOIN_TICK, LinkGraph::COMPONENTS_SPAWN_TICK, DT_MANUAL, LinkGraph::Join(), GameSettings::linkgraph, LinkGraph::NextComponent(), NUM_CARGO, and LinkGraphSettings::recalc_interval.