In principle any object in simulation can create GTUs on the network, and a few pre-defined generators are available in OTS. Here only one such generator is discussed as is it the most used generator, and as it is general purpose and modular. This generator is
LaneBasedGTUGenerator. It has the following components:
IdGeneratorthat generates an id for the generated GTUs. This can be shared between GTU generators.
Lane-based GTU generator ⌊ Inter-arrival time generator ⌊ GTU characteristics generator ⌊ Positions ⌊ Room checker ⌊ ID generator
LaneBasedGTUGenerator has three methods that define a few simulation choices. These are listed below, and further explained in section Options for GTU generation.
setNoLcDistance(Length)to set the distance over which GTUs may not change lane after the generator.
setInstantaneousLaneChange(boolean)to use instantaneous lane changes or not.
setErrorHandler(GTUErrorHandler)to set the handler of GTU errors.