Observation specification must be scalar if not created by bus2RLSpec. Simulink Environment for Reinforcement Learning
1 view (last 30 days)
Show older comments
I'm trying to define a Simulink Environment for Reinforcement Learning describing a System. In particular, I would like to consider 3 observations (image, velocity and acceleration) and only 1 continues action as manipulated variable.
% Define observation specifications.
obsBus = Simulink.Bus();
obsBus.Elements(1) = Simulink.BusElement;
obsBus.Elements(1).Name = "image";
obsBus.Elements(1).Dimensions = [12,12,4];
obsBus.Elements(2) = Simulink.BusElement;
obsBus.Elements(2).Name = "scalarObservation1";
obsBus.Elements(3) = Simulink.BusElement;
obsBus.Elements(3).Name = "scalarObservation2";
NobsInfo = bus2RLSpec('obsBus','Model',mdl);
NobsInfo=allObsInfo;
I get this error:
Error using rl.train.marl.MultiAgentTrainer/run
Error in '
rlAreaCoverage32024/Agent A (Red)': Failed to evaluate mask initialization commands.
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
Observation specification must be scalar if not created by bus2RLSpec.
The code and Simulink files are in the files attached below.
Thank you for your attention, I'll wait for your help
2 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!