Add power_source method to train.rb