Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Smart Street Lighting System

Hi,
the error is in your run method:

Am 18.03.2018 um 20:21 schrieb Pravin Ghorpade:

> def run():
> 
>     while traci.simulation.getMinExpectedNumber() > 0:
>               traci.simulationStep()            
>     print("hello")
>     print(traci.poi.getColor("1"))
>     print(traci.poi.setColor("1",[0,0,255,255]))
>     print(traci.poi.getColor("2"))
>     print(traci.poi.setColor("2",[255,0,0,255]))
> 
>     print(traci.vehicle.getIDList())
> 
>     vehicles = traci.simulation.getDepartedIDList()
>     print("ID of vehicles are:")
>     for i in range(len(vehicles)):
>         print(vehicles[i])
>         
> 
>     print(traci.vehicle.getSpeed("left_0")) #error vehicle not known

All the action needs to take place inside of the while loop (because
that is when the simulation is running) not after the while loop has
finished.

Best regards,
Michael


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top