Closed gioannides closed 1 year ago
Hi,
It requires that the traffic signal definitions in the network file are of the form: [green, yellow, red, ..., green, yellow, red]. Can you how the traffic signal is defined in your .net.xml file?
i generated it from openmapdata
Is there a way to enforce your constraints on it?
Could you share your .net file so I can try to understand why it is not working?
The problem was not that, the q-learning code you re-used was assuming all agents had the same action space, which is not the case for your network. You only need to pass the correct observation and action space for your agents:
ql_agents = {ts: QLAgent(starting_state=env.encode(initial_states[ts], ts),
state_space=env.traffic_signals[ts].observation_space,
action_space=env.traffic_signals[ts].action_space,
alpha=alpha,
gamma=gamma,
exploration_strategy=EpsilonGreedy(initial_epsilon=0.05, min_epsilon=0.005, decay=decay)) for ts in env.ts_ids}
However, notice that this probably will not work well with tabular q-learning, as you have a big state and action spaces. I suggest you changing the observation space to be smaller, or using deep RL.
Great, thanks, can you also tell me how I can pass an "additional.xml" that defines vehicles differently to your framework? It seems it always generates the default passenger type car
The vehicles are defined in your .rou.xml file. See https://sumo.dlr.de/docs/Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.html
Custom networks spit out this error, how can it be solved?
Code: