I have two types of vehicles,
A and B. The total number of vehicles must be split between both types. I'm testing if the number of SSM conflicts reduces as the penetration ratio of type
B vehicles increase from 0%, 25%, 50%, and so on. I also need to repeat for increasing traffic demand (1000 veh/hr, 1500 veh/hr, 2000 veh/hr).
So, for the base case, I need to insert 1000 vehicles per hour (all as type
A).
How can I create random trips of `N` vehicles per hour, where 75% of them are of vehicle type `A` and 25% of type `B`.
My current approach uses RandomTrips.py with the –insertion-rate` option equal to `N` and a `vTypeDistribution` containing two vehicles types leveraging the `probability` attribute with values `A` and `B`.
randomTrips.py
--net-file="grid.net.xml"
--output-trip-file="trips.trips.xml"
--trip-attributes='departPos="random" departSpeed="max"
type="civilianVehicles" departLane="best"'
--min-distance=1500
--allow-fringe
--fringe-factor="10000"
--insertion-rate=100
This approach doesn’t guarantee the ratios I need as it relies on probability.