Platform#

Class architecture#

The following code is typical lines in main file:

runner = SequentialRunner(
    settings=setting_dict_or_json,
    prng=random.Random(seed),
    logger=MarketStepPrintLogger(),
)
runner.main()

As this code representing, the simulation is fully controlled by a runner, in this case, SequentialRunner . Runner usually accepts setting dictionary, a pseudo random number generator, and a logger.

The following figure shows the class architecture.

../_images/class-architecture.png

Main usually has a logger and generating runner. As a runner, Parallel Runner or Sequential Runner is available. Runner will generate simulator and some other components such as markets, agents, and events. Then, runner control all the components and simulator for it rule. On the other hand, simulator provide API interface for runners to define the procedure controlling simulation. Moreover, simulator and its components generate logs and push it to logger.

The key concept of this platform is that runner is replaceable to realize more complex simulator controlling.