Borrar filtros
Borrar filtros

Terminate RL DDPG episode if ode solver do not have a solution

2 visualizaciones (últimos 30 días)
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,

Respuesta aceptada

Shivam Lahoti
Shivam Lahoti el 27 de Oct. de 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.

Más respuestas (0)

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by