Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
'''
Create a test space and populate with Mock Agents.
'''
self.space = ContinuousSpace(70, 20, True, -30, -30)
self.agents = []
for i, pos in enumerate(TEST_AGENTS):
a = MockAgent(i, None)
self.agents.append(a)
self.space.place_agent(a, pos)
def setUp(self):
'''
Create a test space and populate with Mock Agents.
'''
self.space = ContinuousSpace(70, 20, False, -30, -30)
self.agents = []
for i, pos in enumerate(TEST_AGENTS):
a = MockAgent(i, None)
self.agents.append(a)
self.space.place_agent(a, pos)
def setUp(self):
'''
Create a test space and populate with Mock Agents.
'''
self.space = ContinuousSpace(70, 50, False, -30, -30)
self.agents = []
for i, pos in enumerate(REMOVAL_TEST_AGENTS):
a = MockAgent(i, None)
self.agents.append(a)
self.space.place_agent(a, pos)
Args:
population: Number of Boids
width, height: Size of the space.
speed: How fast should the Boids move.
vision: How far around should each Boid look for its neighbors
separation: What's the minimum distance each Boid will attempt to
keep from any other
cohere, separate, match: factors for the relative importance of
the three drives. '''
self.population = population
self.vision = vision
self.speed = speed
self.separation = separation
self.schedule = RandomActivation(self)
self.space = ContinuousSpace(width, height, True)
self.factors = dict(cohere=cohere, separate=separate, match=match)
self.make_agents()
self.running = True
Args:
population: Number of Boids
width, height: Size of the space.
speed: How fast should the Boids move.
vision: How far around should each Boid look for its neighbors
separation: What's the minimum distance each Boid will attempt to
keep from any other
cohere, separate, match: factors for the relative importance of
the three drives. '''
self.population = population
self.vision = vision
self.speed = speed
self.separation = separation
self.schedule = RandomActivation(self)
self.space = ContinuousSpace(width, height, True)
self.factors = dict(cohere=cohere, separate=separate, match=match)
self.make_agents()
self.running = True