- 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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Krishna
le 8 Juil 2024
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.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!