Terminate RL DDPG episode if ode solver do not have a solution
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Muhammad Nadeem
le 17 Oct 2023
Commenté : Muhammad Nadeem
le 29 Oct 2023
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 commentaires
Réponse acceptée
Shivam Lahoti
le 27 Oct 2023
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Special Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!