negmas.models.acceptance¶
Acceptance modeling.
- class negmas.models.acceptance.AcceptanceModelType(*values)[source]¶
Bases:
EnumRepresents types of acceptance models.
- 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:
DiscreteAcceptanceModelAn acceptance model that adapts its probability estimates based on observed rejections and offers.
The model starts with initial probabilities and updates them when outcomes are rejected (decreasing probability) or offered by opponents (increasing probability).
- 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]¶
Creates an acceptance model from a negotiation mechanism interface.
- Parameters:
nmi – The negotiator-mechanism interface providing negotiation context.
prob – Initial acceptance probability, either a single value or list per outcome.
end_prob – Probability used at negotiation end.
p_accept_after_reject – Minimum probability after a rejection is observed.
p_reject_after_accept – Probability of rejection after an acceptance.
- Returns:
A new model initialized from the negotiation.
- Return type:
- probability_of_acceptance_indx(outcome_index: int) float[source]¶
Returns the estimated acceptance probability for the outcome at the given index.
- Parameters:
outcome_index – Index into the outcomes list.
- Returns:
The current acceptance probability estimate.
- Return type:
- class negmas.models.acceptance.AggregatingDiscreteAcceptanceModel(outcomes: Collection[tuple], models: list[DiscreteAcceptanceModel], weights: list[float] | None = None)[source]¶
Bases:
DiscreteAcceptanceModelAn acceptance model that combines multiple models using weighted averaging.
The final acceptance probability is computed as a weighted sum of the probabilities from each constituent model.
- class negmas.models.acceptance.DiscreteAcceptanceModel(outcomes: Iterable[tuple])[source]¶
Bases:
ABCAbstract base class for modeling opponent acceptance behavior over discrete outcomes.
This model estimates the probability that opponents will accept each possible outcome in a negotiation, and updates these estimates based on observed behavior.
- acceptance_probabilities() ndarray[source]¶
Returns the acceptance probabilities for all outcomes as an array.
- Returns:
Array of acceptance probabilities, one per outcome.
- Return type:
np.ndarray
- probability_of_acceptance(outcome: tuple)[source]¶
Returns the estimated probability that opponents will accept the given outcome.
- Parameters:
outcome – The outcome to evaluate.
- abstractmethod probability_of_acceptance_indx(outcome_index: int) float[source]¶
Returns the estimated probability that opponents will accept the outcome at the given index.
- Parameters:
outcome_index – Index into the outcomes list.
- Returns:
Probability in [0, 1] that the outcome will be accepted.
- Return type:
- update_accepted(outcome)[source]¶
Updates the model after observing acceptance of the given outcome.
- Parameters:
outcome – The outcome that was accepted.
- update_offered(outcome)[source]¶
Updates the model after observing an offer of the given outcome.
- Parameters:
outcome – The outcome that was offered.
- abstractmethod update_offered_indx(outcome_index: int)[source]¶
Updates the model after observing an offer of the outcome at the given index.
- Parameters:
outcome_index – Index into the outcomes list for the offered outcome.
- class negmas.models.acceptance.PeekingDiscreteAcceptanceModel(outcomes: Collection[Outcome], opponents: SAONegotiator | Collection[SAONegotiator])[source]¶
Bases:
DiscreteAcceptanceModelAn acceptance model that queries opponents directly to determine acceptance.
This model “peeks” at opponent negotiators by calling their respond_ method to get their actual response to each outcome. Returns 1.0 if all opponents accept, 0.0 otherwise.
- class negmas.models.acceptance.PeekingProbabilisticDiscreteAcceptanceModel(outcomes: Collection[Outcome], opponents: SAONegotiator | Collection[SAONegotiator])[source]¶
Bases:
DiscreteAcceptanceModelAn acceptance model that estimates probability using opponents’ utility functions.
This model “peeks” at opponent utility functions and returns the product of their utilities for each outcome as the acceptance probability.
- probability_of_acceptance_indx(outcome_index: int) float[source]¶
Returns the product of opponent utilities as the acceptance probability.
- Parameters:
outcome_index – Index into the outcomes list.
- Returns:
Product of all opponent utilities for this outcome.
- Return type:
- class negmas.models.acceptance.RandomDiscreteAcceptanceModel(outcomes: Collection[tuple], **kwargs)[source]¶
Bases:
DiscreteAcceptanceModelAn acceptance model that returns random probabilities, ignoring observed behavior.
Useful as a baseline or for experimentation with uncertainty effects.
- 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:
AggregatingDiscreteAcceptanceModelA 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
AdaptiveDiscreteAcceptanceModelrejection_delta – Only effective if adaptive is True. See
AdaptiveDiscreteAcceptanceModel