I studied in sumo that we can define a parking area.Can we simulate the same scenario(road network with parking area) in veins as well. I want to simulate a parking area scenario in veins so is veins compatible with the parking area definition of sumo?
Asked
Active
Viewed 121 times
1
-
What do you mean by "compatible"? How would you expect your network nodes to act in this scenario? – Christoph Sommer May 07 '17 at 21:25
-
I want my nodes to stop at parking area for some duration and then leave the area ?? – Rohit Tapikar May 07 '17 at 21:26
-
Your question might be along the lines of the following then: http://stackoverflow.com/q/43700488/4707703 – Christoph Sommer May 07 '17 at 21:28
1 Answers
3
When you configure SUMO XML files with a ParkedArea
, in VEINS, vehicles will appear parked in the defined areas. In VEINS 5, you can handle whether or not a vehicle is parked using the handleParkingUpdate()
method.
Example of configuration in SUMO XML files:
.net.xml file:
<parkingArea id="parkingArea1" lane="D2D3_0" roadsideCapacity="1" startPos="10.00" endPos="20.00"/>
.rou.xml file:
<vehicle id="0.10" depart="0.00">
<route edges="D2D3"/>
<stop parkingArea="parkingArea1" duration="3600.00"/>
</vehicle>
VEINS method:
void MyClass::handleParkingUpdate(cObject* obj) {
DemoBaseApplLayer::handleParkingUpdate(obj);
//IF CAR IS PARKED
if (mobility->getParkingState()) {
//set color blue+red to parked cars
findHost()->getDisplayString().updateWith("r=20,red");
findHost()->getDisplayString().setTagArg("i", 1, "blue");
}
}
I hope this helps.

dnat
- 88
- 6