A deadlock prevention method for railway networks using monitors for colored Petri nets