Reinforcement Agent block in Simulink Training Error

20 visualizaciones (últimos 30 días)
Yousef
Yousef el 3 de En. de 2026 a las 14:08
Respondida: Dinesh el 9 de En. de 2026 a las 13:53
When running the training script for an RL agent, I recieve this error in the terminal:
I have set the agent blockup in the simulink RL agent block but still recive the error. Is this error reltaed to the way i setup my training code or is it linked to the simulink settings of the model?
i have uploaded the code. Any help regarding this matter would be greatly appreciated.

Respuestas (1)

Dinesh
Dinesh hace alrededor de 1 hora
Check whether the variable "P_c_agent" belongs to 'rl.agent.Agent' class. The below command should return true
isa(P_c_agent, 'rl.agent.Agent')
In Simulink, the error states to make sure the "P_c_agent" exists in the base workspace, assign the "P_c_agent" to base workspace after succesfull creation of the object by using the following command before training the model.
assignin('base','P_c_agent',P_c_agent);

Categorías

Más información sobre Reinforcement Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by