Discussion:
[sumo-user] Person doesn't ride on vehicle added with TraCI
Giannis Bakas
2015-03-31 14:09:55 UTC
Permalink
Dear all,

I want to create a bus on demand simulation using sumo. For this reason
I am using TraCI to add vehicles during simulation. The persons are
created statically from xml files. With sumo 0.22.0 everything worked
fine, but with sumo 0.23.0 persons don't ride on the dynamically created
vehicle, even though the vehicle stops at the station. I am using both
line and vehicle id on the lines attribute of person.

Here is the TraCI code for adding the bus:

traci.vehicle.addFull("DEMANDBUS","BUS_ONDEMAND_ROUTE",typeID="BUS_DEMAND",line="2",depart="239")
traci.vehicle.setStop("DEMANDBUS","116895988#2",pos=200,laneIndex=0,duration=20,flags=0)
traci.vehicle.setStop("DEMANDBUS","116895988#4",pos=90,laneIndex=0,duration=20,flags=0)

and here is the person configuration with line:

<person id="person0" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="195"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>
</person>

P.S. I really loved the TraCI API for persons and the show routes
functionality on the GUI.

best regards,
Giannis
Michael Behrisch
2015-03-31 16:31:10 UTC
Permalink
Hi Giannis,
vehicles now have a person capacity which needs to be defined in the
vehicle type, see
http://www.sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Types,
so please share your type definition as well. The default should be 4
but maybe something is wrong here.

Best regards,
Michael
Post by Giannis Bakas
Dear all,
I want to create a bus on demand simulation using sumo. For this reason
I am using TraCI to add vehicles during simulation. The persons are
created statically from xml files. With sumo 0.22.0 everything worked
fine, but with sumo 0.23.0 persons don't ride on the dynamically created
vehicle, even though the vehicle stops at the station. I am using both
line and vehicle id on the lines attribute of person.
traci.vehicle.addFull("DEMANDBUS","BUS_ONDEMAND_ROUTE",typeID="BUS_DEMAND",line="2",depart="239")
traci.vehicle.setStop("DEMANDBUS","116895988#2",pos=200,laneIndex=0,duration=20,flags=0)
traci.vehicle.setStop("DEMANDBUS","116895988#4",pos=90,laneIndex=0,duration=20,flags=0)
<person id="person0" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="195"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>
</person>
P.S. I really loved the TraCI API for persons and the show routes
functionality on the GUI.
best regards,
Giannis
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sumo-user mailing list
https://lists.sourceforge.net/lists/listinfo/sumo-user
Giannis Bakas
2015-04-01 06:39:24 UTC
Permalink
Hi Michael,

I defined the person capacity on the vType, you can see the xml below:

<vType id="BUS_DEMAND" accel="2.6" decel="4.5" sigma="0" length="12"
minGap="3" maxSpeed="70" color="0,1,0" guiShape="bus" personCapacity="50"/>

also I added it on TraCI code too (I made a mistake previously on stop
duration, now I defined it in milliseconds)

traci.vehicle.addFull("DEMANDBUS","BUS_ONDEMAND_ROUTE",typeID="BUS_DEMAND",line="2",depart="239",personCapacity=50)
traci.vehicle.setStop("DEMANDBUS","116895988#2",pos=200,laneIndex=0,duration=20000,flags=0)
traci.vehicle.setStop("DEMANDBUS","116895988#4",pos=90,laneIndex=0,duration=20000,flags=0)

also I tried to defined it both in the xml and the TraCI, but with no
success.

regards,
Giannis
Post by Michael Behrisch
Hi Giannis,
vehicles now have a person capacity which needs to be defined in the
vehicle type, see
http://www.sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Types,
so please share your type definition as well. The default should be 4
but maybe something is wrong here.
Best regards,
Michael
Post by Giannis Bakas
Dear all,
I want to create a bus on demand simulation using sumo. For this reason
I am using TraCI to add vehicles during simulation. The persons are
created statically from xml files. With sumo 0.22.0 everything worked
fine, but with sumo 0.23.0 persons don't ride on the dynamically created
vehicle, even though the vehicle stops at the station. I am using both
line and vehicle id on the lines attribute of person.
traci.vehicle.addFull("DEMANDBUS","BUS_ONDEMAND_ROUTE",typeID="BUS_DEMAND",line="2",depart="239")
traci.vehicle.setStop("DEMANDBUS","116895988#2",pos=200,laneIndex=0,duration=20,flags=0)
traci.vehicle.setStop("DEMANDBUS","116895988#4",pos=90,laneIndex=0,duration=20,flags=0)
<person id="person0" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="195"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>
</person>
P.S. I really loved the TraCI API for persons and the show routes
functionality on the GUI.
best regards,
Giannis
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sumo-user mailing list
https://lists.sourceforge.net/lists/listinfo/sumo-user
Michael Behrisch
2015-04-01 17:25:10 UTC
Permalink
Hi Giannis,
the new sumo version is much pickier about the exact positioning of the
persons and the vehicles for boarding. The person has to be located at
the exact stop position (well actually between startPos and endPos of
the stop but you can define only the endPos with traci). I opened a
ticket for a more flexible traci API
http://sumo.dlr.de/trac.wsgi/ticket/1717. The person capacity for the
vehicle is useless by the way, it is a vehicle type attribute (the API
is wrong here).

Regards,
Michael
Post by Giannis Bakas
Hi Michael,
<vType id="BUS_DEMAND" accel="2.6" decel="4.5" sigma="0" length="12"
minGap="3" maxSpeed="70" color="0,1,0" guiShape="bus"
personCapacity="50"/>
also I added it on TraCI code too (I made a mistake previously on
stop duration, now I defined it in milliseconds)
traci.vehicle.addFull("DEMANDBUS", "BUS_ONDEMAND_ROUTE",
typeID="BUS_DEMAND", line="2", depart="239", personCapacity=50)
traci.vehicle.setStop("DEMANDBUS", "116895988#2", pos=200,
laneIndex=0, duration=20000, flags=0)
traci.vehicle.setStop("DEMANDBUS", "116895988#4", pos=90, laneIndex=0,
duration=20000, flags=0)
also I tried to defined it both in the xml and the TraCI, but with no
success.
regards,
Giannis
Post by Michael Behrisch
Hi Giannis,
vehicles now have a person capacity which needs to be defined in the
vehicle type, see
http://www.sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Types
Post by Michael Behrisch
[3],
so please share your type definition as well. The default should be 4
but maybe something is wrong here.
Best regards,
Michael
Post by Giannis Bakas
Dear all,
I want to create a bus on demand simulation using sumo. For this reason
I am using TraCI to add vehicles during simulation. The persons are
created statically from xml files. With sumo 0.22.0 everything worked
fine, but with sumo 0.23.0 persons don't ride on the dynamically created
vehicle, even though the vehicle stops at the station. I am using both
line and vehicle id on the lines attribute of person.
traci.vehicle.addFull("DEMANDBUS","BUS_ONDEMAND_ROUTE",typeID="BUS_DEMAND",line="2",depart="239")
traci.vehicle.setStop("DEMANDBUS","116895988#2",pos=200,laneIndex=0,duration=20,flags=0)
traci.vehicle.setStop("DEMANDBUS","116895988#4",pos=90,laneIndex=0,duration=20,flags=0)
Post by Michael Behrisch
Post by Giannis Bakas
<person id="person0" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="195"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>
</person>
P.S. I really loved the TraCI API for persons and the show routes
functionality on the GUI.
best regards,
Giannis
------------------------------------------------------------------------------
Post by Michael Behrisch
Post by Giannis Bakas
Dive into the World of Parallel Programming The Go Parallel
Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought
leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/ [1]
_______________________________________________
sumo-user mailing list
https://lists.sourceforge.net/lists/listinfo/sumo-user [2]
------
[1] http://goparallel.sourceforge.net/
[2] https://lists.sourceforge.net/lists/listinfo/sumo-user
[3]
http://www.sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Types
Giannis Bakas
2015-04-06 07:26:54 UTC
Permalink
Thanks a lot Michael, I really appreciate your quick reply.

Just to inform you that buses loaded from the xml are working fine,
probably because
the vehicle knows the start and end position of the stop, as you mentioned.

kind regards,
Giannis
Post by Michael Behrisch
Hi Giannis,
the new sumo version is much pickier about the exact positioning of
the persons and the vehicles for boarding. The person has to be
located at the exact stop position (well actually between startPos and
endPos of the stop but you can define only the endPos with traci). I
opened a ticket for a more flexible traci API
http://sumo.dlr.de/trac.wsgi/ticket/1717. The person capacity for the
vehicle is useless by the way, it is a vehicle type attribute (the API
is wrong here).
Regards,
Michael
Post by Giannis Bakas
Hi Michael,
<vType id="BUS_DEMAND" accel="2.6" decel="4.5" sigma="0" length="12"
minGap="3" maxSpeed="70" color="0,1,0" guiShape="bus"
personCapacity="50"/>
also I added it on TraCI code too (I made a mistake previously on
stop duration, now I defined it in milliseconds)
traci.vehicle.addFull("DEMANDBUS", "BUS_ONDEMAND_ROUTE",
typeID="BUS_DEMAND", line="2", depart="239", personCapacity=50)
traci.vehicle.setStop("DEMANDBUS", "116895988#2", pos=200,
laneIndex=0, duration=20000, flags=0)
traci.vehicle.setStop("DEMANDBUS", "116895988#4", pos=90, laneIndex=0,
duration=20000, flags=0)
also I tried to defined it both in the xml and the TraCI, but with no
success.
regards,
Giannis
Post by Michael Behrisch
Hi Giannis,
vehicles now have a person capacity which needs to be defined in the
vehicle type, see
http://www.sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Types
Post by Michael Behrisch
[3],
so please share your type definition as well. The default should be 4
but maybe something is wrong here.
Best regards,
Michael
Post by Giannis Bakas
Dear all,
I want to create a bus on demand simulation using sumo. For this reason
I am using TraCI to add vehicles during simulation. The persons are
created statically from xml files. With sumo 0.22.0 everything worked
fine, but with sumo 0.23.0 persons don't ride on the dynamically created
vehicle, even though the vehicle stops at the station. I am using both
line and vehicle id on the lines attribute of person.
traci.vehicle.addFull("DEMANDBUS","BUS_ONDEMAND_ROUTE",typeID="BUS_DEMAND",line="2",depart="239")
traci.vehicle.setStop("DEMANDBUS","116895988#2",pos=200,laneIndex=0,duration=20,flags=0)
traci.vehicle.setStop("DEMANDBUS","116895988#4",pos=90,laneIndex=0,duration=20,flags=0)
Post by Michael Behrisch
Post by Giannis Bakas
<person id="person0" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="195"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>
</person>
P.S. I really loved the TraCI API for persons and the show routes
functionality on the GUI.
best regards,
Giannis
------------------------------------------------------------------------------
Post by Michael Behrisch
Post by Giannis Bakas
Dive into the World of Parallel Programming The Go Parallel
Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought
leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/ [1]
_______________________________________________
sumo-user mailing list
https://lists.sourceforge.net/lists/listinfo/sumo-user [2]
------
[1] http://goparallel.sourceforge.net/
[2] https://lists.sourceforge.net/lists/listinfo/sumo-user
[3]
http://www.sumo.dlr.de/wiki/Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Types
Michael Behrisch
2015-04-07 08:31:44 UTC
Permalink
Hi Giannis,
Post by Giannis Bakas
Just to inform you that buses loaded from the xml are working fine,
probably because
the vehicle knows the start and end position of the stop, as you mentioned.
Just to get this one right. If you give exactly the same stops via XML
instead of TraCI it works? Or do you have larger stops (meaning startPos
and endPos differ considerably) then?

Regards,
Michael
Giannis Bakas
2015-04-07 09:26:51 UTC
Permalink
Hi Michael,

I confirm that with the bus configured in xml, stops and the person
jumps on the bus. Here is the xml code:

*<!-- bus.add.xml-->*
<busStop id="busstop1" lane="116895988#2_0" startPos="180"
endPos="200" lines="1 2"/>
<busStop id="busstop2" lane="116895988#4_0" startPos="70"
endPos="90" lines="1 2"/>

<vType id="BUS_DEMAND" accel="2.6" decel="4.5" sigma="0"
length="12" minGap="3" maxSpeed="70" color="0,1,0" guiShape="bus"
personCapacity="50"/>

<vType id="BUS" accel="2.6" decel="4.5" sigma="0" length="12"
minGap="3" maxSpeed="70" color="1,1,0" guiShape="bus" personCapacity="50"/>

*<!-- This flow of bus stops and the persons jumps on the bus -->*
<flow id="BUSLINE1" type="BUS" depart="0" period="300" line="1">
<route edges="116895988#2...319033097#2"/>
<stop busStop="busstop1" duration="20"/>
<stop busStop="busstop2" duration="20"/>
</flow>

*<!-- Here are the persons, person-2 doesn't jump on the vehicle with
type BUS_DEMAND added by traci define with line=2-->*
<person id="person-1" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="120"
arrivalPos="190"/>
<ride from="116895988#2" to="116895988#4" lines="1"/>
<!--<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>-->
</person>

<person id="person-2" depart="239">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="190"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<!--<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>-->
</person>

<person id="person-3" depart="400">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="190"/>
<ride from="116895988#2" to="116895988#4" lines="1"/>
<!--<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>-->
</person>

I remain at your disposal for any clarification.

Giannis
Post by Michael Behrisch
Hi Giannis,
Post by Giannis Bakas
Just to inform you that buses loaded from the xml are working fine,
probably because
the vehicle knows the start and end position of the stop, as you mentioned.
Just to get this one right. If you give exactly the same stops via XML
instead of TraCI it works? Or do you have larger stops (meaning startPos
and endPos differ considerably) then?
Regards,
Michael
Michael Behrisch
2015-04-08 21:51:10 UTC
Permalink
Hi Giannis,
the case is like I originally assumed, that the stops added via the XML
are much larger than the stops added via TraCI and as such cover the
position of the person while the traci stops don't.

Regards,
Michael
Post by Giannis Bakas
Hi Michael,
I confirm that with the bus configured in xml, stops and the person
*<!-- bus.add.xml-->*
<busStop id="busstop1" lane="116895988#2_0" startPos="180"
endPos="200" lines="1 2"/>
<busStop id="busstop2" lane="116895988#4_0" startPos="70"
endPos="90" lines="1 2"/>
<vType id="BUS_DEMAND" accel="2.6" decel="4.5" sigma="0" length="12"
minGap="3" maxSpeed="70" color="0,1,0" guiShape="bus" personCapacity="50"/>
<vType id="BUS" accel="2.6" decel="4.5" sigma="0" length="12"
minGap="3" maxSpeed="70" color="1,1,0" guiShape="bus" personCapacity="50"/>
*<!-- This flow of bus stops and the persons jumps on the bus -->*
<flow id="BUSLINE1" type="BUS" depart="0" period="300" line="1">
<route edges="116895988#2...319033097#2"/>
<stop busStop="busstop1" duration="20"/>
<stop busStop="busstop2" duration="20"/>
</flow>
*<!-- Here are the persons, person-2 doesn't jump on the vehicle with
type BUS_DEMAND added by traci define with line=2-->*
<person id="person-1" depart="150">
<walk from="116895988#2" to="116895988#2" departPos="120"
arrivalPos="190"/>
<ride from="116895988#2" to="116895988#4" lines="1"/>
<!--<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>-->
</person>
<person id="person-2" depart="239">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="190"/>
<ride from="116895988#2" to="116895988#4" lines="2"/>
<!--<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>-->
</person>
<person id="person-3" depart="400">
<walk from="116895988#2" to="116895988#2" departPos="125"
arrivalPos="190"/>
<ride from="116895988#2" to="116895988#4" lines="1"/>
<!--<walk from="116895988#4" to="116895988#4" departPos="85"
arrivalPos="125"/>-->
</person>
I remain at your disposal for any clarification.
Giannis
Post by Michael Behrisch
Hi Giannis,
Post by Giannis Bakas
Just to inform you that buses loaded from the xml are working fine,
probably because
the vehicle knows the start and end position of the stop, as you mentioned.
Just to get this one right. If you give exactly the same stops via XML
instead of TraCI it works? Or do you have larger stops (meaning startPos
and endPos differ considerably) then?
Regards,
Michael
Loading...