Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.phases is empty when len(phases) is 1 #17

Open
BackMountainDevil opened this issue Dec 12, 2023 · 0 comments
Open

self.phases is empty when len(phases) is 1 #17

BackMountainDevil opened this issue Dec 12, 2023 · 0 comments

Comments

@BackMountainDevil
Copy link

https://github.com/zhc134/tlc-baselines/blob/master/world.py

L118~L121

    def reset(self):
        # record phase info
        self.current_phase = 0  # phase id in self.phases (excluding yellow)
        self._current_phase = self.phases[0]  # true phase id (including yellow)

what if len(self.phases)==0, it will got IndexError: list index out of range. manhattan data in https://github.com/Chacha-Chen/MPLight. In that case, len(phases) is 1, but after L61(self.phases = [i for i in range(len(phases)) if not i in self.yellow_phase_id]), len(self.phases) is 0.

config.json: "roadnetFile": "manhattan.json", "flowFile": "manhattan_7846.json",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant