コード例 #1
0
 def tag_obs(self, radius):
     self.untag_obs()
     for otherAgents in self.world.obstacles:
         to = self.pos - otherAgents.pos
         gap = radius + otherAgents.radius
         if Vector2D.length_sq(to) < gap**2:
             otherAgents.tagged = True;
コード例 #2
0
 def tag_neighbours(self, radius):
     self.untag()
     for otherAgents in self.world.agents:
         to = self.pos - otherAgents.pos
         gap = radius + otherAgents.tag_radius
         if Vector2D.length_sq(to) < gap**2:
             otherAgents.tagged = True
コード例 #3
0
ファイル: agent.py プロジェクト: Dan-Newman/AI4Games
 def tag_neighbours(self, radius):
     self.untag()
     for otherAgents in self.world.agents:
         to = self.pos - otherAgents.pos
         gap = radius + otherAgents.tag_radius
         if Vector2D.length_sq(to) < gap**2:
             otherAgents.tagged = True;