opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
model_state.h
Go to the documentation of this file.
1#pragma once
2
4#include <libopynsim/symbol.h>
5
7
8#include <unordered_map>
9
10namespace opyn { class Model; }
11namespace SimTK { class State; }
12
13namespace opyn
14{
15 // Represents all state information for a `Model`.
16 //
17 // Related: https://simtk.org/api_docs/simbody/3.5/classSimTK_1_1State.html#details
18 // Related: https://opensimconfluence.atlassian.net/wiki/spaces/OpenSim/pages/53089017/SimTK+Simulation+Concepts
19 class ModelState final {
20 public:
21 using attrs_type = std::unordered_map<Symbol, double>;
22
25
26 explicit ModelState(SimTK::State&&);
27
30
32 double time() const;
33
35 const attrs_type& attrs() const;
36
38 void set_attrs(attrs_type new_attrs);
39
41 const SimTK::State& simbody_state() const;
42
44 SimTK::State& upd_simbody_state();
45
46 private:
47 class Impl;
49 };
50}
Definition model_state.h:19
SimTK::State & upd_simbody_state()
Returns the underlying SimTK::State (internal method: be careful with this).
ModelState()
Constructs an empty model state.
ModelState(SimTK::State &&)
ModelStateStage stage() const
Returns the ModelStateStage that this state has been realized to.
std::unordered_map< Symbol, double > attrs_type
Definition model_state.h:21
void set_attrs(attrs_type new_attrs)
Sets the attrs of this ModelState to new_attrs.
double time() const
Returns the time point, in seconds, that this state represents.
const SimTK::State & simbody_state() const
Returns the underlying SimTK::State (internal method: be careful with this).
const attrs_type & attrs() const
Returns this ModelState's metadata (e.g. integrator stats, performance counters).
Definition copy_on_upd_ptr.h:22
Definition custom_decoration_generator.h:6
Definition component_registry.h:14
ModelStateStage
Definition model_state_stage.h:11