mlpy.agents.modules.IAgentModule¶
-
class
mlpy.agents.modules.
IAgentModule
[source]¶ Bases:
mlpy.modules.UniqueModule
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
choose_action
(state)Choose the next action the agent will execute. cleanup
()Cleanup the agent module. end
(experience)End the learning agent module. init
()Initialize the agent module. is_complete
()Check if the agent module has completed. load
(filename)Load the state of the module from file. save
(filename)Save the current state of the module to file. start
()“Start an episode. step
(state)Execute the agent module. terminate
(value)Set the termination flag.