Adaptive safety for the smart factory