Can't call current inventory method from AWI
Closed this issue · 2 comments
Hey there,
I am following the guides from: http://www.yasserm.com/scml/scml2020docs/tutorials/03.develop_agent_scml2020.html. Currently, I am trying to access my agent's inventory. Unfortunately, I am getting following error when I try to call 'self.awi.current_inventory(self.awi.my_input_product)':
AttributeError: 'AWI' object has no attribute 'current_inventory'.
I was wondering if the method is changed somewhat, checked the methods in http://www.yasserm.com/scml/scml2020docs/api/scml.scml2020.AWI.html, and could not find any method regarding the inventory. In SCML 2021, is it the agent designer's choice to keep track of the inventory?
OS: Windows
Version: 10
Best regards.
I have managed to call inventory from the following command: self.awi.state.inventory, it returns a list.
In the following link, the production strategy chapter has the wrong code I'm assuming. http://www.yasserm.com/scml/scml2020docs/tutorials/03.develop_agent_scml2020.html. I am also adding a screenshot for the part that I am mentioning.
Sorry for the inconvenience.
Thank you for spotting this error.
I corrected the documentation. Now it reads:
self.awi.state.inventory
matching the code in the notebook. I also added current_inventory
to the AWI. It will be available in the next release for others who already wrote their code based on this fragment.
I will close the issue. Please re-open it if not satisfied with the solution.