gym_warehouse/envs/warehouse_env.py
def _put(self, agent_slot, bin_slot):
        """
        Tries to perform a put action from the agent slot into the bin slot.

        Parameters
        ----------
        agent_slot : int
            The slot of the agent containing the item to put.
        bin_slot : int
            The slot of the bin to put the item into.

        Returns
        -------
        reward : int
            The reward the agent gets for trying to perform this action.
        """
        # Check whether agent is in an access spot
        if self.agent.position not in self.container_map:
            return self.rewards['default']

        # Get container associated with the access spot
        container = self.container_map[self.agent.position]

        # Can't put into staging-in area
        if container is self.staging_in_area:
            return self.rewards['default']

        # Can only put required items into staging-out area
        if container is self.staging_out_area:
            if container.requires(bin_slot, self.agent.status[agent_slot]):
                container.put(bin_slot, self.agent.pick(agent_slot))
                #return self.rewards['success']
                #Check if transaction completed to give reward and generate a new one
                if (np.sum(self.agent.status)==0 and np.sum(self.staging_in_area.status)==0 and
                        np.sum(self.staging_out_area.status)==0):

                    #self._update_transactions()
                    return self.rewards['completion'] #* self.time_left / self.time_limit

            return self.rewards['default']


        # Try to put into regular bin
        if container.free(bin_slot) and not self.agent.free(agent_slot):
            container.put(bin_slot, self.agent.pick(agent_slot))
            #check if staging in, staging out and agent are empty to generate new transaction
            if (np.sum(self.agent.status) == 0 and np.sum(self.staging_in_area.status) == 0 and
                    np.sum(self.staging_out_area.status) == 0):
                #self._update_transactions()
                return self.rewards['completion'] #* self.time_left / self.time_limit

        # Render
        self.action = f'Put {agent_slot} -> {bin_slot}'

        return self.rewards['default']

        Tries to perform a put action from the agent slot into the bin slot.

        Parameters
        ----------
        agent_slot : int
            The slot of the agent containing the item to put.
        bin_slot : int
            The slot of the bin to put the item into.

        Returns
        -------
        reward : int
            The reward the agent gets for trying to perform this action.
        
Tries to perform a put action from the agent slot into the bin slot.
Parameters

agent_slot : int
The slot of the agent containing the item to put.
bin_slot : int
The slot of the bin to put the item into.

Returns

reward : int
The reward the agent gets for trying to perform this action.
Tries to perform a put action from the agent slot into the bin slot . Parameters agent_slot : int The slot of the agent containing the item to put . bin_slot : int The slot of the bin to put the item into . Returns reward : int The reward the agent gets for trying to perform this action .
def _put(self, agent_slot, bin_slot):
        if self.agent.position not in self.container_map:
            return self.rewards['default']
        container = self.container_map[self.agent.position]
        if container is self.staging_in_area:
            return self.rewards['default']
        if container is self.staging_out_area:
            if container.requires(bin_slot, self.agent.status[agent_slot]):
                container.put(bin_slot, self.agent.pick(agent_slot))
                if (np.sum(self.agent.status)==0 and np.sum(self.staging_in_area.status)==0 and
                        np.sum(self.staging_out_area.status)==0):
                    return self.rewards['completion'] 
            return self.rewards['default']
        if container.free(bin_slot) and not self.agent.free(agent_slot):
            container.put(bin_slot, self.agent.pick(agent_slot))
            if (np.sum(self.agent.status) == 0 and np.sum(self.staging_in_area.status) == 0 and
                    np.sum(self.staging_out_area.status) == 0):
                return self.rewards['completion'] 
        self.action = f'Put {agent_slot} -> {bin_slot}'
        return self.rewards['default']
def _put ( self , agent_slot , bin_slot ) : if self . agent . position not in self . container_map : return self . rewards [ 'default' ] container = self . container_map [ self . agent . position ] if container is self . staging_in_area : return self . rewards [ 'default' ] if container is self . staging_out_area : if container . requires ( bin_slot , self . agent . status [ agent_slot ] ) : container . put ( bin_slot , self . agent . pick ( agent_slot ) ) if ( np . sum ( self . agent . status ) == 0 and np . sum ( self . staging_in_area . status ) == 0 and np . sum ( self . staging_out_area . status ) == 0 ) : return self . rewards [ 'completion' ] return self . rewards [ 'default' ] if container . free ( bin_slot ) and not self . agent . free ( agent_slot ) : container . put ( bin_slot , self . agent . pick ( agent_slot ) ) if ( np . sum ( self . agent . status ) == 0 and np . sum ( self . staging_in_area . status ) == 0 and np . sum ( self . staging_out_area . status ) == 0 ) : return self . rewards [ 'completion' ] self . action = f'Put {agent_slot} -> {bin_slot}' return self . rewards [ 'default' ]
Tries to perform a put action from the agent slot into the bin slot.
Tries to perform a put action from the agent slot into the bin slot .
"""
        Tries to perform a put action from the agent slot into the bin slot.

        Parameters
        ----------
        agent_slot : int
            The slot of the agent containing the item to put.
        bin_slot : int
            The slot of the bin to put the item into.

        Returns
        -------
        reward : int
            The reward the agent gets for trying to perform this action.
        """ # Check whether agent is in an access spot # Get container associated with the access spot # Can't put into staging-in area # Can only put required items into staging-out area #return self.rewards['success'] #Check if transaction completed to give reward and generate a new one #self._update_transactions() #* self.time_left / self.time_limit # Try to put into regular bin #check if staging in, staging out and agent are empty to generate new transaction #self._update_transactions() #* self.time_left / self.time_limit # Render
self
agent_slot
bin_slot