AbstractPolicy.m debug warning

1 次查看(过去 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 中查找有关 Time-Frequency Analysis 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by