Cannot propagate non-bus signal to block because the block has a bus object specified.

134 次查看(过去 30 天)
I have a Simulink model that observation was only an image, and I added two other vector to the observation in RL toolbox. Since there I are three observations now I have to use bus for observation as follow:
obsBus.Elements(1) = Simulink.BusElement;
obsBus.Elements(1).Name = "image";
obsBus.Elements(1).Dimensions = [12,12,4];
% obsBus.Elements(1).Min = -inf;
% obsBus.Elements(1).Maximum = inf;
obsBus.Elements(2) = Simulink.BusElement;
obsBus.Elements(2).Name = "scalarObservation1";
obsBus.Elements(3) = Simulink.BusElement;
obsBus.Elements(3).Name = "scalarObservation2";
Next, I have an error in the Simulink side which is not using bus
Error using rl.train.marl.MultiAgentTrainer/run
An error occurred while running the simulation for model 'rlAreaCoverage32024' with the following RL agent blocks:
rlAreaCoverage32024/Agent A (Red)
rlAreaCoverage32024/Agent B (Green)
rlAreaCoverage32024/Agent C (Blue)
Error in rl.train.TrainingManager/train (line 429)
run(trainer);
Error in rl.train.TrainingManager/run (line 218)
train(this);
Error in rl.agent.AbstractAgent/train (line 83)
trainingResult = run(trainMgr,checkpoint);
Caused by:
Error using rl.env.internal.reportSimulinkSimError
Cannot propagate non-bus signal to block 'rlAreaCoverage32024/Agent B (Green)/observation' because the block has a bus object specified. A bus signal matching the bus object specification must be passed in.
So, I added a bus selector, but a new error is raised
Error using rl.train.marl.MultiAgentTrainer/run
An error occurred while running the simulation for model 'rlAreaCoverage32024' with the following RL agent blocks:
rlAreaCoverage32024/Agent A (Red)
rlAreaCoverage32024/Agent B (Green)
rlAreaCoverage32024/Agent C (Blue)
Error in rl.train.TrainingManager/train (line 429)
run(trainer);
Error in rl.train.TrainingManager/run (line 218)
train(this);
Error in rl.agent.AbstractAgent/train (line 83)
trainingResult = run(trainMgr,checkpoint);
Caused by:
Error using rl.env.internal.reportSimulinkSimError
The signal connected to the input port of 'rlAreaCoverage32024/Sample Control Bus Selector' is not a bus signal. The input to the Bus Selector block must be a virtual or nonvirtual bus signal.
A possible cause of this error is the use of a bus-capable block (such as Merge or Unit Delay) that in this current situation is unable to propagate the bus downstream to the block reported in this error. Please see
Simulink documentation for further information on composite (i.e. bus) signals and their proper usage.
Can anyone help?

采纳的回答

Emmanouil Tzorakoleftherakis
Looking at the first screenshot, looks like the output of the grid world block is not a bus, but the observations in your RL Agent block are required to be buses. I would use a Bus creator block to turn the grid world output into a bus and then use a Bus selector.
  2 个评论
ali farid
ali farid 2024-2-14
Thank you Emmanouil, I used Bus creator, but the new error emerged.
Error using rl.train.marl.MultiAgentTrainer/run
An error occurred while running the simulation for model 'rlAreaCoverage32024' with the following RL agent blocks:
rlAreaCoverage32024/Agent A (Red)
rlAreaCoverage32024/Agent B (Green)
rlAreaCoverage32024/Agent C (Blue)
Error in rl.train.TrainingManager/train (line 429)
run(trainer);
Error in rl.train.TrainingManager/run (line 218)
train(this);
Error in rl.agent.AbstractAgent/train (line 83)
trainingResult = run(trainMgr,checkpoint);
Caused by:
Error using rl.env.internal.reportSimulinkSimError
Cannot propagate non-bus signal to block 'rlAreaCoverage32024/Agent A (Red)/observation' because the block has a bus
object specified. A bus signal matching the bus object specification must be passed in.
Emmanouil Tzorakoleftherakis
This error message is likely a good place to start:
"Cannot propagate non-bus signal to block 'rlAreaCoverage32024/Agent A (Red)/observation' because the block has a bus object specified. A bus signal matching the bus object specification must be passed in."
Make sure the bus object you create matches the signal you pass to the Bus Creator

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Composite Interfaces 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by