statefulNumbaModel

class StatefulNumbaModel : public NumbaModel, public StatefulSysModel
#include <statefulNumbaModel.h>

SysModel that combines NumbaModel with StatefulSysModel.

This class combines NumbaModel (JIT-compiled UpdateStateImpl) with StatefulSysModel (continuous-time states integrated by MJScene’s solver).

Users subclass this in Python by inheriting from StatefulNumbaModel and:

  1. Overriding registerStates() to register state variables.

  2. Providing a static UpdateStateImpl() method (compiled to a Numba cfunc).

State and derivative arrays are accessible in UpdateStateImpl via parameters named nameState and nameStateDeriv, resolved from attributes such as self.posState.

All NumbaModel features (messages, memory, rng, bskLogger) are also available.

Public Functions

StatefulNumbaModel() = default

Default constructor

void Reset(uint64_t CurrentSimNanos) override

Delegates to NumbaModel::Reset (C++ clear + triggers Python _nbm_compile)

void UpdateState(uint64_t CurrentSimNanos) override

Delegates to NumbaModel::UpdateState (calls the compiled cfunc)

virtual void registerStates(DynParamRegisterer registerer) override = 0

Must be overridden by user subclasses to register their state variables.