本文整理汇总了Python中ale_python_interface.ALEInterface.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ALEInterface.__init__方法的具体用法?Python ALEInterface.__init__怎么用?Python ALEInterface.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ale_python_interface.ALEInterface
的用法示例。
在下文中一共展示了ALEInterface.__init__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ale_python_interface import ALEInterface [as 别名]
# 或者: from ale_python_interface.ALEInterface import __init__ [as 别名]
def __init__(self, rom_file, random_seed, frame_skip, repeat_action_probability, minimum_actions, use_sdl,
test_mode, image_processing=None):
ALEInterface.__init__(self)
# Set USE_SDL to true to display the screen. ALE must be compilied
# with SDL enabled for this to work. On OSX, pygame init is used to
# proxy-call SDL_main.
if use_sdl:
if sys.platform == 'darwin':
import pygame
pygame.init()
self.setBool('sound', False) # Sound doesn't work on OSX
elif sys.platform.startswith('linux'):
self.setBool('sound', True)
self.setBool('display_screen', True)
self.setFloat('repeat_action_probability', repeat_action_probability)
self.setInt('frame_skip', frame_skip)
self.random_seed = random_seed
self.frame_skip = frame_skip # trolololo
self.minimum_actions = minimum_actions
self.test_mode = test_mode
self.image_processing = image_processing
self.num_actions = 0
self.legal_actions = []
self.queue = deque()
self.height = -1
self.width = -1
self.loadROM(rom_file)
height, width = self.getScreenDims()
logging.info('Screen resolution is %dx%d' % (height, width))