def test_validate_pos(self): self.vehicle.pos = (0, 0) another_vehicle = Vehicle( self.user_configs, target_vector=Vector(400, 600) ) self.simulation.add_vehicle(another_vehicle) another_vehicle.pos = (0, 25) self.assertEqual(another_vehicle.validate_pos((0, 3)), Vector(0, 15))
def test_get_separation_force(self): self.vehicle.pos = Vector(10, 30) self.assertEqual(self.vehicle.get_separation_force(), Vector(0, 0)) another_vehicle = Vehicle( self.user_configs, target_vector=Vector(400, 600) ) another_vehicle.pos = Vector(10, 10) self.simulation.add_vehicle(another_vehicle) self.assertEqual( self.vehicle.get_separation_force(), Vector(0, 0.05) ) self.simulation.remove_vehicle(another_vehicle)