- Ensure initial conditions are identical for both methods. Running the simulation directly from the panel might use default initial conditions different from those set in the 'sim' command
- Verify consistency in simulation parameters (start/stop times, solver settings, step sizes) between both methods
- Set the random seed to the same value for both simulations to ensure consistency in the agent's performance
- Check for any callbacks or scripts that might run when starting the simulation from the Simulink panel, as they can alter the simulation behavior.
What is the difference between sim (RL toolbox) and directly click "run" in the Simulink Model
2 ビュー (過去 30 日間)
古いコメントを表示
sim - Simulate trained reinforcement learning agents within specified environment
After training my RL agent I use TestSim = sim(agent,env) to test my trained agent.
However, I find that the agent performence is different and much worse if I directly click run bottom is the Simulink model pannel rather than using sim command.
I have checked that in my Simulink model the RL agent block has correctly quoted my trained agent in the MATLAB workspace
0 件のコメント
回答 (1 件)
Krishna
2024 年 7 月 8 日
Hey,
I understand that you are facing worse performance when running directly from simulink. Can you please check the following things,
Also ensure the Simulink model references the correct and current version of the trained agent from the MATLAB workspace.
Please go through the following documentation to learn more about 'sim' command and its default values to be used while simulation,
Also please share the simulation model for further investigation if possible.
Hope this helps.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!