A reset function starts a new reinforcement-learning episode by restoring the environment’s initial state and returning the first state for the agent to observe. section 3.1
For warehouse picking, reset places the robot at the depot, marks every item uncollected, clears the collection phase, and sets the step counter to zero. section 3.2
Listing 3.3 State Representation and Reset Logic
def _get_state(self): #A
return { #A
"robot_pos": tuple(self.robot_pos), #A
"items_picked": tuple(self.items_picked_status), #A
"all_items_collected_phase": self.all_items_collected_phase
} #A
def reset(self): #B
self.robot_pos = np.array(self.depot_pos) #C
self.items_picked_status = [False] * self.num_items #D
self.all_items_collected_phase = False #E
self.current_step = 0 #F
return self._get_state() #G
See the warehouse state representation and reset implementation. section 3.2
