emulator.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:atari-human-checkpoint-replay 作者: ionelhosu 项目源码 文件源码
def __init__(self, rom_name, vis,windowname='preview'):
        self.ale = ALEInterface()
        self.max_frames_per_episode = self.ale.getInt("max_num_frames_per_episode");
        self.ale.setInt("random_seed",123)
        self.ale.setInt("frame_skip",4)
        self.ale.loadROM('roms/' + rom_name )
        self.legal_actions = self.ale.getMinimalActionSet()
        self.action_map = dict()
        self.windowname = windowname
        for i in range(len(self.legal_actions)):
            self.action_map[self.legal_actions[i]] = i
        self.init_frame_number = 0

        # print(self.legal_actions)
        self.screen_width,self.screen_height = self.ale.getScreenDims()
        print("width/height: " +str(self.screen_width) + "/" + str(self.screen_height))
        self.vis = vis
        if vis: 
            cv2.startWindowThread()
            cv2.namedWindow(self.windowname)
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号