negmas.models.acceptance

Acceptance modeling.

class negmas.models.acceptance.AcceptanceModelType(*values)[source]

Bases: Enum

Represents types of acceptance models.

ACCEPTANCE_MODEL_AUTO = -1[source]
ACCEPTANCE_MODEL_BINARY = 11[source]
ACCEPTANCE_MODEL_BINARY_HOMOGENEOUS = 9[source]
ACCEPTANCE_MODEL_BINARY_HOMOGENEOUS_CONST = 8[source]
ACCEPTANCE_MODEL_BINARY_MONOTONIC = 10[source]
ACCEPTANCE_MODEL_BINARY_STATIC = 7[source]
ACCEPTANCE_MODEL_GENERAL = 4[source]
ACCEPTANCE_MODEL_HOMOGENEOUS = 2[source]
ACCEPTANCE_MODEL_HOMOGENEOUS_CONST = 1[source]
ACCEPTANCE_MODEL_MONOTONIC = 3[source]
ACCEPTANCE_MODEL_RANDOM = -100[source]
ACCEPTANCE_MODEL_STATIC = 0[source]
class negmas.models.acceptance.AdaptiveDiscreteAcceptanceModel(outcomes: Iterable[tuple], n_negotiators: int = 2, prob: float | list[float] = 0.5, end_prob=0.0, p_accept_after_reject=0.0, p_reject_after_accept=0.0, rejection_discount=0.98, rejection_delta=0.0, not_offering_rejection_ratio=0.75)[source]

Bases: DiscreteAcceptanceModel

AdaptiveDiscreteAcceptanceModel implementation.

acceptance_probabilities()[source]

Probability of acceptance for all outcomes

classmethod from_negotiation(nmi: NegotiatorMechanismInterface, prob: float | list = 0.5, end_prob=0.0, p_accept_after_reject=0.0, p_reject_after_accept=0.0) AdaptiveDiscreteAcceptanceModel[source]

From negotiation.

Parameters:
  • nmi – Nmi.

  • prob – Prob.

  • end_prob – End prob.

  • p_accept_after_reject – P accept after reject.

  • p_reject_after_accept – P reject after accept.

Returns:

The result.

Return type:

AdaptiveDiscreteAcceptanceModel

probability_of_acceptance_indx(outcome_index: int) float[source]

Probability of acceptance indx.

Parameters:

outcome_index – Outcome index.

Returns:

The result.

Return type:

float

update_offered_indx(outcome_index: int)[source]

Update offered indx.

Parameters:

outcome_index – Outcome index.

update_rejected_indx(outcome_index: int)[source]

Update rejected indx.

Parameters:

outcome_index – Outcome index.

class negmas.models.acceptance.AggregatingDiscreteAcceptanceModel(outcomes: Collection[tuple], models: list[DiscreteAcceptanceModel], weights: list[float] | None = None)[source]

Bases: DiscreteAcceptanceModel

AggregatingDiscreteAcceptanceModel implementation.

probability_of_acceptance_indx(outcome_index: int) float[source]

Probability of acceptance indx.

Parameters:

outcome_index – Outcome index.

Returns:

The result.

Return type:

float

update_offered_indx(outcome_index: int)[source]

Update offered indx.

Parameters:

outcome_index – Outcome index.

update_rejected_indx(outcome_index: int)[source]

Update rejected indx.

Parameters:

outcome_index – Outcome index.

class negmas.models.acceptance.DiscreteAcceptanceModel(outcomes: Iterable[tuple])[source]

Bases: ABC

DiscreteAcceptanceModel implementation.

acceptance_probabilities() ndarray[source]

Acceptance probabilities.

Returns:

The result.

Return type:

np.ndarray

probability_of_acceptance(outcome: tuple)[source]

Probability of acceptance.

Parameters:

outcome – Outcome to evaluate.

abstractmethod probability_of_acceptance_indx(outcome_index: int) float[source]

Probability of acceptance indx.

Parameters:

outcome_index – Outcome index.

Returns:

The result.

Return type:

float

update_accepted(outcome)[source]

Update accepted.

Parameters:

outcome – Outcome to evaluate.

update_offered(outcome)[source]

Update offered.

Parameters:

outcome – Outcome to evaluate.

abstractmethod update_offered_indx(outcome_index: int)[source]

Update offered indx.

Parameters:

outcome_index – Outcome index.

update_rejected(outcome: tuple)[source]

Update rejected.

Parameters:

outcome – Outcome to evaluate.

abstractmethod update_rejected_indx(outcome_index: int)[source]

Update rejected indx.

Parameters:

outcome_index – Outcome index.

class negmas.models.acceptance.PeekingDiscreteAcceptanceModel(outcomes: Collection[Outcome], opponents: SAONegotiator | Collection[SAONegotiator])[source]

Bases: DiscreteAcceptanceModel

PeekingDiscreteAcceptanceModel implementation.

probability_of_acceptance_indx(outcome_index: int) float[source]

Probability of acceptance indx.

Parameters:

outcome_index – Outcome index.

Returns:

The result.

Return type:

float

update_offered_indx(outcome_index: int)[source]

Update offered indx.

Parameters:

outcome_index – Outcome index.

update_rejected_indx(outcome_index: int)[source]

Update rejected indx.

Parameters:

outcome_index – Outcome index.

class negmas.models.acceptance.PeekingProbabilisticDiscreteAcceptanceModel(outcomes: Collection[Outcome], opponents: SAONegotiator | Collection[SAONegotiator])[source]

Bases: DiscreteAcceptanceModel

PeekingProbabilisticDiscreteAcceptanceModel implementation.

probability_of_acceptance_indx(outcome_index: int) float[source]

Probability of acceptance indx.

Parameters:

outcome_index – Outcome index.

Returns:

The result.

Return type:

float

update_offered_indx(outcome_index: int)[source]

Update offered indx.

Parameters:

outcome_index – Outcome index.

update_rejected_indx(outcome_index: int)[source]

Update rejected indx.

Parameters:

outcome_index – Outcome index.

class negmas.models.acceptance.RandomDiscreteAcceptanceModel(outcomes: Collection[tuple], **kwargs)[source]

Bases: DiscreteAcceptanceModel

RandomDiscreteAcceptanceModel implementation.

probability_of_acceptance_indx(outcome_index: int) float[source]

Probability of acceptance indx.

Parameters:

outcome_index – Outcome index.

Returns:

The result.

Return type:

float

update_offered_indx(outcome_index: int)[source]

Update offered indx.

Parameters:

outcome_index – Outcome index.

update_rejected_indx(outcome_index: int)[source]

Update rejected indx.

Parameters:

outcome_index – Outcome index.

class negmas.models.acceptance.UncertainOpponentModel(outcomes: Collection[Outcome], opponents: SAONegotiator | Collection[SAONegotiator], uncertainty: float = 0.5, adaptive: bool = False, rejection_discount: float = 0.95, rejection_delta: float = 0.0, constant_base=True, accesses_real_acceptance=False)[source]

Bases: AggregatingDiscreteAcceptanceModel

A model for which the uncertainty about the acceptance probability of different negotiators is controllable.

This is not a realistic model but it can be used to experiment with effects of this uncertainty on different negotiation related algorithms (e.g. elicitation algorithms)

Parameters:
  • outcomes – The list of possible outcomes

  • uncertainty (float) – The uncertainty level. Zero means no uncertainty and 1.0 means maximum uncertainty

  • adaptive (bool) – If true then the random part will learn from experience with the opponents otherwise it will not.

  • rejection_discount – Only effective if adaptive is True. See AdaptiveDiscreteAcceptanceModel

  • rejection_delta – Only effective if adaptive is True. See AdaptiveDiscreteAcceptanceModel