Does the sampling time of reinforcement learning agents have to be the same as the sampling time of models in simulink? What is the difference between the two?
7 views (last 30 days)
Show older comments
Does the sampling time of reinforcement learning agents have to be the same as the sampling time of models in simulink? What is the difference between the two? Currently if I set the agent sampling time ts to 0.001, it will run very slowly, but if I increase the sampling time in the model, the model will not run and the system will be out of control. Perhaps can I reduce the agent sampling time in order to improve the agent training speed, but also reduce the sampling time in the model in order to ensure that the control system in simulink works? Thank you very much for your answer.
0 Comments
Answers (1)
Ayush Aniket
on 18 Sep 2024
The sampling time of the Reinforcement Learning (RL) agent does not necessarily have to be the same as the sampling time of the Simulink model, but they are indeed related.
Agent Sampling Time: This is the interval at which the agent interacts with the environment (i.e., the Simulink model) to collect observations, make decisions, and apply actions. A smaller value means the agent makes decisions more frequently, which can increase computational load and slow down training.
Model Sampling Time: This is the time step used for simulating the dynamics of the system within Simulink. A smaller model sampling time ensures more accurate simulation of the continuous dynamics, but it can also increase computational demand.
You need to balance between the accuracy of control and the speed of training. Refer to the following MATLAB Answer for an example scenario of using different sample time for the RL agent: https://www.mathworks.com/matlabcentral/answers/555799-reinforcement-learning-sample-time?s_tid=answers_rc1-2_p2_MLT
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!