mlpy.experiments.task.Task

class mlpy.experiments.task.Task(env=None)[source]

Bases: object

The task description base class.

A task description describes the task the agent is to perform. The task description allows to configure State and Action by setting the number of features, the description and by overwriting the static functions is_valid, encode, and decode at runtime.

Parameters:

env : Environment, optional

The environment in which the agent performs the task.

Notes

Any task should inherit from this base class or any class deriving from this class. Every deriving class must overwrite the methods _configure_state and _configure_action to configure the classes State and Action, respectively.

For both State and Action the appropriate class variables can be set by calling the following functions:

Overwrite the following State and Action methods to allow for more readable descriptions:

Additionally, the State class provides a method to check a state’s validity:

Attributes

event_delay Event delay.
is_episodic Identifies if the task is episodic or not.

Methods

get_reward(state, action) Retrieve the reward.
is_complete() Check if the task has completed.
request_termination(value) Request termination of the task.
reset(t, **kwargs) Reset the task.
sensation(**kwargs) Gather the state feature information.
terminate(value) Set the termination flag.
termination_requested() Check if termination was requested.