Module moog.tasks.abstract_task
Abstract task.
Classes
class AbstractTask-
Expand source code
class AbstractTask(abc.ABC): """Abstract task class. All tasks must inherit from this class. """ @abc.abstractmethod def reset(self, state, meta_state): """Reset the task. This should do whatever the task needs to do to itself when the environment resets. For example, this could reset a count of the number of steps taken in the episode, zero out any running state information, etc. Args: state: OrderedDict of iterables of sprites. """ pass @abc.abstractmethod def reward(self, state, meta_state, step_count): """Get reward and whether to reset based on the environment state. Args: state: OrderedDict of iterables of sprites. step_count: Current number of environment steps since last reset. Returns: reward: Scalar. Reward for current state. should_reset: Bool. Whether environment should reset on next step. """ passAbstract task class.
All tasks must inherit from this class.
Ancestors
- abc.ABC
Subclasses
Methods
def reset(self, state, meta_state)-
Expand source code
@abc.abstractmethod def reset(self, state, meta_state): """Reset the task. This should do whatever the task needs to do to itself when the environment resets. For example, this could reset a count of the number of steps taken in the episode, zero out any running state information, etc. Args: state: OrderedDict of iterables of sprites. """ passReset the task.
This should do whatever the task needs to do to itself when the environment resets. For example, this could reset a count of the number of steps taken in the episode, zero out any running state information, etc.
Args
state- OrderedDict of iterables of sprites.
def reward(self, state, meta_state, step_count)-
Expand source code
@abc.abstractmethod def reward(self, state, meta_state, step_count): """Get reward and whether to reset based on the environment state. Args: state: OrderedDict of iterables of sprites. step_count: Current number of environment steps since last reset. Returns: reward: Scalar. Reward for current state. should_reset: Bool. Whether environment should reset on next step. """ passGet reward and whether to reset based on the environment state.
Args
state- OrderedDict of iterables of sprites.
step_count- Current number of environment steps since last reset.
Returns
reward- Scalar. Reward for current state.
should_reset- Bool. Whether environment should reset on next step.