forked from Intelligent-Driving-Laboratory/GOPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_idp_infadp.py
36 lines (31 loc) · 1.07 KB
/
run_idp_infadp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Copyright (c). All Rights Reserved.
# General Optimal control Problem Solver (GOPS)
# Intelligent Driving Lab (iDLab), Tsinghua University
#
# Creator: iDLab
# Lab Leader: Prof. Shengbo Eben Li
# Email: [email protected]
#
# Description: run a closed-loop system
# Update: 2022-12-05, Congsheng Zhang: create file
from gops.sys_simulator.sys_run import PolicyRunner
runner = PolicyRunner(
log_policy_dir_list=["../results/INFADP/idpendulum"],
trained_policy_iteration_list=["90000_opt"],
is_init_info=True,
init_info={"init_state": [0.0, 0.05, -0.05, 0.05, 0.1, -0.1]},
save_render=False,
legend_list=["INFADP"],
use_opt=True, # Use optimal solution for comparison
opt_args={
"opt_controller_type": "MPC", # OPT or MPC
"num_pred_step": 1,
"gamma": 0.99,
"minimize_options": {"max_iter": 200, "tol": 1e-3,
"acceptable_tol": 1e0,
"acceptable_iter": 10,},
"use_terminal_cost": False,
},
dt=0.01, # time interval between steps
)
runner.run()