def _transition_func(self, state, action):
'''
Args:
state (State)
action (str)
Returns
(State)
'''
if self.num_states == 1:
return state
if (state, action) not in self._transitions:
# Chooses @self.num_rand_trans from range(self.num_states)
self._transitions[state][action] = np.random.choice(self.num_states, self.num_rand_trans, replace=False)
state_id = np.random.choice(self._transitions[state][action])
return RandomState(state_id)
评论列表
文章目录