Why I get the warning "Referencing of the same agent object by multiple RL Agent blocks " when doing RL training ?

10 次查看(过去 30 天)
I got the warning "Referencing of the same agent object by multiple RL Agent blocks" when when doing RL training refer to"Train Multiple Agents to Perform Collaborative Task". I got this warning when using “rlSimulinkEnv” to create a multi-agent environment and my Simulink files actually did not contain same agent objects (The two agents are named differently). Does anyone know what mistake I might have made?
Here is the environment creating part of the training code:
mdl = 'xxx';
blks = ["xxx/.../RL Agent 4","xxx/.../RL Agent 16"];
open_system(mdl)
obsInfo = rlNumericSpec([6 1],...
'LowerLimit',[-inf 0 -10 -inf -inf -inf]',...
'UpperLimit',[ inf inf 10 inf inf inf]');
numObservations = obsInfo.Dimension(1);
actInfo = rlNumericSpec([1 1],...
'LowerLimit',0,...
'UpperLimit',5);
numActions = actInfo.Dimension(1);
obsInfos = {obsInfo,obsInfo};
actInfos = {actInfo,actInfo};
env = rlSimulinkEnv(mdl,blks,obsInfos,actInfos);
env.ResetFcn = @(in)localResetFcn(in);
  2 个评论
Lin
Lin 2024-1-12
Hello,I have the same question,have you solved the problem?If it did, can you tell me how it worked out?
Thank you.
katuysha
katuysha 2024-4-17
Hello Lin,
I'm glad to tell you that I have solved this warning problem later in my simulink model.
If you still haven't solved it, here is the solution:
  1. Open your ***.slx model, find your RL Agent blocks and double-click to open one.
  2. You will see the name of your agent in "Agent - Agent object". Set it to the same name as the agent in the training program.
  3. Perform the same operations for other RL Agent blocks.
  4. If the Agent object values of the agents are different, there is no such warning generated.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Training and Simulation 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by