Ejemplo n.º 1
0
def main():
    convert_to_position = True
    config_data = load_human_config_json()
    # data = load_human_data_from_mat(config_data["HUMAN_MAT_DATA_PATH")
    data = load_subjects_from_dir(config_data["HUMAN_JSON_DATA_PATH"],
                                  convert_to_position=convert_to_position)

    solutions = extract_solution_chains(data)

    # save_human_data_pickle(data, solutions, HUMAN_PICKLE_DATA_PATH)

    # solutions2 = load_solutions_by_trial(HUMAN_PICKLE_DATA_PATH)

    return data
        # PICK ONE and comment others
        params = PARAMS['CE3-CE4']
        # params = PARAMS['CE3-CC4']
        # params = PARAMS['CC3-CE4']
        # params = PARAMS['CC3-CC4']
        # params = PARAMS['CE4']
        # params = PARAMS["CC4"]
    else:
        setting = sys.argv[1]
        # pass a string or an index
        try:
            params = PARAMS[IDX_TO_PARAMS[int(setting) - 1]]
        except Exception:
            params = PARAMS[setting]

    human_config_data = common.load_human_config_json()

    # params["data_dir"] = os.path.dirname(ROOT_DIR) + "/OpenLockResults/subjects"
    params["data_dir"] = human_config_data["HUMAN_SAVE_DIR"]
    params["src_dir"] = "/tmp/openlocklearner/" + str(hash(
        time.time())) + "/src/"
    params["use_physics"] = True
    params["effect_probabilities"] = generate_effect_probabilities()

    # this section randomly selects a testing and training scenario
    # train_scenario_name, test_scenario_name = select_random_scenarios()
    # params['train_scenario_name'] = train_scenario_name
    # params['test_scenario_name'] = test_scenario_name

    scenario = select_scenario(params["train_scenario_name"])
Ejemplo n.º 3
0
def load_human_data_pickle():
    human_config_data = load_human_config_json()
    with open(human_config_data["HUMAN_PICKLE_DATA_PATH"], "rb") as infile:
        human_subjects = pickle.load(infile)
        return human_subjects
Ejemplo n.º 4
0
def load_human_data_json():
    human_config_data = load_human_config_json()
    return load_subjects_from_dir(human_config_data["HUMAN_JSON_DATA_PATH"])