Implement the trip generation functions

The trip generation functions has been implemented, and the main model
module has been modified a little since there is some redundant
information in the argument.