# Path: osim/env/osim.py
# class OsimModel(object):
# class OsimEnv(gym.Env):
# class Spec(object):
# class L2M2019Env(OsimEnv):
#     def __init__(self, model_path, visualize, integrator_accuracy = 5e-5):
#     def list_elements(self):
#     def actuate(self, action):
#     def set_activations(self, activations):
#     def get_activations(self):
#     def compute_state_desc(self):
#     def get_state_desc(self):
#     def set_strength(self, strength):
#     def get_body(self, name):
#     def get_joint(self, name):
#     def get_muscle(self, name):
#     def get_marker(self, name):
#     def get_contact_geometry(self, name):
#     def get_force(self, name):
#     def get_action_space_size(self):
#     def set_integrator_accuracy(self, integrator_accuracy):
#     def reset_manager(self):
#     def reset(self):
#     def get_state(self):
#     def set_state(self, state):
#     def integrate(self):
#     def get_reward(self):
#     def is_done(self):
#     def __init__(self, visualize = True, integrator_accuracy = 5e-5):
#     def load_model(self, model_path = None):
#     def get_state_desc(self):
#     def get_prev_state_desc(self):
#     def get_observation(self):
#     def get_observation_dict(self):
#     def get_observation_space_size(self):
#     def get_action_space_size(self):
#     def reset(self, project=True, obs_as_dict=True):
#     def step(self, action, project=True, obs_as_dict=True):
#     def render(self, mode='human', close=False):
#     def __init__(self, *args, **kwargs):
#     def get_model_key(self):
#     def set_difficulty(self, difficulty):
#     def __init__(self, visualize=True, integrator_accuracy=5e-5, difficulty=3, seed=None, report=None):
#     def reset(self, project=True, seed=None, init_pose=None, obs_as_dict=True):
#     def load_model(self, model_path = None):
#     def step(self, action, project=True, obs_as_dict=True):
#     def change_model(self, model='3D', difficulty=3, seed=0):
#     def is_done(self):
#     def update_footstep(self):
#     def get_observation_dict(self):
#     def get_observation(self):
#     def get_observation_clipped(self):
#     def get_observation_space_size(self):
#     def get_state_desc(self):
#     def init_reward(self):
#     def init_reward_1(self):
#     def get_reward(self):
#     def get_reward_1(self): # for L2M2019 Round 1
#     def get_reward_2(self): # for L2M2019 Round 2
# def rotate_frame(x, y, theta):
#     MASS = 75.16460000000001 # 11.777 + 2*(9.3014 + 3.7075 + 0.1 + 1.25 + 0.2166) + 34.2366
#     G = 9.80665 # from gait1dof22muscle
#     LENGTH0 = 1 # leg length
#     INIT_POSE = np.array([
#         0, # forward speed
#         0, # rightward speed
#         0.94, # pelvis height
#         0*np.pi/180, # trunk lean
#         0*np.pi/180, # [right] hip adduct
#         0*np.pi/180, # hip flex
#         0*np.pi/180, # knee extend
#         0*np.pi/180, # ankle flex
#         0*np.pi/180, # [left] hip adduct
#         0*np.pi/180, # hip flex
#         0*np.pi/180, # knee extend
#         0*np.pi/180]) # ankle flex
#         QQ = state.getQ()
#         QQ[3] = 0 # x: (+) forward
#         QQ[5] = 0 # z: (+) right
#         QQ[1] = 0*np.pi/180 # roll
#         QQ[2] = 0*np.pi/180 # yaw
#         QQ[4] = init_pose[2] # pelvis height
#         QQ[0] = -init_pose[3] # trunk lean: (+) backward
#         QQ[7] = -init_pose[4] # right hip abduct
#         QQ[6] = -init_pose[5] # right hip flex
#         QQ[13] = init_pose[6] # right knee extend
#         QQ[15] = -init_pose[7] # right ankle flex
#         QQ[10] = -init_pose[8] # left hip adduct
#         QQ[9] = -init_pose[9] # left hip flex
#         QQ[14] = init_pose[10] # left knee extend
#         QQ[16] = -init_pose[11] # left ankle flex
#         ACT2 = 0
#         ACT2 = 0


from osim.env.osim import L2RunEnv
import pprint

env = L2RunEnv(visualize=True)

observation = env.reset()
for i in range(200):
    observation, reward, done, info = env.step(env.action_space.sample())
    print(len(observation))
#    pprint.pprint(env.get_state_desc())
    if done:

# Path: osim/env/osim.py
# class OsimModel(object):
# class OsimEnv(gym.Env):
# class Spec(object):
# class L2M2019Env(OsimEnv):
#     def __init__(self, model_path, visualize, integrator_accuracy = 5e-5):
#     def list_elements(self):
#     def actuate(self, action):
#     def set_activations(self, activations):
#     def get_activations(self):
#     def compute_state_desc(self):
#     def get_state_desc(self):
#     def set_strength(self, strength):
#     def get_body(self, name):
#     def get_joint(self, name):
#     def get_muscle(self, name):
#     def get_marker(self, name):
#     def get_contact_geometry(self, name):
#     def get_force(self, name):
#     def get_action_space_size(self):
#     def set_integrator_accuracy(self, integrator_accuracy):
#     def reset_manager(self):
#     def reset(self):
#     def get_state(self):
#     def set_state(self, state):
#     def integrate(self):
#     def get_reward(self):
#     def is_done(self):
#     def __init__(self, visualize = True, integrator_accuracy = 5e-5):
#     def load_model(self, model_path = None):
#     def get_state_desc(self):
#     def get_prev_state_desc(self):
#     def get_observation(self):
#     def get_observation_dict(self):
#     def get_observation_space_size(self):
#     def get_action_space_size(self):
#     def reset(self, project=True, obs_as_dict=True):
#     def step(self, action, project=True, obs_as_dict=True):
#     def render(self, mode='human', close=False):
#     def __init__(self, *args, **kwargs):
#     def get_model_key(self):
#     def set_difficulty(self, difficulty):
#     def __init__(self, visualize=True, integrator_accuracy=5e-5, difficulty=3, seed=None, report=None):
#     def reset(self, project=True, seed=None, init_pose=None, obs_as_dict=True):
#     def load_model(self, model_path = None):
#     def step(self, action, project=True, obs_as_dict=True):
#     def change_model(self, model='3D', difficulty=3, seed=0):
#     def is_done(self):
#     def update_footstep(self):
#     def get_observation_dict(self):
#     def get_observation(self):
#     def get_observation_clipped(self):
#     def get_observation_space_size(self):
#     def get_state_desc(self):
#     def init_reward(self):
#     def init_reward_1(self):
#     def get_reward(self):
#     def get_reward_1(self): # for L2M2019 Round 1
#     def get_reward_2(self): # for L2M2019 Round 2
# def rotate_frame(x, y, theta):
#     MASS = 75.16460000000001 # 11.777 + 2*(9.3014 + 3.7075 + 0.1 + 1.25 + 0.2166) + 34.2366
#     G = 9.80665 # from gait1dof22muscle
#     LENGTH0 = 1 # leg length
#     INIT_POSE = np.array([
#         0, # forward speed
#         0, # rightward speed
#         0.94, # pelvis height
#         0*np.pi/180, # trunk lean
#         0*np.pi/180, # [right] hip adduct
#         0*np.pi/180, # hip flex
#         0*np.pi/180, # knee extend
#         0*np.pi/180, # ankle flex
#         0*np.pi/180, # [left] hip adduct
#         0*np.pi/180, # hip flex
#         0*np.pi/180, # knee extend
#         0*np.pi/180]) # ankle flex
#         QQ = state.getQ()
#         QQ[3] = 0 # x: (+) forward
#         QQ[5] = 0 # z: (+) right
#         QQ[1] = 0*np.pi/180 # roll
#         QQ[2] = 0*np.pi/180 # yaw
#         QQ[4] = init_pose[2] # pelvis height
#         QQ[0] = -init_pose[3] # trunk lean: (+) backward
#         QQ[7] = -init_pose[4] # right hip abduct
#         QQ[6] = -init_pose[5] # right hip flex
#         QQ[13] = init_pose[6] # right knee extend
#         QQ[15] = -init_pose[7] # right ankle flex
#         QQ[10] = -init_pose[8] # left hip adduct
#         QQ[9] = -init_pose[9] # left hip flex
#         QQ[14] = init_pose[10] # left knee extend
#         QQ[16] = -init_pose[11] # left ankle flex
#         ACT2 = 0
#         ACT2 = 0


# Path: examples/under-construction/runenv.py
from osim.env.osim import L2RunEnv
import pprint


env = L2RunEnv(visualize=True)

observation = env.reset()
for i in range(200):
    observation, reward, done, info = env.step(env.action_space.sample())
    print(len(observation))
#    pprint.pprint(env.get_state_desc())
    if done:

        env.reset()