mlpy.experiments.task.EpisodicTask¶
-
class
mlpy.experiments.task.EpisodicTask(initial_states, terminal_states, env=None)[source]¶ Bases:
mlpy.experiments.task.TaskThe 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_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. Overwrite this function to specify valid states: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. 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.