infer-actively / pymdp

A Python implementation of active inference for Markov Decision Processes
MIT License
420 stars 83 forks source link

Bug when `num_controls` is passed as an argument to `Agent` constructor #84

Closed conorheins closed 1 year ago

conorheins commented 1 year ago

Attribute error in agent.py at line 124: https://github.com/infer-actively/pymdp/blob/4a81f1b194db29f93aeb03a4669c32dd21c3157e/pymdp/agent.py#L124

whennum_controls is passed in as argument to agent.Agent() constructor. Need an else statement after 118: https://github.com/infer-actively/pymdp/blob/4a81f1b194db29f93aeb03a4669c32dd21c3157e/pymdp/agent.py#L118, so that num_controls gets assigned to a property of self if provided as argument.

Originally posted by @conorheins in https://github.com/infer-actively/pymdp/discussions/4#discussioncomment-3131321

conorheins commented 1 year ago

This is now fixed in master branch. I will close this after the new release of pymdp when bug-fix is applied to the registered version of the package.