Simulating the flow of people – optimising safety and efficiency