Theses are codes for the simulation of fixed route, flexible route, and door-to-door service. Some parameters are originated from MTA B63 Bus route, connecting Cobble Hill and Bay Ridge, as an example.
: functioning as a control panel of inputs, and users can adjust simulation parameters and choose a system to simulation.
: representing each system type (fixed route system / flexible route system / door-to-door service) and identifying simulation elements, initialize vehicle information, determine passenger-vehicle matches, and produce simulation outputs by organizing other function accordingly.
: receiving passenger information and prepare arrays for intermediate outputs
: conducting insertion heuristic to evaluate candidate routes and archive the best one for each vehicle
: processing passenger pickup when staying at stops and determine vehicles’ movement when leaving stops
: determining vehicles’ movement when moving and process passenger pickup and drop-off when arriving at stops
: identifying feasible segments for passengers’ approach
: evaluating candidate routes considering intersections with approaching passengers and archive the best one for each vehicle
: receiving passenger information and prepare arrays for intermediate outputs
: yielding the anticipated location after a given time or calculate a required time to reach the next point
: generating artificial passengers within the service area according to the demand level if data should be generated