Generate machining program based on a simulation to optimize a machine parameter