I created a custom network, and put a parkingArea shown below.
[image: image.png]

Then, I made a python script that basically add a new vehicle with a route
to follow and then insert a new stop at the designated parkingArea above.
The python script is as follows.
import traci
import traci.constants as tc

# Connect to the Sumo server
traci.start(['sumo-gui', '-c', "D:\sumoworks\customcityblock2.sumocfg"])

# Spawn a vehicle at (x1,y1) and set its destination to (x2,y2)
x1, y1 = 0, 0
x2, y2 = 100, 0
veh_id = "vehicle_1"
#traci.vehicle.add(veh_id, "route_1", depart=0, pos=x1, lane=0,
typeID="CAR1")


#traci.vehicle.changeTarget(veh_id, (x2, y2))
#print("FINDROUTE: ", traci.simulation.findRoute("E45","E103","CAR1",50,0))
counter = 0
# Simulate for 1000 time steps
for i in range(1000):
    if i == 30:
        traci.vehicle.add(veh_id,"r_0","CAR1")
        traci.vehicle.moveToXY(veh_id,"E0",1,0,0)
        traci.vehicle.insertStop(veh_id,0,"pa_0",duration=100,flags=tc.
STOP_PARKING_AREA)

#traci.vehicle.setParkingAreaStop(veh_id,"pa_0",100,flags=tc.STOP_PARKING_AREA)
        traci.vehicle.insertStop(veh_id,1,"E86",duration=30)

        #traci.vehicle.moveTo(veh_id,"E0_1",(0,20),0)
        #traci.vehicle.changeTarget(veh_id,"E86")

    traci.simulationStep()

# Close the connection to the Sumo server
traci.close()

The additional xml file that define the parkingArea is as follows.
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2023-04-15 01:04:55 by Eclipse SUMO netedit Version 1.16.0
-->

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd";>
    <!-- StoppingPlaces -->
    <parkingArea id="pa_0" name="park1" lane="-E118_0" startPos="100.75"
endPos="120.75" roadsideCapacity="3" width="4.00" length="10.00" angle=
"45.00" departPos="0"/>
</additional>

When I run the python script, the SUMO GUI pops up. I run the simulation.
At time 30, the designated vehicle is added into simulation and starts to
follow its route. Then when the vehicle reach the parkingArea, it stops at
the road lane, not on the roadside, even though I already define
roadsideCapacity = 3, as shown below.
[image: image.png]

After some time, it start to move again to next stop....

Why is the vehicle not parked at the parkingArea roadside?
_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to