class FTILoop

Overview

Manages simulation loop. Runs physics and brain interface, and synchronizes them via Transfer Functions. More…

#include <fti_loop.h>

class FTILoop: public PtrTemplates {
public:
    // construction

    FTILoop();

    FTILoop(
        jsonSharedPtr config,
        DataPackProcessor::engine_interfaces_t engines,
        SimulationDataManager* simulationDataManager
    );

    // methods

    void initLoop();
    void resetLoop();
    void shutdownLoop();
    void waitForEngines();
    void runLoop(SimulationTime runLoopTime);
    SimulationTime getSimTime() const;
};

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<T> shared_ptr;
    typedef std::shared_ptr<const T> const_shared_ptr;
    typedef std::unique_ptr<T> unique_ptr;
    typedef std::unique_ptr<const T> const_unique_ptr;

Detailed Documentation

Manages simulation loop. Runs physics and brain interface, and synchronizes them via Transfer Functions.

Methods

void initLoop()

Initialize engines before running loop.

void resetLoop()

Reset engines of the loop.

void shutdownLoop()

Shutdown engines.

void waitForEngines()

Blocks until all running Engines finishe their execution.

void runLoop(SimulationTime runLoopTime)

Runs simulation for a total of runLoopTime (in s)

Parameters:

runLoopTime

Time (in s) to run simulation. At end, will run TransceiverFunctions

SimulationTime getSimTime() const

Get Simulation Time (in seconds)

Returns:

Returns time passed in simulation (in seconds)