def __update_state(self):
"""
Updates the state space (self.gamestate) after the suggested action is taken
:return: None
"""
jigsaw_id, place_id = self.decode_action()
self.__update_placed_pieces(jigsaw_id, place_id)
if self.state_type == 'hog':
self.__render_gamestate()
elif self.state_type == 'image':
resized_discrete_im = np.digitize(
imresize(self.jigsaw_image, (self.state_height, self.state_width)),
self.bins)
self.gamestate = np.array([resized_discrete_im]).transpose().swapaxes(0, 1)
else:
ValueError('The state type is not valid, enter "hog" or "image"')
评论列表
文章目录