コード例 #1
0
    def __init__(self):
        self.horizon = 400
        self.gamma = .95

        self._theta = 0.
        self._theta_dot = 0.

        self._g = 9.8
        self._m = 2.
        self._M = 8.
        self._l = .5
        self._alpha = 1. / (self._m + self._M)
        self._noise = 10.
        self._angle_max = np.pi / 2.
        self.max_velocity = np.inf
        self._dt = 0.1

        # gym attributes
        self.viewer = None
        high = np.array([self._angle_max, self.max_velocity])
        self.observation_space = spaces.Box(low=-high, high=high)
        self.action_space = fqispaces.DiscreteValued([-50, 0, 50], decimals=0)

        # initialize state
        self.seed()
        self.reset()
コード例 #2
0
ファイル: acrobot.py プロジェクト: davide1096/ifqi
    def __init__(self):
        self.horizon = 100
        self.gamma = .95

        self.max_action = 5

        self._g = 9.81
        self._M1 = self._M2 = 1
        self._L1 = self._L2 = 1
        self._mu1 = self._mu2 = .01
        self._dt = .1

        # gym attributes
        self.viewer = None
        high = np.array([np.inf, np.inf, np.inf, np.inf])
        self.observation_space = spaces.Box(low=-high, high=high)
        self.action_space = fqispaces.DiscreteValued([-5, 5], decimals=0)

        # evaluation initial states
        self.initial_states = np.zeros((41, 4))
        self.initial_states[:, 0] = np.linspace(-2, 2, 41)

        # initialize state
        self.seed()
        self.reset()
コード例 #3
0
ファイル: carOnHill.py プロジェクト: davide1096/ifqi
    def __init__(self):
        self.horizon = 100
        self.gamma = 0.95

        self.max_pos = 1.
        self.max_velocity = 3.

        self._g = 9.81
        self._m = 1
        self._dt = .1

        # gym attributes
        self.viewer = None
        high = np.array([self.max_pos, self.max_velocity])
        self.observation_space = spaces.Box(low=-high, high=high)
        self.action_space = fqispaces.DiscreteValued([-4., 4.], decimals=0)

        # evaluation initial states
        self.initial_states = np.zeros((289, 2))
        cont = 0
        for i in range(-8, 9):
            for j in range(-8, 9):
                self.initial_states[cont, :] = [0.125 * i, 0.375 * j]
                cont += 1

        # initialize state
        self.seed()
        self.reset()
コード例 #4
0
ファイル: swingPendulum.py プロジェクト: tyrion/ifqi
    def __init__(self, **kwargs):
        self.horizon = 100
        self.gamma = 0.9

        self._m = 1.
        self._l = 1.
        self._g = 9.8
        self._mu = 0.01
        self._dt = 0.02

        # gym attributes
        self.viewer = None
        high = np.array([np.inf, np.inf])
        self.observation_space = spaces.Box(low=-high, high=high)
        self.action_space = fqispaces.DiscreteValued([-5, 0, 5], decimals=5)

        # initialize state
        self.seed()
        self.reset()
コード例 #5
0
ファイル: carOnHill.py プロジェクト: tyrion/ifqi
    def __init__(self):
        self.horizon = 300
        self.gamma = 0.95

        self.max_pos = 1.
        self.max_velocity = 3.

        self._g = 9.81
        self._m = 1
        self._dt = .1

        # gym attributes
        self.viewer = None
        high = np.array([self.max_pos, self.max_velocity])
        self.observation_space = spaces.Box(low=-high, high=high)
        self.action_space = fqispaces.DiscreteValued([-4., 4.], decimals=0)

        # initialize state
        self.seed()
        self.reset()