negmas.gb Package

Implements Generalized Bargaining Protocol (GB) set of mechanisms and basic negotiators.

Functions

all_negotiator_types()

Returns all the negotiator types defined in negmas.gb.negotiators

all_accept(responses)

rtype:

Union[tuple, None, Literal['continue']]

any_accept(responses)

rtype:

Union[tuple, None, Literal['continue']]

Classes

ResponseType(value[, names, module, ...])

Possible responses to offers during negotiation.

GBState([running, waiting, started, step, ...])

GBNMI(id, n_outcomes, outcome_space, ...[, ...])

ThreadState([new_offer, new_responses, ...])

NegotiatorMechanismInterface(id, n_outcomes, ...)

All information of a negotiation visible to negotiators.

GBComponent(*[, negotiator])

AcceptancePolicy(*[, negotiator])

OfferingPolicy(*[, negotiator])

ProposalPolicy

alias of OfferingPolicy

Model

alias of GBComponent

LimitedOutcomesAcceptancePolicy(prob[, ...])

Accepts from a list of predefined outcomes

NegotiatorAcceptancePolicy(acceptor, *[, ...])

Uses a negotiator as an offering strategy

ConcensusAcceptancePolicy(strategies, *[, ...])

Accepts based on concensus of multiple strategies

AllAcceptanceStrategies(strategies, *[, ...])

Accept only if all children accept, end only if all of them end, otherwise reject

AnyAcceptancePolicy(strategies, *[, negotiator])

Accept any children accept, end or reject only if all of them end or reject

AcceptImmediately(*[, negotiator])

Accepts immediately anything

RejectAlways(*[, negotiator])

Rejects everything

EndImmediately(*[, negotiator])

Rejects immediately anything

AcceptAbove(limit[, above_reserve, negotiator])

Accepts outcomes with utilities in the given top limit fraction above reserve/minimum (based on above_resrve ).

RandomAcceptancePolicy([p_acceptance, ...])

AcceptTop([fraction, k, negotiator])

Accepts outcomes that are in the given top fraction or top k.

AcceptBest([best_util, negotiator])

Accepts Only the best outcome.

TFTAcceptancePolicy(partner_ufun, recommender, *)

An acceptance strategy that concedes as much as the partner (or more)

ACNext(offering_strategy[, alpha, beta, ...])

Implements the ACnext acceptance strategy based on our next offer.

ACLast([alpha, beta, negotiator])

Implements the AClast acceptance strategy based on our last offer.

ACLastKReceived([k, alpha, beta, op, negotiator])

Accepts $omega$ if $lpha u(my-next-offer) + eta > f(u( ext{utils of offers received in the last k steps))$

ACLastFractionReceived([fraction, alpha, ...])

Accepts $omega$ if $lpha u(my-next-offer) + eta > f(u( ext{utils of offers received in the given fraction of time}))$

ACTime(tau, *[, negotiator])

Implements the ACtime acceptance strategy based on our next offer.

AcceptAfter

alias of ACTime

AcceptAround([relative_time, eps, negotiator])

Accepts around the given relative time (i.e. eps from it).

AcceptBetween(min[, max, negotiator])

Accepts in the given range of relative times.

ACConst([th, negotiator])

Accepts outcomes with utilities above the given threshold

AcceptAnyRational(*[, negotiator])

Accepts any rational outcome.

AcceptBetterRational([accepted, negotiator])

Accept first rational outcomes and then accept only outcomes better than the all accepted so far.

AcceptNotWorseRational([accepted, negotiator])

Accept any outcome not worse than the best so far.

CABOfferingPolicy([next_indx, sorter, ...])

WAROfferingPolicy([next_indx, sorter, ...])

LimitedOutcomesOfferingPolicy(outcomes[, ...])

Offers from a given list of outcomes

NegotiatorOfferingPolicy(*[, negotiator])

Uses a negotiator as an offering strategy

ConcensusOfferingPolicy(strategies, *[, ...])

Offers based on concensus of multiple strategies

RandomConcensusOfferingPolicy(strategies[, ...])

Offers a random response from the list of strategies (different strategy every time).

UnanimousConcensusOfferingPolicy(strategies, *)

Offers only if all offering strategies gave exactly the same outcome

UtilBasedConcensusOfferingPolicy(strategies, *)

Offers from the list of stratgies (different strategy every time) based on outcome utilities

MyBestConcensusOfferingPolicy(strategies, *)

Offers my best outcome from the list of stratgies (different strategy every time).

MyWorstConcensusOfferingPolicy(strategies, *)

Offers my worst outcome from the list of stratgies (different strategy every time) based on outcome utilities

NoneOfferingPolicy(*[, negotiator])

Always offers None which means it never gets an agreement.

RandomOfferingPolicy(*[, negotiator])

Always offers None which means it never gets an agreement.

OfferTop([fraction, k, negotiator])

Offers outcomes that are in the given top fraction or top k.

OfferBest([best, negotiator])

Offers Only the best outcome.

TFTOfferingPolicy(partner_ufun, recommender)

An acceptance strategy that concedes as much as the partner (or more)

MiCROOfferingPolicy([next_indx, sorter, ...])

TimeBasedOfferingStrategy([curve, ...])

ConcessionRecommender(*[, negotiator])

Decides the level of concession to use

KindConcessionRecommender([kindness, ...])

A simple recommender that does one small concession first then a tit-for-tat response

OfferSelectorProtocol(*args, **kwargs)

Can select the best offer in some sense from a list of offers based on an inverter

OfferSelector(*args, **kwargs)

Can select the best offer in some sense from a list of offers based on an inverter

RandomOfferSelector(*args, **kwargs)

BestOfferSelector(*args, **kwargs)

MedianOfferSelector(*args, **kwargs)

WorstOfferSelector(*args, **kwargs)

OfferOrientedSelector([distance_fun])

Selects the nearest outcome to the pivot outcome which is updated before responding

FirstOfferOrientedSelector([distance_fun])

Selects the offer nearest the partner's first offer

LastOfferOrientedSelector([distance_fun])

Selects the offer nearest the partner's last offer

BestOfferOrientedSelector([distance_fun])

Selects the offer nearest the partner's best offer for me so far

OutcomeSetOrientedSelector([distance_fun, ...])

Selects the nearest outcome to a set of pivot outcomes which is updated before responding

PartnerOffersOrientedSelector([...])

Orients offes toward the set of past opponent offers

MultiplicativePartnerOffersOrientedSelector([...])

Orients offes toward the set of past opponent offers.

AdditivePartnerOffersOrientedSelector(*args)

Orients offes toward the set of past opponent offers.

UtilityInverter(*args[, offer_selector])

A component that can recommend an outcome based on utility

UtilityBasedOutcomeSetRecommender([...])

Recommends a set of outcome appropriate for proposal

UFunModel(*[, negotiator])

A SAOComponent that can model the opponent's utility function.

FrequencyUFunModel(*[, negotiator])

A PartnerUfunModel that uses a simple frequency-based model of the opponent offers.

FrequencyLinearUFunModel(*[, negotiator])

A PartnerUfunModel that uses a simple frequency-based model of the opponent offers assuming the ufun is LinearAdditiveUtilityFunction .

ZeroSumModel([above_reserve, rank_only, ...])

Assumes a zero-sum negotiation (i.e. $u_o$ = $-u_s$ ).

GBMechanism(*args[, evaluator_type, ...])

ParallelGBMechanism(*args, **kwargs)

SerialGBMechanism(*args, **kwargs)

GBNegotiator([preferences, ufun, name, ...])

Base class for all GB negotiators.

LimitedOutcomesNegotiator([...])

A negotiation agent that uses a fixed set of outcomes in a single negotiation.

LimitedOutcomesAcceptor([...])

A negotiation agent that uses a fixed set of outcomes in a single negotiation.

ToughNegotiator([can_propose])

Accepts and proposes only the top offer (i.e. the one with highest utility).

TopFractionNegotiator([min_utility, ...])

Offers and accepts only one of the top outcomes for the negotiator.

UtilBasedNegotiator(*args[, stochastic, ...])

A negotiator that bases its decisions on the utility value of outcomes only.

TimeBasedNegotiator(*args[, offering_curve, ...])

Represents a time-based negotiation strategy that is independent of the offers received during the negotiation.

TimeBasedConcedingNegotiator(*args[, ...])

Represents a time-based negotiation strategy that is independent of the offers received during the negotiation.

BoulwareTBNegotiator(*args, **kwargs)

A Boulware time-based negotiator that conceeds sub-linearly

LinearTBNegotiator(*args, **kwargs)

A Boulware time-based negotiator that conceeds linearly

ConcederTBNegotiator(*args, **kwargs)

A Boulware time-based negotiator that conceeds super-linearly

AspirationNegotiator(*args[, ...])

Represents a time-based negotiation strategy that is independent of the offers received during the negotiation.

FirstOfferOrientedTBNegotiator(*args[, ...])

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on their utility value and how near they are to the partner's first offer

LastOfferOrientedTBNegotiator(*args[, ...])

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on their utility value and how near they are to the partner's last offer

BestOfferOrientedTBNegotiator(*args[, ...])

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on their utility value and how near they are to the partner's past offer with the highest utility for me

AdditiveParetoFollowingTBNegotiator(*args[, ...])

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on a weighted sum of their normalized utilities and distances to previous offers

MultiplicativeParetoFollowingTBNegotiator(*args)

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on a weighted sum of their normalized utilities and distances to previous offers

MultiplicativeLastOfferFollowingTBNegotiator(*args)

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on a weighted sum of their normalized utilities and distances to previous offers

AdditiveLastOfferFollowingTBNegotiator(*args)

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on a weighted sum of their normalized utilities and distances to previous offers

MultiplicativeFirstFollowingTBNegotiator(*args)

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on a weighted sum of their normalized utilities and distances to previous offers

AdditiveFirstFollowingTBNegotiator(*args[, ...])

A time-based negotiator that selectes outcomes from the list allowed by the current utility level based on a weighted sum of their normalized utilities and distances to previous offers

NaiveTitForTatNegotiator(*args[, kindness, ...])

Implements a naive tit-for-tat strategy that does not depend on the availability of an opponent model.

SimpleTitForTatNegotiator

alias of NaiveTitForTatNegotiator

RandomNegotiator([p_acceptance, ...])

A negotiation agent that responds randomly in a single negotiation.

RandomAlwaysAcceptingNegotiator([...])

NiceNegotiator(*args, **kwargs)

Offers and accepts anything.

CABNegotiator(*args, **kwargs)

Conceding Accepting Better Strategy (optimal, complete, but not an equilibirum)

CARNegotiator(*args, **kwargs)

Conceding Accepting Rational Strategy (neither complete nor an equilibrium)

CANNegotiator(*args, **kwargs)

Conceding Accepting Not Worse Strategy (optimal, complete, but not an equilibirum)

WABNegotiator(*args, **kwargs)

Wasting Accepting Better (neither complete nor an equilibrium)

WARNegotiator(*args, **kwargs)

Wasting Accepting Any (an equilibrium but not complete)

WANNegotiator(*args, **kwargs)

Wasting Accepting Any (an equilibrium but not complete)

MiCRONegotiator(*args[, accept_same])

Rational Concession Negotiator

EvaluationStrategy()

LocalEvaluationStrategy()

AnyAcceptEvaluationStrategy(strategies)

AllAcceptEvaluationStrategy(strategies)

GAOEvaluationStrategy()

TAUEvaluationStrategy([n_outcomes, ...])

Implements the Tentative-Accept Unique-Offers Generalized Bargaining Protocol.

OfferingConstraint()

LocalOfferingConstraint()

AnyOfferingConstraint(constraints)

AllOfferingConstraints(constaints)

RepeatFinalOfferOnly([n])

RepeatLastOfferOnly([n])

UniqueOffers()

Class Inheritance Diagram

Inheritance diagram of negmas.gb.common.ResponseType, negmas.gb.common.GBState, negmas.gb.common.GBNMI, negmas.gb.common.ThreadState, negmas.gb.components.base.GBComponent, negmas.gb.components.base.AcceptancePolicy, negmas.gb.components.base.OfferingPolicy, negmas.gb.components.base.OfferingPolicy, negmas.gb.components.base.GBComponent, negmas.gb.components.acceptance.LimitedOutcomesAcceptancePolicy, negmas.gb.components.acceptance.NegotiatorAcceptancePolicy, negmas.gb.components.acceptance.ConcensusAcceptancePolicy, negmas.gb.components.acceptance.AllAcceptanceStrategies, negmas.gb.components.acceptance.AnyAcceptancePolicy, negmas.gb.components.acceptance.AcceptImmediately, negmas.gb.components.acceptance.RejectAlways, negmas.gb.components.acceptance.EndImmediately, negmas.gb.components.acceptance.AcceptAbove, negmas.gb.components.acceptance.RandomAcceptancePolicy, negmas.gb.components.acceptance.AcceptTop, negmas.gb.components.acceptance.AcceptBest, negmas.gb.components.acceptance.TFTAcceptancePolicy, negmas.gb.components.acceptance.ACNext, negmas.gb.components.acceptance.ACLast, negmas.gb.components.acceptance.ACLastKReceived, negmas.gb.components.acceptance.ACLastFractionReceived, negmas.gb.components.acceptance.ACTime, negmas.gb.components.acceptance.ACTime, negmas.gb.components.acceptance.AcceptAround, negmas.gb.components.acceptance.AcceptBetween, negmas.gb.components.acceptance.ACConst, negmas.gb.components.acceptance.AcceptAnyRational, negmas.gb.components.acceptance.AcceptBetterRational, negmas.gb.components.acceptance.AcceptNotWorseRational, negmas.gb.components.offering.CABOfferingPolicy, negmas.gb.components.offering.WAROfferingPolicy, negmas.gb.components.offering.LimitedOutcomesOfferingPolicy, negmas.gb.components.offering.NegotiatorOfferingPolicy, negmas.gb.components.offering.ConcensusOfferingPolicy, negmas.gb.components.offering.RandomConcensusOfferingPolicy, negmas.gb.components.offering.UnanimousConcensusOfferingPolicy, negmas.gb.components.offering.UtilBasedConcensusOfferingPolicy, negmas.gb.components.offering.MyBestConcensusOfferingPolicy, negmas.gb.components.offering.MyWorstConcensusOfferingPolicy, negmas.gb.components.offering.NoneOfferingPolicy, negmas.gb.components.offering.RandomOfferingPolicy, negmas.gb.components.offering.OfferTop, negmas.gb.components.offering.OfferBest, negmas.gb.components.offering.TFTOfferingPolicy, negmas.gb.components.offering.MiCROOfferingPolicy, negmas.gb.components.offering.TimeBasedOfferingStrategy, negmas.gb.components.concession.ConcessionRecommender, negmas.gb.components.concession.KindConcessionRecommender, negmas.gb.components.selectors.OfferSelectorProtocol, negmas.gb.components.selectors.OfferSelector, negmas.gb.components.selectors.RandomOfferSelector, negmas.gb.components.selectors.BestOfferSelector, negmas.gb.components.selectors.MedianOfferSelector, negmas.gb.components.selectors.WorstOfferSelector, negmas.gb.components.selectors.OfferOrientedSelector, negmas.gb.components.selectors.FirstOfferOrientedSelector, negmas.gb.components.selectors.LastOfferOrientedSelector, negmas.gb.components.selectors.BestOfferOrientedSelector, negmas.gb.components.selectors.OutcomeSetOrientedSelector, negmas.gb.components.selectors.PartnerOffersOrientedSelector, negmas.gb.components.selectors.MultiplicativePartnerOffersOrientedSelector, negmas.gb.components.selectors.AdditivePartnerOffersOrientedSelector, negmas.gb.components.inverter.UtilityInverter, negmas.gb.components.inverter.UtilityBasedOutcomeSetRecommender, negmas.gb.components.models.ufun.UFunModel, negmas.gb.components.models.ufun.FrequencyUFunModel, negmas.gb.components.models.ufun.FrequencyLinearUFunModel, negmas.gb.components.models.ufun.ZeroSumModel, negmas.gb.mechanisms.base.GBMechanism, negmas.gb.mechanisms.base.ParallelGBMechanism, negmas.gb.mechanisms.base.SerialGBMechanism, negmas.gb.negotiators.base.GBNegotiator, negmas.gb.negotiators.limited.LimitedOutcomesNegotiator, negmas.gb.negotiators.limited.LimitedOutcomesAcceptor, negmas.gb.negotiators.tough.ToughNegotiator, negmas.gb.negotiators.tough.TopFractionNegotiator, negmas.gb.negotiators.utilbased.UtilBasedNegotiator, negmas.gb.negotiators.timebased.TimeBasedNegotiator, negmas.gb.negotiators.timebased.TimeBasedConcedingNegotiator, negmas.gb.negotiators.timebased.BoulwareTBNegotiator, negmas.gb.negotiators.timebased.LinearTBNegotiator, negmas.gb.negotiators.timebased.ConcederTBNegotiator, negmas.gb.negotiators.timebased.AspirationNegotiator, negmas.gb.negotiators.timebased.FirstOfferOrientedTBNegotiator, negmas.gb.negotiators.timebased.LastOfferOrientedTBNegotiator, negmas.gb.negotiators.timebased.BestOfferOrientedTBNegotiator, negmas.gb.negotiators.timebased.AdditiveParetoFollowingTBNegotiator, negmas.gb.negotiators.timebased.MultiplicativeParetoFollowingTBNegotiator, negmas.gb.negotiators.timebased.MultiplicativeLastOfferFollowingTBNegotiator, negmas.gb.negotiators.timebased.AdditiveLastOfferFollowingTBNegotiator, negmas.gb.negotiators.timebased.MultiplicativeFirstFollowingTBNegotiator, negmas.gb.negotiators.timebased.AdditiveFirstFollowingTBNegotiator, negmas.gb.negotiators.titfortat.NaiveTitForTatNegotiator, negmas.gb.negotiators.titfortat.NaiveTitForTatNegotiator, negmas.gb.negotiators.randneg.RandomNegotiator, negmas.gb.negotiators.randneg.RandomAlwaysAcceptingNegotiator, negmas.gb.negotiators.nice.NiceNegotiator, negmas.gb.negotiators.cab.CABNegotiator, negmas.gb.negotiators.cab.CARNegotiator, negmas.gb.negotiators.cab.CANNegotiator, negmas.gb.negotiators.war.WABNegotiator, negmas.gb.negotiators.war.WARNegotiator, negmas.gb.negotiators.war.WANNegotiator, negmas.gb.negotiators.micro.MiCRONegotiator, negmas.gb.evaluators.base.EvaluationStrategy, negmas.gb.evaluators.base.LocalEvaluationStrategy, negmas.gb.evaluators.base.AnyAcceptEvaluationStrategy, negmas.gb.evaluators.base.AllAcceptEvaluationStrategy, negmas.gb.evaluators.gao.GAOEvaluationStrategy, negmas.gb.evaluators.tau.TAUEvaluationStrategy, negmas.gb.constraints.base.OfferingConstraint, negmas.gb.constraints.base.LocalOfferingConstraint, negmas.gb.constraints.base.AnyOfferingConstraint, negmas.gb.constraints.base.AllOfferingConstraints, negmas.gb.constraints.rfo.RepeatFinalOfferOnly, negmas.gb.constraints.rlo.RepeatLastOfferOnly, negmas.gb.constraints.unique.UniqueOffers