mlpy.agents.modules.FollowPolicyModule

class mlpy.agents.modules.FollowPolicyModule(policies, niter=None, start=None)[source]

Bases: mlpy.agents.modules.IAgentModule

The follow policy agent module.

The follow policy agent module follows a given policy choosing the next action based on that policy.

Parameters:

policies : array_like, shape (n, nfeatures, ni)

A list of policies (i.e., action sequences), where n is the number of policies, nfeatures is the number of action features, and ni is the sequence length.

niter : int, optional

The number of times each policy is repeated. Default is 1.

start : int, optional

The first policy to execute. Default is 0.

Attributes

mid The module’s unique identifier.

Methods

change_policies(policies) Exchange the list of policies.
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.
is_complete() Check if the agent module has completed.
load(filename) Load the state of the module from file.
reset(t, **kwargs) Reset the module for the next iteration.
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.