use
phases.append(traci._trafficlights.Phase(30, 0, 0, "GrGr"))
and
logic = traci._trafficlights.Logic("new-program", 0, 0, 0, phases)
(note the underscore)
regards,
Jakob

2017-05-05 16:56 GMT+02:00 José Roberto Pérez Cruz <[email protected]>:

>
> Hi Friends,
>
> Currently I’m trying to set a new tl-logic via the traci.trafficlights.
> setCompleteRedYellowGreenDefinition method. To do this, I define the
> Logic with the following code:
>
> import traci
> ……...
>
> traci.init(8873)
> ......
>
> phases = []
>
> phases.append(traci.trafficlights.Phase(30, 0, 0, "GrGr"))
> phases.append(traci.trafficlights.Phase(10, 0, 0, "yryr"))
> phases.append(traci.trafficlights.Phase(40, 0, 0, "rGrG"))
> phases.append(traci.trafficlights.Phase(20, 0, 0, "ryry"))
>
> logic = traci.trafficlights.Logic("new-program", 0, 0, 0, phases)
>
> traci.trafficlights.setCompleteRedYellowGreenDefinition("0", logic)
>
>
> However, the simulation crashes, throwing the following error:
>
> …phases.append(traci.trafficlights.Phase(30, 0, 0, "GrGr"))
> AttributeError: TrafficLightsDomain instance has no attribute 'Phase'
>
> I'm doing something wrong?
>
> I'm using SUMO 0.30, and I've ran the simulations in both linux and mac
> osx with the same result.
>
> Thank you if you can give some idea to solve this problem.
>
> Roberto
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> sumo-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sumo-user
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to