本文整理汇总了Python中Ball.Ball.setUID方法的典型用法代码示例。如果您正苦于以下问题:Python Ball.setUID方法的具体用法?Python Ball.setUID怎么用?Python Ball.setUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ball.Ball
的用法示例。
在下文中一共展示了Ball.setUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildEgoCentricRepresentationOfWorld
# 需要导入模块: from Ball import Ball [as 别名]
# 或者: from Ball.Ball import setUID [as 别名]
def buildEgoCentricRepresentationOfWorld(self, world):
myTeam = []
enemyTeam = []
balls = []
obstacles =[]
for agent in world.agents:
if agent != self:
agentToAppend = Agent(agent.team, self.getEgoCentricOf(agent), agent.rotation - self.rotation, agent.brain, agent.turnRate, agent.colRadius, agent.drawRadius)
agentToAppend.setUID(agent.getUID())
if agent.isStunned:
agentToAppend.isStunned = True
if agent.team == self.team:
myTeam.append(agentToAppend)
else:
enemyTeam.append(agentToAppend)
for ball in world.balls:
ballToAppend = Ball(self.getEgoCentricOf(ball))
ballToAppend.setUID(ball.getUID())
balls.append(ballToAppend)
for obstacle in world.obstacles:
obstacleToAppend = Obstacle(self.getEgoCentricOf(obstacle), obstacle.radius)
obstacles.append(obstacleToAppend)
return myTeam, enemyTeam, balls, obstacles