AbstractPolicy.m debug warning

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

0 个投票

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.
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

0 个投票

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 个评论

I see. Now which function/method of rlQAgent did you call when you got into this debug error?
I tried getAction, and it is working there at least. Reproduction steps are needed to narrow down the problem.
Thanks,
Yongjian
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.
No attachments here. Can you double check please?

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Matrix Indexing 的更多信息

产品

版本

R2021a

提问:

2021-7-2

编辑:

2021-7-7

Community Treasure Hunt

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

Start Hunting!

Translated by