本文整理汇总了Python中arena.Arena.from_name方法的典型用法代码示例。如果您正苦于以下问题:Python Arena.from_name方法的具体用法?Python Arena.from_name怎么用?Python Arena.from_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arena.Arena
的用法示例。
在下文中一共展示了Arena.from_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Manager
# 需要导入模块: from arena import Arena [as 别名]
# 或者: from arena.Arena import from_name [as 别名]
from strategies.human_choice import human_choice as robot1_logic
from strategies.human_choice import human_choice as robot2_logic
from strategies.human_choice import human_choice as robot3_logic
from strategies.human_choice import human_choice as robot4_logic
# Define game characteristic lengths in pixels
square_width = 40
robot_width = 30
# Choose the arena
arena_name = "symmetric_06"
# End of configuration parameters #
################################################################################
arena = Arena.from_name(arena_name)
screen = pygame.display.set_mode(arena.size)
positions = arena.corner_centers
angles = [np.pi * i for i in range(4)]
goals = positions[2:] + positions[:2]
colors = [(255, 0, 0, .6), (0, 255, 0, .6), (0, 0, 255, .6), (255, 0, 255, .6)]
robot_widths = [robot_width for _ in range(4)]
strategies = [robot1_logic, robot2_logic, robot3_logic, robot4_logic]
arg_list = zip(positions, angles, goals, colors, robot_widths, strategies)
robots = [Robot(*args) for args in arg_list]
class Manager(object):