mlpy.experiments.task.EpisodicTask¶
-
class
mlpy.experiments.task.
EpisodicTask
(initial_states, terminal_states, env=None)[source]¶ Bases:
mlpy.experiments.task.Task
The episodic task description base class.
This class automatically identifies the task as an episodic task. An episodic task has a set of actions that transitions the agent into a terminal state. Once a terminal state is reached the task is complete.
Parameters: initial_states : str or State or list[str or State]
List of possible initial states.
terminal_states : str or State or list[str or State]
List of terminal states.
env : Environment, optional
The environment in which the agent performs the task.
Notes
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. Overwrite this function to specify valid states: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. random_initial_state
()Return a random initial state. 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.