def __init__(self, force=10.0, length=0.5, mass=0.1):
    self.gravity = 9.8
    self.masscart = 1.0
    self.tau = 0.02
    self.kinematics_integrator = 'euler'
    if isinstance(force, list):
        self.force_mag_set = force
    else:
        self.force_mag_set = None
        self.force_mag = force
    if isinstance(length, list):
        self.length_set = length
    else:
        self.length_set = None
        self.length = length
    if isinstance(mass, list):
        self.masspole_set = mass
    else:
        self.masspole_set = None
        self.masspole = mass
    self.theta_threshold_radians = (((12 * 2) * math.pi) / 360)
    self.x_threshold = 2.4
    high = np.array([(self.x_threshold * 2), np.finfo(np.float32).max, (self.theta_threshold_radians * 2), np.finfo(np.float32).max])
    self.action_space = spaces.Box(low=(- 1.0), high=1.0, shape=(1,), dtype=np.float32)
    self.observation_space = spaces.Box((- high), high, dtype=np.float32)
    self.seed()
    self.viewer = None
    self.state = None
    self.steps_beyond_done = None
    self.steps_in_episode = 0
def __init__(self, force=10.0, length=0.5, mass=0.1):
    self.gravity = 9.8
    self.masscart = 1.0
    self.tau = 0.02
    self.kinematics_integrator = 'euler'
    if isinstance(force, list):
        self.force_mag_set = force
    else:
        self.force_mag_set = None
        self.force_mag = force
    if isinstance(length, list):
        self.length_set = length
    else:
        self.length_set = None
        self.length = length
    if isinstance(mass, list):
        self.masspole_set = mass
    else:
        self.masspole_set = None
        self.masspole = mass
    self.theta_threshold_radians = (((12 * 2) * math.pi) / 360)
    self.x_threshold = 2.4
    high = np.array([(self.x_threshold * 2), np.finfo(np.float32).max, (self.theta_threshold_radians * 2), np.finfo(np.float32).max])
    self.action_space = spaces.Box(low=(- 1.0), high=1.0, shape=(1,), dtype=np.float32)
    self.observation_space = spaces.Box((- high), high, dtype=np.float32)
    self.seed()
    self.viewer = None
    self.state = None
    self.steps_beyond_done = None
    self.steps_in_episode = 0