mlpy.agents.modules.IAgentModule¶
-
class
mlpy.agents.modules.
IAgentModule
[source]¶ Bases:
mlpy.modules.Module
Agent module base interface class.
The agent (
Agent
) uses an agent module, which specifies how the agent is controlled. Valid agent module types are:- followpolicymodule
- The agent follows a given policy (
FollowPolicyModule
) - learningmodule
- The agent learns according to a specified learner
(
LearningModule
). - usermodule
- The agent is user controlled via keyboard or PS2 controller
(
UserModule
).
Notes
Every class inheriting from IAgentModule must implement
get_next_action
.Attributes
mid
The module’s unique identifier. Methods
enter
(t)Enter the module and perform initialization tasks. execute
(state)Execute the agent module. exit
()Exit the module and perform cleanup tasks. get_next_action
()Return the next action the agent will execute. is_complete
()Check if the agent module has completed. load
(filename)Load the state of the module from file. reset
(t, **kwargs)Reset the agent module. save
(filename)Save the current state of the module to file. terminate
(value)Set the termination flag. update
(dt)Update the module at every delta time step dt.