statefulNumbaModel
-
class StatefulNumbaModel : public NumbaModel, public StatefulSysModel
- #include <statefulNumbaModel.h>
SysModel that combines
NumbaModelwithStatefulSysModel.This class combines
NumbaModel(JIT-compiledUpdateStateImpl) with StatefulSysModel (continuous-time states integrated by MJScene’s solver).Users subclass this in Python by inheriting from StatefulNumbaModel and:
Overriding registerStates() to register state variables.
Providing a static UpdateStateImpl() method (compiled to a Numba cfunc).
State and derivative arrays are accessible in
UpdateStateImplvia parameters namednameStateandnameStateDeriv, resolved from attributes such asself.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.