def _send_get_depth(self, prefix):
        """
        Sends a Get_Depth service call to the given agent

        :param prefix: prefix for this call
        :type prefix: str
        :return: service-response
        :rtype: Get_DepthResponse
        :raises DelegationServiceError: if call unsuccessful
        """

        self._loginfo("Sending a Get_Depth request to " + str(prefix))

        service_name = prefix + self.get_depth_suffix
        try:
            rospy.wait_for_service(service=service_name,
                                   timeout=self.SERVICE_TIMEOUT)
        except rospy.ROSException:
            self._logwarn("Waiting to long for service: " + str(service_name))
            raise DelegationServiceError("Waiting to long: " +
                                         str(service_name))

        try:
            send_get_depth = rospy.ServiceProxy(service_name, Get_Depth)
            depth = send_get_depth()
            return depth
        except rospy.ServiceException:
            self._logwarn("Get_Depth call failed")
            raise DelegationServiceError("Call failed: " + str(service_name))
    def _send_failure(self, auctioneer_name, auction_id):
        """
        Sends a Failure service-call for the specified name, id

        :param auctioneer_name: name of the auctioneer of the failed task
        :type auctioneer_name: str
        :param auction_id: ID of the failed task
        :type auction_id: int
        :raises DelegationServiceError: if call failed
        """

        self._loginfo("Sending a Failure message to " + str(auctioneer_name) +
                      " for his auction " + str(auction_id))

        service_name = auctioneer_name + self.failure_suffix
        try:
            rospy.wait_for_service(service=service_name,
                                   timeout=self.SERVICE_TIMEOUT)
        except rospy.ROSException:
            self._logwarn("Waiting to long for service: " + str(service_name))
            raise DelegationServiceError("Waiting to long: " +
                                         str(service_name))

        try:
            send_failure = rospy.ServiceProxy(service_name, Failure)
            send_failure(self._name, auction_id)
        except rospy.ServiceException:
            self._logwarn("Failure call failed")
            raise DelegationServiceError("Call failed: " + str(service_name))
    def _send_propose(self, value, target_name, auction_id):
        """
        Sends a Propose service_name call

        :param value: proposed cost
        :type value: float
        :param target_name: name of the auctioneer
        :type target_name: str
        :param auction_id: ID of the auction
        :type auction_id: int
        :raises DelegationServiceError: if call failed
        """

        self._loginfo("Sending a proposal to " + str(target_name) +
                      " for his auction " + str(auction_id))

        service_name = target_name + self.propose_suffix
        try:
            rospy.wait_for_service(service=service_name,
                                   timeout=self.SERVICE_TIMEOUT)
        except rospy.ROSException:
            self._logwarn("Waiting to long for service: " + str(service_name))
            raise DelegationServiceError("Waiting to long: " +
                                         str(service_name))

        try:
            send_proposal = rospy.ServiceProxy(service_name, Propose)
            send_proposal(self._name, auction_id, value)
        except rospy.ServiceException:
            self._logwarn("Propose call failed")
            raise DelegationServiceError("Call failed: " + str(service_name))
    def _send_precom(self, target_name, auction_id, proposal_value,
                     goal_representation, goal_name, depth,
                     delegation_members):
        """
        Calls the Precommit service of the winning bidder of this delegation

        :param target_name: name of the bidder who gets the precom
        :type target_name: str
        :param auction_id: ID of the corresponding auction
        :type auction_id: int
        :param proposal_value: proposed value
        :type proposal_value: float
        :param goal_representation: representation of the goal for this auction
        :type goal_representation: str
        :param goal_name: name of the goal
        :type goal_name: str
        :param depth: current depth of this delegation
        :type depth: int
        :param delegation_members: list of current members of the delegation
        :type delegation_members: list(str)
        :return: response of the service call,
                includes the acceptance of the bidder or possibly a new proposal
        :rtype: PrecommitResponse
        :raises DelegationServiceError: if call failed
        """

        self._loginfo("Sending a precommit to " + str(target_name) +
                      " for my auction " + str(auction_id))

        service_name = target_name + self.precom_suffix
        try:
            rospy.wait_for_service(service=service_name,
                                   timeout=self.SERVICE_TIMEOUT)
        except rospy.ROSException:
            self._logwarn("Waiting to long for service: " + str(service_name))
            raise DelegationServiceError("Waiting to long: " +
                                         str(service_name))

        try:
            send_precom = rospy.ServiceProxy(service_name, Precommit)
            response = send_precom(goal_representation, self._name, goal_name,
                                   auction_id, proposal_value, depth,
                                   delegation_members)
        except rospy.ServiceException:
            self._logwarn("Precommit call failed")
            raise DelegationServiceError("Call failed: " + str(service_name))

        return response
    def _send_cfp(self, goal_representation, auction_id, depth,
                  delegation_members):
        """
        Sends a CFP-broadcast over the CFP-topic

        :param goal_representation: goal_information
        :type goal_representation: str
        :param auction_id: ID of the corresponding auction
        :type auction_id: int
        :param depth: depth of this delegation
        :type depth: int
        :param delegation_members: List of current Members of the Delegation
        :type delegation_members: list(str)
        :raises ServiceException: if call failed
        """

        self._loginfo("Sending a CFP for my auction " + str(auction_id))

        msg = CFP()
        msg.goal_representation = goal_representation
        msg.name = self._name
        msg.auction_id = auction_id
        msg.depth = depth
        msg.current_members = delegation_members

        try:
            self._cfp_publisher.publish(msg)
        except rospy.ROSException:
            self._logwarn("CFP publish failed")
            raise DelegationServiceError("Call failed: CFP")