LucasAlegre / sumo-rl

Reinforcement Learning environments for Traffic Signal Control with SUMO. Compatible with Gymnasium, PettingZoo, and popular RL libraries.
https://lucasalegre.github.io/sumo-rl
MIT License
746 stars 201 forks source link

Assignment of action numbers of traffic signals #165

Closed TGW795 closed 1 year ago

TGW795 commented 1 year ago

Hi.

I have a question about traffic signal. When I was trying to train an RL agent in grid4x4 environment, I found that different action numbers were assigned to one signal state. (For example, actions of A0 and A1 are displayed as 2 and 3 on the log despite states of A0 and A1 are same, and vice versa.) I thought that assignment of action numbers of traffic signals are same as each other because this environment is quite symmetrical, is this wrong? If this idea is wrong, how should we understand relations between action numbers and actions?

Thank you.

TGW795 commented 1 year ago

After modifying the code as follows, this problem didn't occur.

actions = {agent: env.action_space(agent).sample() for agent in env.agents}

action_number = 1 """This is an example."""
actions = {agent: action_number for agent in env.agents}

It seems that this issue happens only when actions are determined at random or based on some kind of policy.

TGW795 commented 1 year ago

Sorry, this was also an issue with my experimental setting. I could solve this by decreasing min_green.