def queue_action(self, queue, *args, **kwargs):
if isinstance(queue, ResourceQueue):<EOL><INDENT>if self._has_resource:<EOL><INDENT>self._has_resource = False<EOL>self._had_resource = True<EOL><DEDENT>else:<EOL><INDENT>if queue.num_servers > <NUM_LIT:0>:<EOL><INDENT>queue.set_num_servers(queue.num_servers - <NUM_LIT:1>)<EOL>self._has_resource = True<EOL>self._had_resource = False<EOL><DEDENT><DEDENT><DEDENT>
Function that specifies the interaction with a
        :class:`.ResourceQueue` upon departure.

        When departuring from a :class:`.ResourceQueue` (or a
        :class:`.QueueServer`), this method is called. If the agent
        does not already have a resource then it decrements the number
        of servers at :class:`.ResourceQueue` by one. Note that this
        only applies to :class:`ResourceQueue's<.ResourceQueue>`.

        Parameters
        ----------
        queue : :class:`.QueueServer`
            The instance of the queue that the ``ResourceAgent`` will
            interact with.