Error while training a two-agent environment: Action specification of agent at index 2 incompatible with environment
5 次查看(过去 30 天)
显示 更早的评论
I am trying to simulate a two-agent system, using the following structure, and I am no using a reset function at all.
out = sim(envNoLA,[agentTray agentGains],simOpts);
But I get this error:
Error using rl.util.validateAgentsWithEnv>localValidateForSim
Action specification of agent at index 2 incompatible with environment.
Verify the action specification of the agents and environment using
getActionInfo.
Error in rl.util.validateAgentsWithEnv (line 23)
localValidateForSim(agents,env);
Error in rl.env.AbstractEnv/sim (line 67)
rl.util.validateAgentsWithEnv(policies,env);
After checking the specifications for each agent I received:
getActionInfo(agentTray)
ans =
rlNumericSpec with properties:
LowerLimit: -0.0349
UpperLimit: 1.0472
Name: "Trajectories"
Description: [0×0 string]
Dimension: [8 1]
DataType: "double"
And
getActionInfo(agentGains)
ans =
rlNumericSpec with properties:
LowerLimit: -2
UpperLimit: 50
Name: "Trajectories"
Description: [0×0 string]
Dimension: [24 1]
DataType: "double"
The stablished options are:
simOpts = rlSimulationOptions('MaxSteps',1000,...
'NumSimulations',3);
How can I correct this issue?
回答(1 个)
Emmanouil Tzorakoleftherakis
2023-1-27
The issue seems to be that the action specifications do not match what the environment model expects. Whether you are using Simulink or MATLAB to model the environment, make sure that the environment input matches what the agent outputs, primarily the dimensions of those actions
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Agents 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!