The Python JSON engine can be used to easily integrate simulators with a Python API. There is a minimal working example with two Python JSON engines exchanging simulation time, located in examples/tf_exchange directory. We explain how to run it on this page.
In order to create your engine, you can use examples/tf_exchange/engine_1.py (listed below) as a reference. Just modify the following methods of the Script
class to suit your needs:
initialize()
: executed when the engine is initializedrunLoop(timestep)
: executed when the engine is requested to advance its simulation (from EngineClient::runLoopStep)shutdown()
: executed when the engine is requested to shutdownMore details about the EngineScript
and other Python JSON engine components can be found here.