Esempio n. 1
0
# K.set_session(sess)

model_conf = {
    'input_num': 8,
    'input_sequence_num': 8,
    'action_dim': 6,
    'lrn_rate': 0.001
}
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 = 100

acc_set_filt = MovAvgFilt(21)
trq_set_filt = MovAvgFilt(21)
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)

#%% 2. Simulation setting
swt_plot = 'on'
#%% 2. Simulation
sim_vehicle = type_DataLog([
    'time',
    'veh_vel_measure',
    'veh_vel_pre',
    'veh_vel',
    # K.set_session(sess)

    model_conf = {
        'input_num': 8,
        'input_sequence_num': 8,
        '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
Esempio n. 3
0
# sess = tf.Session(config=config)
# K.set_session(sess)

model_conf = {
    'input_num': 8,
    'input_sequence_num': 8,
    'action_dim': 7,
    'lrn_rate': 0.005
}
agent_conf = {'min_data_length': 50}

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

trq_ctller = MovAvgFilt(5)
# Env
env_reg = EnvRegen(kona_power.ModBattery.SOC)

#%% 2. Simulation setting
swt_plot = 'off'
#%% 2. Simulation
sim_vehicle = type_DataLog([
    'time', 'veh_vel_measure', 'veh_vel_pre', 'veh_vel', 'veh_acc',
    'acc_measure', 'drv_aps_in', 'drv_bps_in', 'trq_mot', 'w_mot', 'w_shaft',
    'w_wheel', 'reldis_measure'
])
sim_algorithm = type_DataLog(['stDrvInt', 'stRegCtl'])
sim_idm = type_DataLog([
    'stBrkSection', 'acc_est', 'acc_ref', 'vel_est', 'vel_ref', 'reldis_est',
    'dis_eff', 'dis_adj', 'dis_adj_delta', 'param_reldis_init',