c++ train system simiulation