コード例 #1
0
    data_analysis_interval: int = 50
    save_file_and_plot_update_interval = data_analysis_interval * 1

    # data storage settings
    save_dir_path: str = SystemConfig.FILE_OUTPUT_HOME_DIR + CommonUtil.generate_date_time_str(
    ) + "_" + Path(__file__).stem

    is_save_raw_data: bool = True
    is_save_analytica_data: bool = True
    is_save_chart_data: bool = True

    # program execution settings
    is_print_episode_idx: bool = True
    user_input_next_operation: str = "fly"

    game_raw_data: GameRawData = GameRawData()
    game_raw_data.settings_info_dict["gamma"] = gamma
    game_raw_data.settings_info_dict["nn_learning_rate"] = nn_learning_rate
    game_raw_data.settings_info_dict[
        "data_analysis_interval"] = data_analysis_interval

    anay_data: AnalyticalData = AnalyticalData()
    anay_data.settings_info_dict = game_raw_data.settings_info_dict
    # anay_data.name_datalist_dict["mean"] = [0]
    # anay_data.name_datalist_dict["standard_deviation"] = [0]
    anay_data.time_step_mean_list = [0]
    anay_data.time_step_std_dev_list = [0]
    anay_data.reward_mean_list = [0]
    anay_data.reward_std_dev_list = [0]

    if is_save_chart_data or is_save_analytica_data:
コード例 #2
0
size = 2
random_sample = random.sample([1, 2, 3, 4], size)
print("random_sample", random_sample)

file_path: str = "d:/python_write_file_test.txt"

initial_epsilon = 0.5
decay = 0.5
episodes_per_drop = 500000

discount_rate = 0.9
learning_rate = 0.2

max_episodes = 10000000

game_data: GameRawData = GameRawData()
game_data.add_settings_info("initial_epsilon", initial_epsilon)
game_data.add_settings_info("decay", decay)
game_data.add_settings_info("episodes_per_drop", episodes_per_drop)
game_data.add_settings_info("discount_rate", discount_rate)
game_data.add_settings_info("learning_rate", learning_rate)
game_data.add_settings_info("max_episodes", max_episodes)

# print("game_data.__dict__", game_data.__dict__)
# for i in range(0,1000000):
#     game_data.add_end_step_record(i)
#     game_data.add_end_reward_record(i)
#
# file1 = open(file_path,"w")
# L = ["This is Delhi \n","This is Paris \n","This is London \n"]
#