예제 #1
0
 def __init__(self, state, position, momentum):
     Particle.__init__(self, state, position, momentum)
     self.values.set('ignoreDrag', True)
     self.values.set('ignoreGravity', True)
     self.values.add('attraction', 300)
     self.physicsName = 'attractors'
     self.name = 'attractor'
예제 #2
0
파일: Timebubble.py 프로젝트: jogi1/energy
 def __init__(self, state, position, momentum):
     Particle.__init__(self, state, position, momentum)
     self.values.set('ignoreGravity', True)
     self.values.set('ignoreDrag',  True)
     self.values.set('unattractable', True)
     self.values.add('timeScale', 0.01)
     self.values.add('timeRadius', 200)
     self.timeRadius = 200
     self.physicsName = 'timebubbles'
     self.name = 'timebubble'
예제 #3
0
 def __init__(self, state, position, momentum):
     Particle.__init__(self, state, position, momentum)
     self.values.set('ignoreGravity', True)
     self.values.set('ignoreDrag', True)
     self.values.set('unattractable', True)
     self.values.add('timeScale', 0.01)
     self.values.add('timeRadius', 200)
     self.timeRadius = 200
     self.physicsName = 'timebubbles'
     self.name = 'timebubble'
예제 #4
0
파일: Boid.py 프로젝트: GuiCodron/roboid
 def __init__(self,
              identity,
              pos=np.zeros(2),
              speed=np.zeros(2),
              acc=np.zeros(2),
              goal=None,
              color=None):
     "init boid with id, initial position, speed and acceleration"
     Particle.__init__(self, identity)
     self.type = TYPE_BOID
     self.pos = pos.astype('int32')
     self.speed = speed.astype('int32')
     self.acc = acc.astype('int32')
     self.goal_id = goal
     self.last_goal_id = None
     self.color = color or np.random.randint(255, size=3)
     self.timer = 0
     self.collision_count = 0
     self.bot = bot()
     self.bot.posx = self.pos[0] / self.v_max * 0.74
     self.bot.posy = self.pos[1] / self.v_max * 0.74
예제 #5
0
 def __init__(self, start_x, start_y, identifier=0):
     Particle.__init__(self, start_x, start_y, identifier=0)