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

        Parameters
        ----------
        agent_slot : int
            The slot of the agent to pick into.
        bin_slot : int
            The slot of the bin to pick from.

        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 pick from staging-out area
        if container is self.staging_out_area:
            return self.rewards['default']

        # Try pick from container
        if not container.free(bin_slot) and self.agent.free(agent_slot):
            self.agent.put(agent_slot, container.pick(bin_slot))
            # Check we made progress on inbound transaction
            if container is self.staging_in_area:
                return self.rewards['success']

        # Render
        self.action = f'Pick {agent_slot} <- {bin_slot}'

        return self.rewards['default']

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

        Parameters
        ----------
        agent_slot : int
            The slot of the agent to pick into.
        bin_slot : int
            The slot of the bin to pick from.

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

agent_slot : int
The slot of the agent to pick into.
bin_slot : int
The slot of the bin to pick from.

Returns

reward : int
The reward the agent gets for trying to perform this action.
Tries to perform a pick action from the bin slot into the agent slot . Parameters agent_slot : int The slot of the agent to pick into . bin_slot : int The slot of the bin to pick from . Returns reward : int The reward the agent gets for trying to perform this action .
def _pick(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_out_area:
            return self.rewards['default']
        if not container.free(bin_slot) and self.agent.free(agent_slot):
            self.agent.put(agent_slot, container.pick(bin_slot))
            if container is self.staging_in_area:
                return self.rewards['success']
        self.action = f'Pick {agent_slot} <- {bin_slot}'
        return self.rewards['default']
def _pick ( 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_out_area : return self . rewards [ 'default' ] if not container . free ( bin_slot ) and self . agent . free ( agent_slot ) : self . agent . put ( agent_slot , container . pick ( bin_slot ) ) if container is self . staging_in_area : return self . rewards [ 'success' ] self . action = f'Pick {agent_slot} <- {bin_slot}' return self . rewards [ 'default' ]
Tries to perform a pick action from the bin slot into the agent slot.
Tries to perform a pick action from the bin slot into the agent slot .
"""
        Tries to perform a pick action from the bin slot into the agent slot.

        Parameters
        ----------
        agent_slot : int
            The slot of the agent to pick into.
        bin_slot : int
            The slot of the bin to pick from.

        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 pick from staging-out area # Try pick from container # Check we made progress on inbound transaction # Render
self
agent_slot
bin_slot