<jupyter_start><jupyter_text>Base Agent<jupyter_code>%%time
info_log = []
forces = []

with SimulationEnvironment('scenes/basic_scene.ttt', headless_mode=False, foot_only_mode=True) as env:
    for i in range(1):
        agent = BaseAgent(random_mode=False, foot_only_mode=True)
        
        state = env.reset()
#         time.sleep(2)
        for _ in range(300):
#             before = time.time()
            action = agent.act(state)
#             after = time.time()

#             before = time.time()
            state, r, done, info = env.step(action)
#             after = time.time()
#             print(after - before)
            info_log.append(info)
#             forces.append(env._robot.get_joint_intervals())
            if done:
                print("Fuck")
                break
def extract_param(info_log, param_name):
    param = []
    for info in info_log:
        param.append(info[param_name])
    
    return param
actions = extract_param(info_log, "action")
actions = np.array(actions) / np.pi * 180

joint_names = [
        'Leg_right_10',
        'Leg_right_9',
        'Leg_right_8',
        'Leg_right_7',
        'Leg_right_6',
        'Leg_right_5',
        'Tors1',
        'Leg_left_10',
        'Leg_left_9',
        'Leg_left_8',
        'Leg_left_7',
        'Leg_left_6',
        'Leg_left_5',
    ]
min_angles = actions.min(axis=0)

max_angles = actions.max(axis=0)

for name, min_angle, max_angle in zip(joint_names, min_angles, max_angles):
    print("{}: ({:.2f}, {:.2f})".format(name, float(min_angle), float(max_angle)))
np.any()<jupyter_output><empty_output><jupyter_text>Анализ<jupyter_code>def plot_info_param(info_log, param_name):
    param = []
    for info in info_log:
        param.append(info[param_name])
    
    plt.plot(param, label=param_name)
    plt.legend()
    plt.show()
info_log[0].keys()
plot_info_param(info_log, 'x_pos')
plot_info_param(info_log, 'fall_reward')
plot_info_param(info_log, 'velocity_reward')
plot_info_param(info_log, 'smooth_reward')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13248904042864101, 'fraction_numerical': 0.013638577691183634, 'mean_word_length': 2.7142857142857144, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '266948', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 741, 'n_tokens_neox': 725, 'n_words': 117, 'path': 'sources/base_agent_walk_test.ipynb', 'repo_name': 'alex-kozinov/Dissertation', 'size': '2053'}