1) Querying multiple edges must be done from your own code by iterating
over the ids and calling getLastStepVehicleNumber(self, edgeID) and then
summing up the results

2) sumolib supports retrieval of edges in a square centered on a given
point with the size specified as 'radius' (half the size of the square).
See
https://sumo.dlr.de/wiki/Tools/Sumolib#locate_nearby_edges_based_on_the_geo-coordinate.
You could easily adapt this function to support rectangles instead of
squares.
You may also want to take a look at sumo/tools/district/gridDistricts.py
which groups edges according to a regular grid. Another related tool is
sumo/tools/edgesInDistrict which collects edges within an arbitrary shape.

regards,
Jakob

Am Do., 25. Apr. 2019 um 10:49 Uhr schrieb Sheshadri Kalkunte Ramachandra <
[email protected]>:

> Namaste,
>
> I have the following 2 doubts regarding the traci-api.
>
>
> *--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*
> 1. This is regarding the getLastStepVehicleNumber()
>
> Link:
> https://sumo.dlr.de/pydoc/traci._edge.html#EdgeDomain-getLastStepVehicleNumber
> Python: module traci._edge - sumo.dlr.de
> <https://sumo.dlr.de/pydoc/traci._edge.html#EdgeDomain-getLastStepVehicleNumber>
> class EdgeDomain(traci.domain.Domain): Methods defined here:
> __init__(self) adaptTraveltime(self, edgeID, time, begin=None, end=None)
> adaptTraveltime(string, double, double, double) -> None Adapt the travel
> time value (in s) used for (re-)routing for the given edge. When setting
> begin time and end time (in seconds), the changes only
> sumo.dlr.de
> *Existing Api: *getLastStepVehicleNumber(self, edgeID)
>
> *Input: *edgeId
> *Output*:  Number of vehicles in the given edgeID.
>
> *Requirement : *getLastStepVehicleNumber(self,List<edgeID>)
> *Input:* List<edgeID>
> *Output:* List of number of vehicles in each edgeID
>
>
> *--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*
>
> 2. Is there any support for the following requirement? (range querying of
> edgeID)
>
> *Requirement:  *If I pass two points P and Q, which internally 2
> positions obtained by *getPosition*(self, vehID), can I *get a list of
> all edges present in the rectangle in which P and Q *are two diagonal
> points? Does sumo support any such api?
>
> Link:
> https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-getPosition
> Python: module traci._vehicle - sumo.dlr.de
> <https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-getPosition>
> data and other attributes defined here: depart_container_triggered = -2
> depart_lane_allowed_free = -4 depart_lane_best_free = -5
> depart_lane_first_allowed = -6 depart_lane_free = -3 depart_lane_random =
> -2 depart_now = -3 depart_speed_max = -3 depart_speed_random = -2
> depart_triggered = -1 last_travel_time_update = -1 stop_bus_stop = 8
> stop_charging_station = 32 stop_container_stop = 16
> sumo.dlr.de
> *Input:* P, Q
> *Output:* List of edgeID
> I have attached a figure to explain the requirement. (sumo_traci.jpg)
>
> *--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*
>
> Regards,
> Sheshadri K R
>
> +91-9845213149
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to