@@ -168,7 +168,7 @@ def __init__(self, team_move: typing.Callable[[typing.Any, typing.Any], typing.T
168168 self ._bot_track = [[], []]
169169
170170
171- def set_initial (self , team_id , game_state ):
171+ def set_initial (self , team_id , initial_state ):
172172 """ Sets the bot indices for the team and returns the team name.
173173 Currently, we do not call _set_initial on the user side.
174174
@@ -182,24 +182,26 @@ def set_initial(self, team_id, game_state):
182182 # Reset the team state
183183 self ._state .clear ()
184184
185- self ._game_state = {}
186- self ._game_state .update (game_state )
185+ self ._team_id = team_id
186+
187+ self ._initial_state = {}
188+ self ._initial_state .update (initial_state )
187189
188190 # Initialize the random number generator
189191 # with the seed that we received from game
190- self ._rng = Random (game_state ['seed' ])
192+ self ._rng = Random (initial_state ['seed' ])
191193
192194 # Reset the bot tracks
193195 self ._bot_track = [[], []]
194196
195197 # Store the walls, which are only transmitted once
196- self ._walls = _ensure_tuple_tuples (game_state ['walls' ])
198+ self ._walls = _ensure_tuple_tuples (initial_state ['walls' ])
197199
198200 # Store the shape, which is only transmitted once
199- self ._shape = tuple (game_state ['shape' ])
201+ self ._shape = tuple (initial_state ['shape' ])
200202
201- self ._team_names = tuple (game_state ['team_names' ])
202- self ._max_rounds = game_state ['max_rounds' ]
203+ self ._team_names = tuple (initial_state ['team_names' ])
204+ self ._max_rounds = initial_state ['max_rounds' ]
203205
204206 # Cache the initial positions so that we don’t have to calculate them at each step
205207 self ._initial_positions = layout .initial_positions (self ._walls , self ._shape )
@@ -253,8 +255,8 @@ def get_move(self, game_state):
253255 rng = self ._rng ,
254256 graph = self ._graph )
255257
256- self ._game_state . update (game_state )
257- me ._game_state = self ._game_state
258+ me ._game_state = dict (game_state )
259+ me ._game_state . update ( self ._initial_state )
258260 team = me ._team
259261
260262 for idx , mybot in enumerate (team ):
@@ -396,7 +398,7 @@ def set_initial(self, team_id, game_state):
396398 self .request_timeout = timeout_length
397399
398400 msg_id = self .conn .send_req ("set_initial" , {"team_id" : team_id ,
399- "game_state " : game_state })
401+ "initial_state " : game_state })
400402 reply = self .conn .recv_reply (msg_id , timeout_length )
401403 # reply should be None
402404
0 commit comments