Observation specification must be scalar if not created by bus2RLSpec. Simulink Environment for Reinforcement Learning
2 ビュー (過去 30 日間)
古いコメントを表示
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
3 件のコメント
Ashok
2024 年 12 月 5 日
Hi @Alen,
The attached 'TESTIN1.mlx' livescript seems to have some variables such as 'allObsInfo' and 'obsSize' which are not defined. Please verify if the right files are attached.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!