Module moog.env_wrappers.abstract_wrapper

Abstract wrapper.

This file contains AbstractEnvironmentWrapper, an abstract base class for environment wrappers that mimics the interface of the underlying environment.

Expand source code
"""Abstract wrapper.

This file contains AbstractEnvironmentWrapper, an abstract base class for
environment wrappers that mimics the interface of the underlying environment.
"""

import abc


class AbstractEnvironmentWrapper(abc.ABC):
    """Abstract environment wrapper class.
    
    All environment wrappers must inherit from this class.
    """

    def __init__(self, environment):
        self._environment = environment

    def reset(self):
        return self._environment.reset()
    
    def step(self, action):
        return self._environment.step(action)

    def observation(self):
        return self._environment.observation()

    def observation_spec(self):
        return self._environment.observation_spec()

    def action_spec(self):
        return self._environment.action_spec()
    
    @property
    def state(self):
        return self._environment.state

    @property
    def meta_state(self):
        return self._environment.meta_state

    @property
    def state_initializer(self):
        return self._environment.state_initializer

    @property
    def physics(self):
        return self._environment.physics

    @property
    def task(self):
        return self._environment.task

    @property
    def action_space(self):
        return self._environment.action_space

    @property
    def observers(self):
        return self._environment.observers

    @property
    def game_rules(self):
        return self._environment.game_rules
    
    @property
    def environment(self):
        return self._environment
    
    @property
    def step_count(self):
        return self._environment.step_count

    @property
    def reset_next_step(self):
        return self._environment.reset_next_step

Classes

class AbstractEnvironmentWrapper (environment)

Abstract environment wrapper class.

All environment wrappers must inherit from this class.

Expand source code
class AbstractEnvironmentWrapper(abc.ABC):
    """Abstract environment wrapper class.
    
    All environment wrappers must inherit from this class.
    """

    def __init__(self, environment):
        self._environment = environment

    def reset(self):
        return self._environment.reset()
    
    def step(self, action):
        return self._environment.step(action)

    def observation(self):
        return self._environment.observation()

    def observation_spec(self):
        return self._environment.observation_spec()

    def action_spec(self):
        return self._environment.action_spec()
    
    @property
    def state(self):
        return self._environment.state

    @property
    def meta_state(self):
        return self._environment.meta_state

    @property
    def state_initializer(self):
        return self._environment.state_initializer

    @property
    def physics(self):
        return self._environment.physics

    @property
    def task(self):
        return self._environment.task

    @property
    def action_space(self):
        return self._environment.action_space

    @property
    def observers(self):
        return self._environment.observers

    @property
    def game_rules(self):
        return self._environment.game_rules
    
    @property
    def environment(self):
        return self._environment
    
    @property
    def step_count(self):
        return self._environment.step_count

    @property
    def reset_next_step(self):
        return self._environment.reset_next_step

Ancestors

  • abc.ABC

Instance variables

var action_space
Expand source code
@property
def action_space(self):
    return self._environment.action_space
var environment
Expand source code
@property
def environment(self):
    return self._environment
var game_rules
Expand source code
@property
def game_rules(self):
    return self._environment.game_rules
var meta_state
Expand source code
@property
def meta_state(self):
    return self._environment.meta_state
var observers
Expand source code
@property
def observers(self):
    return self._environment.observers
var physics
Expand source code
@property
def physics(self):
    return self._environment.physics
var reset_next_step
Expand source code
@property
def reset_next_step(self):
    return self._environment.reset_next_step
var state
Expand source code
@property
def state(self):
    return self._environment.state
var state_initializer
Expand source code
@property
def state_initializer(self):
    return self._environment.state_initializer
var step_count
Expand source code
@property
def step_count(self):
    return self._environment.step_count
var task
Expand source code
@property
def task(self):
    return self._environment.task

Methods

def action_spec(self)
Expand source code
def action_spec(self):
    return self._environment.action_spec()
def observation(self)
Expand source code
def observation(self):
    return self._environment.observation()
def observation_spec(self)
Expand source code
def observation_spec(self):
    return self._environment.observation_spec()
def reset(self)
Expand source code
def reset(self):
    return self._environment.reset()
def step(self, action)
Expand source code
def step(self, action):
    return self._environment.step(action)