Code Monkey home page Code Monkey logo

Comments (4)

zmLucky avatar zmLucky commented on May 30, 2024 2

Two versions of traci api are different.

Modify sumo_rl/environment/traffic_signal.py", line 30, in init
logic = traci.trafficlight.Logic("new-program", 0, 0, 0, phases) to logic = traci.trafficlight.Logic("new-program", 0, 0, phases)

and sumo-rl/experiments/ql_single-intersection.py, line 53

phases=[
                            traci.trafficlight.Phase(ns, ns, ns, "GGrr"),   # north-south
                            traci.trafficlight.Phase(2000, 2000, 2000, "yyrr"),
                            traci.trafficlight.Phase(we, we, we, "rrGG"),   # west-east
                            traci.trafficlight.Phase(2000, 2000, 2000, "rryy")
                            ])

to

phases=[
                            traci.trafficlight.Phase(ns, "GGrr"),   # north-south
                            traci.trafficlight.Phase(2000, "yyrr"),
                            traci.trafficlight.Phase(we, "rrGG"),   # west-east
                            traci.trafficlight.Phase(2000, "rryy")
                            ])

could solve your problem

from sumo-rl.

LucasAlegre avatar LucasAlegre commented on May 30, 2024

Hello,

Thank you for the observation. I'm using SUMO v0.32.
It looks like they changed some Traci methods on v1.10 and both versions are not compatible.
For now I will keep using v0.32, but change it for v1.10 is problably a matter of changing a few lines of code.

Regards,
Lucas

from sumo-rl.

Qian-Eric avatar Qian-Eric commented on May 30, 2024

@ZhongmingGit Thank you!

from sumo-rl.

BridgeQZH avatar BridgeQZH commented on May 30, 2024

Two versions of traci api are different.

Modify sumo_rl/environment/traffic_signal.py", line 30, in init
logic = traci.trafficlight.Logic("new-program", 0, 0, 0, phases) to logic = traci.trafficlight.Logic("new-program", 0, 0, phases)

and sumo-rl/experiments/ql_single-intersection.py, line 53

phases=[
                            traci.trafficlight.Phase(ns, ns, ns, "GGrr"),   # north-south
                            traci.trafficlight.Phase(2000, 2000, 2000, "yyrr"),
                            traci.trafficlight.Phase(we, we, we, "rrGG"),   # west-east
                            traci.trafficlight.Phase(2000, 2000, 2000, "rryy")
                            ])

to

phases=[
                            traci.trafficlight.Phase(ns, "GGrr"),   # north-south
                            traci.trafficlight.Phase(2000, "yyrr"),
                            traci.trafficlight.Phase(we, "rrGG"),   # west-east
                            traci.trafficlight.Phase(2000, "rryy")
                            ])

could solve your problem

The code for now is different. But I also met this error when I tried to use that in colab. Do you know the reason?
In the traffic_signal.py file, the line has changed to logic = traci.trafficlight.Logic("new-program"+self.id, 0, 0, phases=self.phases)
And there is no phases in the ql_single-intersection.py file.

from sumo-rl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.