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
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개)

카테고리

Help CenterFile Exchange에서 Reinforcement Learning에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by