예제 #1
0
 def continuous_transition_function(self, c_):
     c_ = undiscretize(c_, self.discretization_bins, self.P.unif_range)
     c_next_ = self.T(from_numpy_to_var(c_)).data.cpu().numpy()
     c_next_ = np.clip(c_next_, self.P.unif_range[0] + 1e-6,
                       self.P.unif_range[1] - 1e-6)
     c_next_d = discretize(c_next_, self.discretization_bins,
                           self.P.unif_range)
     return c_next_d
예제 #2
0
 def preprocess_function(self, state):
     return discretize(state, self.discretization_bins, self.P.unif_range)