Optimisation of automatic train protection systems.