A Model-based Test Case Generation Method for Function Testing of Train Control Systems