Exemplo n.º 1
0
        'action_dim': 6,
        'lrn_rate': 0.0005
    }
    agent_conf = {'min_data_length': 200}

    agent_reg = DdqrnAgent(model_conf['input_num'],
                           model_conf['input_sequence_num'],
                           model_conf['action_dim'], model_conf['lrn_rate'])
    agent_reg.explore_dn_freq = 2000

    acc_set_filt = MovAvgFilt(7)
    reg_trq_ctl = type_pid_controller()
    reg_trq_ctl.P_gain = 50
    reg_trq_ctl.I_gain = 500
    # Env
    env_reg = EnvRegen(kona_power.ModBattery.SOC)
    " Load model"
    if driver_case == 0:
        agent_reg.model.load_weights('driving_case_driver_0.h5')
        agent_reg.epsilon = 0.1
    elif driver_case == 1:
        agent_reg.model.load_weights('driving_case_driver_1.h5')
        agent_reg.epsilon = 0.1
    else:
        agent_reg.model.load_weights('driving_case_driver_2.h5')
        agent_reg.epsilon = 0.1

    #%% 2. Simulation setting
    swt_plot = 'on'
    #%% 2. Simulation
    sim_vehicle = type_DataLog([