Cannot propagate non-bus signal to block because the block has a bus object specified.
Show older comments
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
More Answers (0)
Categories
Find more on Reinforcement Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!