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

108 views (last 30 days)
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?

Accepted Answer

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 Comments
ali farid
ali farid on 14 Feb 2024
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

Sign in to comment.

More Answers (0)

Categories

Find more on Composite Interfaces in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!