Hi Tianli,
 
I don't know why it does not work on your system. Please have a look both 
"SUMO_HOME" environment variable and whether you have some installed some 
python module called traci. Please try your script with environment 
variable "SUMO_HOME" pointing to the latest SUMO release installation and 
no python module traci installed. You can use our test scenario
<https://sumo.dlr.de/extractTest.php?path=complex/traci/inductionloop/inductionloop>
 
for TraCI induction loops as well to see whether there is a problem with 
your script.
 
Best regards
Mirko
 
 
 
 
-----Original-Nachricht-----
Betreff: 回复:AW: [sumo-user] AttributeError: 'InductionLoopDomain' object 
has no attribute 'getLastIntervalVehicleNumber'
Datum: 2024-01-16T09:53:47+0100
Von: "薛田莉" <xue...@mail2.sysu.edu.cn>
An: "Mirko Barthauer" <m.bartha...@t-online.de>
 
 
 
I tested these two lines of code separately, and only the above line 
reported an error.

print("检测器上一时段流量是", 
inductionloop.getLastIntervalVehicleNumber("e1det_19610445_0"))

print("检测器上一时刻流量是", inductionloop.getLastStepVehicleNumber("e1det_19610445_0"))

And when I hover my mouse over this function, a description like the one 
below appears.
 
I can't find a solution to this error. So I wonder if there is another way 
to get the real-time number of vehicles passing the e1 detector.
 
Any help is greatly appreciated.
Thanks and Regards,
Tianli
----------回复的邮件信息----------
Mirko Barthauer<m.bartha...@t-online.de> 在 2024年1月16日 周二 15:30 写道:


  
 This sounds strange indeed. The call looks good at first sight. Can you
 look if by accident you have some control character
 <https://en.wikipedia.org/wiki/Control_character> in the code close/inside
 this TraCI call? Some text editors do not show control characters by
 default or hide some...
  
 Best regards
 Mirko
  
  
  
  
 -----Original-Nachricht-----
 Betreff: [sumo-user] AttributeError: 'InductionLoopDomain' object has no
 attribute 'getLastIntervalVehicleNumber'
 Datum: 2024-01-16T05:30:13+0100
 Von: "薛田莉 via sumo-user" <sumo-user@eclipse.org>
 An: "sumo-user@eclipse.org" <sumo-user@eclipse.org>
  
  
  
 Hello,
 I intend to get the vehicle number of last interval by

 traci.inductionloop.getLastIntervalVehicleNumber

 But when I ran the following code, an error occured. I wonder if there is
 a way to solve this error?

   File "G:\xtl\xtl\2023 June\pythonProject\sumo variable lane\sumo.py", line 
46, in run    

  print("检测器上一时段流量是", 
traci.inductionloop.getLastIntervalVehicleNumber("e1det_-15535912_0"))

  AttributeError: 'InductionLoopDomain' object has no attribute 
'getLastIntervalVehicleNumber'

 Any help is greatly appreciated.
 Thanks and Regards,
 Tianli

 -----------------------------------------------------------------------

  
 发自我的企业微信
 
<https://work.weixin.qq.com/wework_admin/user/h5/qqmail_user_card/vc7b3a039c87cfcb85?from=myprofile>
  
  
  
 


Attachment: 3BB71BE2@03679F1E.0D44A66500000000.png
Description: Binary data

_______________________________________________
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