diff --git a/multiagent/multi_discrete.py b/multiagent/multi_discrete.py index d7108ad43..46aa67179 100644 --- a/multiagent/multi_discrete.py +++ b/multiagent/multi_discrete.py @@ -4,7 +4,7 @@ import numpy as np import gym -from gym.spaces import prng +# from gym.spaces import prng # this prng has been cancelled class MultiDiscrete(gym.Space): """ @@ -30,7 +30,8 @@ def __init__(self, array_of_param_array): def sample(self): """ Returns a array with one sample from each discrete action space """ # For each row: round(random .* (max - min) + min, 0) - random_array = prng.np_random.rand(self.num_discrete_space) + np_random = np.random.RandomState() + random_array = np_random.rand(self.num_discrete_space) return [int(x) for x in np.floor(np.multiply((self.high - self.low + 1.), random_array) + self.low)] def contains(self, x): return len(x) == self.num_discrete_space and (np.array(x) >= self.low).all() and (np.array(x) <= self.high).all()