Pickup and Drop are actions, just like MoveForward, TurnLeft and TurnRight.
This means that they must be used in the form of arguments passed to the environment functor. Something like this, for example:
(env::AbstractGridWorld)(::Pickup)
Remove Pickup and Drop action related things from objects.jl file. This behavior must be individually specified for each environment that requires it. This is because we cannot pass the object while calling the Pickup action. And this also allows us to customize the Pickup and Drop action behavior for an environment.
Make Agent a parametric struct with a parametric type for the inventory.
Add get_... and set_... methods related to the inventory.
In runtests.jl, remove the variable ACTIONS and use the get_actions method instead.
Pickup
andDrop
are actions, just likeMoveForward
,TurnLeft
andTurnRight
. This means that they must be used in the form of arguments passed to the environment functor. Something like this, for example:(env::AbstractGridWorld)(::Pickup)
Pickup
andDrop
action related things fromobjects.jl
file. This behavior must be individually specified for each environment that requires it. This is because we cannot pass the object while calling thePickup
action. And this also allows us to customize thePickup
andDrop
action behavior for an environment.Agent
a parametric struct with a parametric type for the inventory.get_...
andset_...
methods related to the inventory.runtests.jl
, remove the variableACTIONS
and use theget_actions
method instead.