def testStandardPedestrianWithPedestrian(self):
        pedestrian = 'standardPedestrian'
        id       = 10
        initialConditions = 'random'
        returnedPedestrian = standardPedestrian(pedestrian, id, initialConditions)
        errorMessage = "Wrong input value for pedestrian"
        self.assertEqual(returnedPedestrian.type, pedestrian, errorMessage)
        errorMessage = "Wrong input value for id"
        self.assertEqual(returnedPedestrian.id, 'Pedestrian'+str(id), errorMessage)
        errorMessage = "Wrong input value for initial conditions"
        self.assertEqual(returnedPedestrian.initialConditions, initialConditions, errorMessage)
#         errorMessage = "Wrong input value for position"
#         self.assertEqual(returnedPedestrian.position.all(), position.all(), errorMessage)
#         errorMessage = "Wrong input value for velocity"
#         self.assertEqual(returnedPedestrian.velocity.all(), velocity.all(), errorMessage)
#         errorMessage = "Wrong input value for target"
#         self.assertEqual(returnedPedestrian.target.all(), target.all(), errorMessage)
        errorMessage = "Wrong input value for desired velocity"
        self.assertEqual(returnedPedestrian.desiredVelocity, v0, errorMessage)
        errorMessage = "Wrong input value for relaxtion time"
        self.assertEqual(returnedPedestrian.relaxationTime, tauAlpha, errorMessage)
        pass
Ejemplo n.º 2
0
def spawnRandomPedestrians():
    standardPedestrians = [None] * nbStandardPedestrians
    for i in range(nbStandardPedestrians):
        standardPedestrians[i] = standardPedestrian('standardPedestrian', i, 'random')
    return np.array(standardPedestrians)