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
andAction
by setting the number of features, the description and by overwriting the static functionsis_valid
,encode
, anddecode
at runtime.Parameters: env : Environment, optional
The environment in which the agent performs the task.
See also
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 classesState
andAction
, respectively.For both
State
andAction
the appropriate class variables can be set by calling the following functions:Overwrite the following
State
andAction
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.