Intelligent Embedded Rolling Stock Safety Devices Using an Immune Clonal Selection Algorithm