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

name 'policy' is not defined #113

Closed kurkurzz closed 2 years ago

kurkurzz commented 2 years ago

Following the code in the documentation for PettingZoo Multi-Agent API

import sumo_rl
env = sumo_rl.env(net_file='sumo_net_file.net.xml',
                  route_file='sumo_route_file.rou.xml',
                  use_gui=True,
                  num_seconds=3600)  
env.reset()
for agent in env.agent_iter():
    observation, reward, done, info = env.last()
    action = policy(observation)
    env.step(action)

Upon running the code, I get an error name 'policy' is not defined. How to solve that?

kurkurzz commented 2 years ago

It is meant to be substituted with ML algorithm.