averbraeck / opentrafficsim

Open Source Multi-Level Traffic Simulator
BSD 3-Clause "New" or "Revised" License
28 stars 8 forks source link

Parsing of GTUTEMPLATEMIX #46

Closed WJSchakel closed 1 year ago

WJSchakel commented 1 year ago

In GeneratorSinkParser the GTUTEMPLATEMIX tag is currently not implemented. See // TODO: GTUTEMPLATEMIX. The surrounding code already uses Distribution<LaneBasedTemplateGtuType> gtuTypeDistribution which is filled with 1 template if no mix is used. The GTUTEMPLATEMIX does have an attribute WEIGHT for each referenced GTUTEMPLATE. So the information and data structures are available and this can be implemented.

WJSchakel commented 1 year ago

GTUTEMPLATEMIX specifies its own RANDOMSTREAM. The current use of Distribution<LaneBasedTemplateGtuType> gtuTypeDistribution is based on stream "generation". This ties in with issue #47.

WJSchakel commented 1 year ago

GtuTemplateMix can now be parsed. If the mix defines a random stream, it is used. Otherwise the stream of the generator is used.