AbstractPolicy.m debug warning

조회 수: 5 (최근 30일)
kloner
kloner 2021년 7월 2일
편집: kloner 2021년 7월 7일
Hi there,
Could someone please explain what the following debug warning in AbstractPolicy.m means?
% DEBUG: limit to scalar policies only. To step multiple
% policies caller may use loops.
assert(isscalar(this));

답변 (2개)

Yongjian Feng
Yongjian Feng 2021년 7월 2일
Hello kloner,
Basically it means that 'this' can not be an array. It must be a scaler. As explained in the comment, if you have an array, then just loop through the array and call the function for each element in the array.
Thanks,
Yongjian
  댓글 수: 2
kloner
kloner 2021년 7월 2일
편집: kloner 2021년 7월 2일
Dear Yongjian,
This explanation does not make a lot of sense to me as "this" refers to an rlQAgent (in the step method). I only have one agent, so how could I be failing on this error?
Thanks very much for the help.
Yongjian Feng
Yongjian Feng 2021년 7월 2일
What is an riQAgent?
You can also do these to narrow it down:
  1. If you run this from the debugger, set a break point there, and type isscalar(this) in the command line window.
  2. type class(this) to make sure it is indeed riQAgent.
  3. type which isscalar to check if it is the built-in isscalar being called.

댓글을 달려면 로그인하십시오.


kloner
kloner 2021년 7월 4일
Dear Yongjian,
An rlQAgent is a MATLAB-provided Reinforcement Learning agent, as described here: https://www.mathworks.com/help/reinforcement-learning/ref/rlqagent.html.
Apologies for any confusion: I thought that the context would be clear based on the information I originally submitted. I hope that this clarification provides sufficient information to explain the Debug message as originally alluded to. Thanks.
  댓글 수: 3
kloner
kloner 2021년 7월 6일
편집: kloner 2021년 7월 7일
Dear Yongjian,
I specifically hoping that someone could explain what a debug message found within AbstractPolicy.m, which is a file created by the MATLAB core team, meant. The warning does not appear when I call the file but is located specifically within the file itself.
Yongjian Feng
Yongjian Feng 2021년 7월 7일
No attachments here. Can you double check please?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by