mlpy.experiments.task.Task¶
-
class
mlpy.experiments.task.Task(env=None)[source]¶ Bases:
objectThe task description base class.
A task description describes the task the agent is to perform. The task description allows to configure
StateandActionby setting the number of features, the description and by overwriting the static functionsis_valid,encode, anddecodeat 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_stateand_configure_actionto configure the classesStateandAction, respectively.For both
StateandActionthe appropriate class variables can be set by calling the following functions:Overwrite the following
StateandActionmethods to allow for more readable descriptions:Additionally, the
Stateclass provides a method to check a state’s validity:Attributes
event_delayEvent delay. is_episodicIdentifies 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.