It's not that easy. You need accurate models of your machine, the tools and the stock material. Your simulation has to be linked to the real machine movements and be ahead of time so you can estop the machine before the crash happens.
But that still doesn't help in case of insufficient workholding or breaking tools.
But that still doesn't help in case of insufficient workholding or breaking tools.