Terminate RL DDPG episode if ode solver do not have a solution
1 次查看(过去 30 天)
显示 更早的评论
Hello Everyone,
I am building an LQR type controller using RL DDPG in MATLAB. I had question.
I am steping the eviroment using ode15s solver (my evriormen is system of DAEs which I am solving using ode15s). I want to terminate the episode if for any action in the begining the ode15s is not able to solve the enviroment. How can I do it. Any help will highly be apprciated.
Thanks,
0 个评论
采纳的回答
Shivam Lahoti
2023-10-27
Hi Muhammad Nadeem,
As per my understanding, you are stepping your environment (system of DAEs) using the ode15s solver and wish to terminate the environment if ode15s is unable to solve the environment.
The simplest solution could be to use a timestamp and a threshold time that you want the solver to run and find an answer in.
At the start of your code:
StartTime=clock;
At the end of each loop/the point you might want to exit
TimeElapsed=clock-StartTime;
if TimeElapsed(end)>10 %Set it to a value that you want (I chose 10 seconds)
return
end
If the above approach doesn’t work well then refer to the answer below.
I hope this helps.
Regards,
Shivam Lahoti.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!