deep-rl-class icon indicating copy to clipboard operation
deep-rl-class copied to clipboard

unit2-record_video-logical operator precedence

Open fardinafdideh opened this issue 1 year ago • 0 comments

Hi, In "unit2.ipynb", function "record_video", it seems like there is an issue with "not" and "or" logical operators precedence in the following "while" expression: "while not terminated or truncated" The logical expression "terminated or truncated" should be enclosed in parentheses, otherwise for terminated = 0 and truncated = 1 the logical expression "not terminated or truncated" will not yield the False value. So: "while not terminated or truncated" -> "while not (terminated or truncated)"

The current version (without parentheses) would be true if "or" had higher precedence than "not", while the opposite is true, i.e., "not">"or".

fardinafdideh avatar Dec 09 '23 21:12 fardinafdideh