1

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?

1 Answers1

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