  In this paper we devise a microscopic (agent-based) mathematical model for
reproducing crowd behaviour in a specific scenario: a number of pedestrians,
consisting of numerous social groups, flow along a corridor until a gate
located at the end of the corridor closes. People are not informed about the
closure of the gate and perceive the blockage observing dynamically the local
crowd conditions. Once people become aware of the new conditions, they stop and
then decide either to stay, waiting for reopening, or to go back and leave the
corridor for ever. People going back hit against newly incoming people who are
not yet aware of the blockage or have already decided to stay. This creates a
dangerous counter-flow which can easily lead to accidents. We run several
numerical simulations varying parameters which control the crowd behaviour, in
order to understand the factors which have the greatest impact on the dynamics.
We conclude with some useful suggestions directed to the organizers of mass
events.
