RandomNegotiator

class negmas.sao.RandomNegotiator(p_acceptance=0.15, p_rejection=0.75, p_ending=0.1, can_propose=True, **kwargs)[source]

Bases: negmas.sao.RandomResponseMixin, negmas.sao.RandomProposalMixin, negmas.sao.SAONegotiator

A negotiation agent that responds randomly in a single negotiation.

Parameters
  • p_acceptance – Probability of accepting an offer

  • p_rejection – Probability of rejecting an offer

  • p_ending – Probability of ending the negotiation at any round

  • can_propose – Whether the agent can propose or not

  • **kwargs – Passed to the SAONegotiator

Remarks:
  • If p_acceptance + p_rejection + p_ending < 1, the rest is the probability of no-response.

  • This negotiator ignores the rational_proposal parameter.

Methods Summary

join(ami, state, *[, ufun, role])

Will create a random utility function to be used by the negotiator.

propose_(state)

The method directly called by the mechanism (through counter ) to ask for a proposal

respond_(state, offer)

The method to be called directly by the mechanism (through counter ) to respond to an offer.

Methods Documentation

join(ami: negmas.common.AgentMechanismInterface, state: negmas.common.MechanismState, *, ufun: Optional[negmas.utilities.UtilityFunction] = None, role: str = 'agent')bool[source]

Will create a random utility function to be used by the negotiator.

Parameters
  • ami – The AMI

  • state – The current mechanism state

  • ufun – IGNORED.

  • role – IGNORED.

propose_(state: negmas.common.MechanismState)Optional[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]][source]

The method directly called by the mechanism (through counter ) to ask for a proposal

Parameters

state – The mechanism state

Returns

An outcome to offer or None to refuse to offer

Remarks:
  • Depending on the SAOMechanism settings, refusing to offer may be interpreted as ending the negotiation

  • The negotiator will only receive this call if it has the ‘propose’ capability.

  • Rational proposal is implemented in this method.

respond_(state: negmas.common.MechanismState, offer: Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]])negmas.outcomes.ResponseType[source]

The method to be called directly by the mechanism (through counter ) to respond to an offer.

Parameters
  • state – a MechanismState giving current state of the negotiation.

  • offer – the offer being responded to.

Returns

The response to the offer. Possible values are:

  • NO_RESPONSE: refuse to offer. Depending on the mechanism settings this may be interpreted as ending

    the negotiation.

  • ACCEPT_OFFER: Accepting the offer.

  • REJECT_OFFER: Rejecting the offer. The negotiator will be given the chance to counter this

    offer through a call of propose_ later if this was not the last offer to be evaluated by the mechanism.

  • END_NEGOTIATION: End the negotiation

  • WAIT: Instructs the mechanism to wait for this negotiator more. It may lead to cycles so use with care.

Return type

ResponseType

Remarks:
  • The default implementation never ends the negotiation except if an earler end_negotiation notification is sent to the negotiator

  • The default implementation asks the negotiator to propose`() and accepts the `offer if its utility was at least as good as the offer that it would have proposed (and above the reserved value).