/* Some sizes */ #define N_STATE_DIMENSIONS 10 #define N_ACTION_DIMENSIONS 2 /* State vector indices */ #define S_X 0 #define S_Y 1 #define S_A0 2 #define S_HIPL 3 #define S_KNEEL 4 #define S_XD 5 #define S_YD 6 #define S_A0D 7 #define S_HIPLD 8 #define S_KNEELD 9 /* Action vector indices */ #define A_HIPL 0 #define A_KNEEL 1 /* Treat the contents of this definition as hidden */ typedef struct dynamics_struct { double time; // current time in simulation double timestep; // Timestep of simulation double state[N_STATE_DIMENSIONS]; unsigned seed; /* random number generator seed for rand_r() */ } Dynamics; /* The dynamics API */ int init_dynamics(); Dynamics *create_dynamics(); int set_state( Dynamics *d, double time, double *state ); int integrate_one_step( Dynamics *d, double *action, double *next_state ); int integrate_one_step_alt( Dynamics *d, double *state, double *action, double *next_state ); double one_step_cost( Dynamics *d, double *state, double *action );