File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1818import traci
1919from gymnasium .utils import EzPickle , seeding
2020from pettingzoo import AECEnv
21- from pettingzoo .utils import agent_selector , wrappers
21+ from pettingzoo .utils import wrappers
22+
23+
24+ try :
25+ # pettingzoo 1.25+
26+ from pettingzoo .utils import AgentSelector
27+ except ImportError :
28+ # pettingzoo 1.24 or earlier
29+ from pettingzoo .utils import agent_selector as AgentSelector
30+
2231from pettingzoo .utils .conversions import parallel_wrapper_fn
2332
2433from .observations import DefaultObservationFunction , ObservationFunction
@@ -521,7 +530,7 @@ def __init__(self, **kwargs):
521530
522531 self .agents = self .env .ts_ids
523532 self .possible_agents = self .env .ts_ids
524- self ._agent_selector = agent_selector (self .agents )
533+ self ._agent_selector = AgentSelector (self .agents )
525534 self .agent_selection = self ._agent_selector .reset ()
526535 # spaces
527536 self .action_spaces = {a : self .env .action_spaces (a ) for a in self .agents }
You can’t perform that action at this time.
0 commit comments