Definition of vehicle type
In SUMO, the type of vehicle defined by the vType tag can generally be written as follows:
<vType id="vt1" length="5.0" color="1,0,0" minGap="2.00" maxSpeed="27.78" carFollowModel="Krauss" accel="2.5" decel="4.5" emergencyDecel="6.5" tau="1.5" speedDev="0.05" laneChangeModel="LC2013" lcAssertive="1.0" lcStrategic="1.0" lcCooperative="1.0"/>
Vehicle attributes can be referenced Vehicle Properties . In addition, the parameters related to the car-following model and the parameters related to the lane-changing model are modified in the vType tag. Following Model Parameters , Transit Model Parameters.
If you need to define a variety of vehicle types and they meet a certain proportion relationship, you can define a vehicle distribution to represent them:
<vTypeDistribution id="typedist1"> <vType id="AV" length="5.0" color="1,0,0" minGap="2.00" maxSpeed="27.78" carFollowModel="Krauss" accel="2.5" decel="4.5" emergencyDecel="6.5" tau="1.5" speedDev="0.05" laneChangeModel="LC2013" lcAssertive="1.0" lcStrategic="1.0" lcCooperative="1.0" probability="1.0"/> <vType id="HDV" length="5.0" color="1,0,0" minGap="2.00" maxSpeed="27.78" carFollowModel="Krauss" accel="2.5" decel="4.5" emergencyDecel="6.5" tau="1.5" speedDev="0.05" laneChangeModel="LC2013" lcAssertive="1.0" lcStrategic="1.0" lcCooperative="1.0" probability="0.0"/> </vTypeDistribution>
The attribute probability represents the proportion of vehicles of this type.
Writing of routes (vehicle input)
Routes are defined using the label route and can generally be expressed as follows:
<route id="route0" edges="edg0 edg1 edg2 edg3 edg4 edg5 edg6"/>
edges are an ordered sequence of all edge IDs that a vehicle passes through from the start edge ID to the destination edge id, including the start edge ID.
Once the route is defined, the input to the vehicle can be defined by the flow tag, which can be written as follows:
<flow id="1" type="typedist1" route="route0" begin="0" end="3600" vehsPerHour="6500" departPos="1.0" departLane="best" departSpeed="27" />
type: You can write the id name (vt1) that corresponds to the definition of the vType or the id name (typedist1) that corresponds to the definition of the vehicle distribution.
Route: the id name corresponding to the route when it is defined;
begin: start time of vehicle generation
begin: end time of vehicle generation
vehsPerHour: The number of vehicles (traffic) generated in one hour, which can be replaced by number, probability, and period. Number represents the total number of vehicles that can enter the network; probability represents the probability of one vehicle entering the network in one second; period represents the probability of entering a vehicle into the network every period second.
departPos, departLane, departSpeed are optional parameters that define where the vehicle enters the network, the lane, and the initial speed. In addition to these three parameters, there are other parameters to choose from, and the description can be used as a reference. Description of vehicles entering and leaving the network.
Routing Files
Routing files are defined using the label routes and can generally be expressed as follows:
<routes> <vTypeDistribution id="typedist1"> <vType id="AV" length="5.0" color="1,0,0" minGap="2.00" maxSpeed="27.78" carFollowModel="Krauss" accel="2.5" decel="4.5" emergencyDecel="6.5" tau="1.5" speedDev="0.05" laneChangeModel="LC2013" lcAssertive="1.0" lcStrategic="1.0" lcCooperative="1.0" probability="1.0"/> <vType id="HDV" length="5.0" color="1,0,0" minGap="2.00" maxSpeed="27.78" carFollowModel="Krauss" accel="2.5" decel="4.5" emergencyDecel="6.5" tau="1.5" speedDev="0.05" laneChangeModel="LC2013" lcAssertive="1.0" lcStrategic="1.0" lcCooperative="1.0" probability="0.0"/> </vTypeDistribution> <route id="edge1_1" edges="edg0 edg0.1 edg1 edg2 edg3 edg4 edg5 edg6" /> <flow id="1" type="typedist1" route="edge1_1" begin="0" end="3600" vehsPerHour="6500" departPos="1.0" departLane="best" departSpeed="27" /> </routes>
Routing files are simply written together with vType, route, flow.
Note: In addition to the above writing, there are other ways to generate routing files in SUMO. You can refer specifically to the official website Traffic Demand and Modeling