Pedestrian - Friend group movement behaviour
User story
Describe your new feature as a user story:
- As a evacuation researcher
- I want to enable pedestrians to move as a group to a number of locations
- in order to simulate realistic pre-evacuation behaviour through crowding.
Acceptance criteria
- Social groups should contain a number of pedestrians between 2 and 5
- Social groups should spawn in and meet at a random location on the map
- When all members of the social group have reached the initial destination, they should move together to a number of hospitality, recreational and landmark points
- Members of the group should remain in proximity with each other while moving
- Members of the group should enter and leave buildings at the same time
As part of this issue PedestrianFactory.AddEvacuAgentBehaviour()
will be refactored. Currently it uses the following structure:
AbstractEvacuAgentPedestrianFactory evacuAgentPedestrianFactory = null;
if (numberOfShooterAgentsSpawned < EvacuAgentSceneParamaters.NUMBER_OF_SHOOTER_AGENTS)
{
numberOfShooterAgentsSpawned++;
evacuAgentPedestrianFactory = shooterPedestrianFactory;
}
else if (numberOfWorkerAgentsSpawned < EvacuAgentSceneParamaters.NUMBER_OF_WORKER_AGENTS)
{
numberOfWorkerAgentsSpawned++;
evacuAgentPedestrianFactory = workerPedestrianFactory;
}
evacuAgentPedestrianFactory.CreateEvacuAgentPedestrian(pedestrian);
The new format will be similar to:
private void AddEvacuAgentBehaviour(Pedestrian pedestrian)
{
while (!agentFactories.isEmpty())
{
factory = random.choice(agentFactories);
factory.CreateEvacuaAgentPedestrian(pedestrian);
if (factory.hasSpawnedMaxPedestrians())
{
agentFactories.remove(factory);
}
}
}
This will aid in encapsulating factory specific data in each factory and was proposed as part of a discussion in MR 148
Edited by Josh Leeder