User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
Hello Ali,
"that should do the trick" was simply another way of saying: it
should work.
Be sure to thoroughly read the documentation, especially when
trying to work with TraCI. Working with SUMO via TraCI means you
are handling the simulation and its data in a relatively 'low
level' way, that is, you are dealing with details of SUMO and
TraCI and will need extensive knowledge of what happens and what
things mean. The documentation for both SUMO and TraCI is pretty
good in my opinion, you should be able to find all you need there
(though sometimes you have to do a little deduction here and
there).
Concerning 'getVehicleData': my Python skills are limited (I have
only used TraCI natively in C# and C), but I am reading this as a
function declaration: it accepts a string, and returns a list of
tuples. The periods simply mean the list might contain an infinite
number of tuples. If this does not make sense, you are going to
have to study Python for a bit, cause you will need that to work
with TraCI via Python succesfully. You will have to be able to
work with the list and the tuples it cotains.
In short: be sure to carefully study the documentation. If things
seem to make no sense, take a step back, search the internet, try
again, study what happend and repeat. And then if all else fails
there is the mailing list: be sure to precisely state the problem
you are trying to solve.
Hope this makes sense, greets,
Menno
On 14-5-2021 15:34, ali mirzaei wrote:
1- What trick do you exactly mean?
2- What do you think of those three points at the end of
the following function:
I think the e1 type is unfit for this, since it has no
real length. e2 could be used if the area you are
interested in lies on a single edge. In that case the
methods you mentioned should do the trick, and otherwise
consult the documentation: you could also retrieve data
for an edge, for example: https://sumo.dlr.de/docs/TraCI/Edge_Value_Retrieval.html
I have had a look at it. But, as far as I
know, I should ask the simulation to get or set the
vehicle data one at a time via that
module(traci.vehicle). I am looking for a facility to
get the flow data at a specific point automatically
which I was thinking could be e1 or e2 detector.
That function should return the described
value. However, if no vehicles were on the
detector during the last step, no valid
data can be returned, so you get -1 and
(). If a vehicle was on the detector
during the last step, the method will give
you the data.
Greets, Menno
On 14-5-2021 10:04, ali mirzaei wrote:
Hi Menno,
This is what the mannaul says: getLastStepMeanSpeed(self, detID)
getLastStepMeanSpeed(string)
-> double
Returns the current mean speed in
m/s of vehicles that were on the
named e2.
I am looking for a tool by which I
can extract the flow characteristics
at the time the vehicle is on the
detector. So, is there any option to
get more data of vehicles in
traci.lanearea module?
the e1 detector has no length, I think
you should use an e2 detector if
you want to have a detector that
covers an area.
Regarding the functions: when do you
call these? I'd expect -1 and ()
when no vehicles were on the detector
during the last step. So at the
start of the simulation, you will most
likely get those results. And
afterwards if there has been no
traffic.
Greets, Menno
On 13-5-2021 23:28, ali mirzaei wrote:
> Hi everyone,
> 1- What is the length of the
induction loop(e1detector)?
> 2- in the case of e2detector,
when I generate my add.XML file
consisting of:
> <e2Detector
id="e2Detector_1" lane="e2_0"
pos="15.22"
> length="10.00" freq="5"
file="e2_det.xml" friendlyPos="1"/>
> and call the functions:
>
print(traci.lanearea.getLastStepMeanSpeed("e2Detector_1"))
>
print(traci.lanearea.getLastStepVehicleIDs("e2Detector_1"))
> the answer is "-1" and "()".
> Why does this happen?
> Any help would be appreciated.
>
> Regards,
> Ali
>
_______________________________________________
> sumo-user mailing list
> sumo-user@xxxxxxxxxxx
> To unsubscribe from this list,
visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user