negmas.gb¶
Implements Generalized Bargaining Protocol (GB) set of mechanisms and basic negotiators.
- class negmas.gb.ACConst(th: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts outcomes with utilities above the given threshold
- class negmas.gb.ACLast(alpha: float = 1.0, beta: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyImplements the AClast acceptance strategy based on our last offer.
Accepts $omega$ if $lpha u(my-next-offer) + eta > u(omega)$
- class negmas.gb.ACLastFractionReceived(fraction: float = 1.0, alpha: float = 1.0, beta: float = 0.0, op: Callable[[list[float]], float] = <built-in function max>, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts $omega$ if $lpha u(my-next-offer) + eta > f(u( ext{utils of offers received in the given fraction of time}))$
- class negmas.gb.ACLastKReceived(k: int = 0, alpha: float = 1.0, beta: float = 0.0, op: Callable[[list[float]], float] = <built-in function max>, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts $omega$ if $lpha u(my-next-offer) + eta > f(u( ext{utils of offers received in the last k steps))$
- class negmas.gb.ACNext(offering_strategy: OfferingPolicy, alpha: float = 1.0, beta: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyImplements the ACnext acceptance strategy based on our next offer.
Accepts $omega$ if $lpha u(my-next-offer) + eta > u(omega)$
- offering_strategy: OfferingPolicy[source]¶
- class negmas.gb.ACTime(tau: float, rational: bool = True, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyImplements the ACtime acceptance strategy based on our next offer.
Accepts if the relative time is greater than or equal to tau
- class negmas.gb.AcceptAbove(limit: float, above_reserve: bool = True, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts outcomes with utilities in the given top
limitfraction above reserve/minimum (based onabove_resrve).- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.AcceptAnyRational(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts any rational outcome.
- class negmas.gb.AcceptAround(relative_time: float = 1.0, eps: float = 0.001, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts around the given relative time (i.e. eps from it)
- class negmas.gb.AcceptBest(best_util: float = inf, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts Only the best outcome.
- Remarks:
If the best possible utility cannot be found, nothing will be accepted
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.AcceptBetterRational(accepted: dict[str, Outcome] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccept first rational outcomes and then accept only outcomes better than the all accepted so far.
- class negmas.gb.AcceptBetween(min: float, max: float = 1.0, rational: bool = True, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts in the given range of relative times.
- class negmas.gb.AcceptImmediately(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts immediately anything
- class negmas.gb.AcceptNotWorseRational(accepted: dict[str, Outcome] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccept any outcome not worse than the best so far.
- class negmas.gb.AcceptTop(fraction: float = 0.0, k: int = 1, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts outcomes that are in the given top fraction or top
k. If neither is given it reverts to accepting the best outcome only.- Remarks:
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.AcceptancePolicy(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GBComponentAcceptance policy implementation.
- respond(state: GBState, offer: Outcome | None, source: str | None) ResponseType | ExtendedResponseType[source]¶
Called to respond to an offer. This is the method that should be overriden to provide an acceptance strategy.
- Parameters:
state – a
GBStategiving current state of the negotiation.offer – offer being tested
- Returns:
The response to the offer
- Return type:
- Remarks:
The default implementation never ends the negotiation
The default implementation asks the negotiator to
propose`() and accepts the `offerif its utility was at least as good as the offer that it would have proposed (and above the reserved value).
- class negmas.gb.AdditiveFirstFollowingTBNegotiator(*args, dist_power: float = 2, issue_weights: list[float] | None = None, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorA 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
- class negmas.gb.AdditiveLastOfferFollowingTBNegotiator(*args, dist_power: float = 2, issue_weights: list[float] | None = None, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorA 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
- class negmas.gb.AdditiveParetoFollowingTBNegotiator(*args, dist_power: float = 2, issue_weights: list[float] | None = None, offer_filter: OfferFilterProtocol = <function NoFiltering>, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorA 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
- class negmas.gb.AdditivePartnerOffersOrientedSelector(*args, u_weight: float = 0.6, **kwargs)[source]¶
Bases:
PartnerOffersOrientedSelectorOrients offes toward the set of past opponent offers.
The score of an offer is the product of its utility to self and its distance to opponent’s past offers after normalization
- class negmas.gb.AllAcceptEvaluationStrategy(strategies: list[EvaluationStrategy])[source]¶
Bases:
EvaluationStrategyAllAcceptEvaluation strategy.
- class negmas.gb.AllAcceptanceStrategies(strategies: list[AcceptancePolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ConcensusAcceptancePolicyAccept only if all children accept, end only if all of them end, otherwise reject
- decide(indices: list[int], responses: list[ResponseType]) ResponseType | ExtendedResponseType[source]¶
Decide.
- Parameters:
indices – Indices.
responses – Responses.
- Returns:
The result.
- Return type:
- filter(indx: int, response: ResponseType) FilterResult[source]¶
Filter.
- Parameters:
indx – Indx.
response – Response.
- Returns:
The result.
- Return type:
FilterResult
- class negmas.gb.AllOfferingConstraints(constaints: list[OfferingConstraint])[source]¶
Bases:
OfferingConstraintAllOfferingConstraints implementation.
- constaints: list[OfferingConstraint][source]¶
- class negmas.gb.AnyAcceptEvaluationStrategy(strategies: list[EvaluationStrategy])[source]¶
Bases:
EvaluationStrategyAnyAcceptEvaluation strategy.
- class negmas.gb.AnyAcceptancePolicy(strategies: list[AcceptancePolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ConcensusAcceptancePolicyAccept any children accept, end or reject only if all of them end or reject
- decide(indices: list[int], responses: list[ResponseType]) ResponseType | ExtendedResponseType[source]¶
Decide.
- Parameters:
indices – Indices.
responses – Responses.
- Returns:
The result.
- Return type:
- filter(indx: int, response: ResponseType) FilterResult[source]¶
Filter.
- Parameters:
indx – Indx.
response – Response.
- Returns:
The result.
- Return type:
FilterResult
- class negmas.gb.AnyOfferingConstraint(constraints: list[OfferingConstraint])[source]¶
Bases:
OfferingConstraintAnyOfferingConstraint implementation.
- constraints: list[OfferingConstraint][source]¶
- class negmas.gb.AspirationNegotiator(*args, max_aspiration=1.0, aspiration_type: Literal['boulware'] | Literal['conceder'] | Literal['linear'] | float = 'boulware', stochastic=False, presort: bool = True, tolerance: float = 0.001, **kwargs)[source]¶
Bases:
TimeBasedConcedingNegotiatorRepresents a time-based negotiation strategy that is independent of the offers received during the negotiation.
- Parameters:
name – The agent name
preferences – The utility function to attache with the agent
max_aspiration – The aspiration level to use for the first offer (or first acceptance decision).
aspiration_type – The polynomial aspiration curve type. Here you can pass the exponent as a real value or pass a string giving one of the predefined types: linear, conceder, boulware.
stochastic – If True, the agent will propose outcomes with utility >= the current aspiration level not outcomes just above it.
can_propose – If True, the agent is allowed to propose
ranking – If True, the aspiration level will not be based on the utility value but the ranking of the outcome within the presorted list. It is only effective when presort is set to True
presort – If True, the negotiator will catch a list of outcomes, presort them and only use them for offers and responses. This is much faster then other option for general continuous utility functions but with the obvious problem of only exploring a discrete subset of the issue space (Decided by the
discrete_outcomesproperty of theNegotiatorMechanismInterface. If the number of outcomes is very large (i.e. > 10000) and discrete, presort will be forced to be True. You can check if presorting is active in realtime by checking the “presorted” attribute.tolerance – A tolerance used for sampling of outcomes when
presortis set to Falseowner – The
Agentthat owns the negotiator.parent – The parent which should be an
GBController
Remarks:
This class provides a different interface to the
TimeBasedConcedingNegotiatorwith less control. It is recommonded to useTimeBasedConcedingNegotiatoror otherTimeBasedNegotiatornegotiators isntead
- class negmas.gb.BestOfferOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
OfferOrientedSelectorSelects the offer nearest the partner’s best offer for me so far
- class negmas.gb.BestOfferOrientedTBNegotiator(*args, distance_fun: ~typing.Callable[[tuple, tuple, ~negmas.outcomes.protocols.OutcomeSpace | None], float] = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
FirstOfferOrientedTBNegotiatorA 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
- class negmas.gb.BestOfferSelector(*args, **kwargs)[source]¶
Bases:
OfferSelectorBestOfferSelector implementation.
- class negmas.gb.BoulwareTBNegotiator(*args, **kwargs)[source]¶
Bases:
TimeBasedConcedingNegotiatorA Boulware time-based negotiator that conceeds sub-linearly
- class negmas.gb.CABNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorConceding Accepting Better Strategy (optimal, complete, but not an equilibirum)
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.CABOfferingPolicy(next_indx: int = 0, sorter: PresortingInverseUtilityFunction | None = None, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyCABOffering policy implementation.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.CANNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorConceding Accepting Not Worse Strategy (optimal, complete, but not an equilibirum)
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.CARNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorConceding Accepting Rational Strategy (neither complete nor an equilibrium)
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.ConcederTBNegotiator(*args, **kwargs)[source]¶
Bases:
TimeBasedConcedingNegotiatorA Boulware time-based negotiator that conceeds super-linearly
- class negmas.gb.ConcensusAcceptancePolicy(strategies: list[AcceptancePolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicy,ABCAccepts based on concensus of multiple strategies
- abstractmethod decide(indices: list[int], responses: list[ResponseType | ExtendedResponseType]) ResponseType | ExtendedResponseType[source]¶
Called to make a final decision given the decisions of the strategies with indices
indices(seefilterfor filtering rules)
- filter(indx: int, response: ResponseType | ExtendedResponseType) FilterResult[source]¶
Called with the decision of each strategy in order.
- Remarks:
Two decisions need to be made:
Should we continue trying other strategies
Should we save this result.
- strategies: list[AcceptancePolicy][source]¶
- class negmas.gb.ConcensusOfferingPolicy(strategies: list[OfferingPolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicy,ABCOffers based on concensus of multiple strategies
- abstractmethod decide(indices: list[int], responses: list[Outcome | ExtendedOutcome | None]) Outcome | ExtendedOutcome | None[source]¶
Called to make a final decsision given the decisions of the stratgeis with indices
indices(seefilterfor filtering rules)
- filter(indx: int, offer: Outcome | ExtendedOutcome | None) FilterResult[source]¶
Called with the decision of each strategy in order.
- Remarks:
Two decisions need to be made:
Should we continue trying other strategies
Should we save this result.
- strategies: list[OfferingPolicy][source]¶
- class negmas.gb.ConcessionRecommender(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GBComponentDecides the level of concession to use
- class negmas.gb.EndImmediately(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyRejects immediately anything
- class negmas.gb.ExtendedResponseType(response: ResponseType, data: dict[str, Any] | None = None)[source]¶
Bases:
objectA response with optional data fields.
This class allows acceptance policies to return additional data alongside the response decision, such as text explanations, reasoning, or metadata.
- data[source]¶
Optional dictionary of additional data. Can contain: - “text”: A text message explaining the response or providing context. - Any other key-value pairs for custom metadata.
Example
>>> from negmas.gb.common import ResponseType, ExtendedResponseType >>> extended = ExtendedResponseType( ... response=ResponseType.REJECT_OFFER, ... data={"text": "This price is too high", "counter_suggestion": 5}, ... ) >>> extended.response <ResponseType.REJECT_OFFER: 1> >>> extended.data["text"] 'This price is too high'
See also
negmas.outcomes.common.ExtendedOutcome: For extending offer outcomes.negmas.sao.common.SAOResponse.from_extended(): For creating SAOResponse from extended types.
- response: ResponseType[source]¶
- class negmas.gb.FastMiCRONegotiator(*args, accept_same: bool = True, **kwargs)[source]¶
Bases:
MAPNegotiatorRational Concession Negotiator
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.FirstOfferOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
OfferOrientedSelectorSelects the offer nearest the partner’s first offer
- class negmas.gb.FirstOfferOrientedTBNegotiator(*args, distance_fun: ~typing.Callable[[tuple, tuple, ~negmas.outcomes.protocols.OutcomeSpace | None], float] = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
OfferOrientedNegotiatorA 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
- class negmas.gb.FrequencyLinearUFunModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
UFunModelA
PartnerUfunModelthat uses a simple frequency-based model of the opponent offers assuming the ufun isLinearAdditiveUtilityFunction.
- class negmas.gb.FrequencyUFunModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
UFunModelA
PartnerUfunModelthat uses a simple frequency-based model of the opponent offers.
- class negmas.gb.GACABMP(utility_gap: float = 0.05, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_ABMP acceptance strategy from Genius.
Accepts an offer if the opponent’s utility is within a gap of our last offer. Based on the ABMP (Adaptive Bargaining with Multiple Proposals) agent.
- Parameters:
utility_gap – The maximum gap between opponent’s offer and our last offer (default 0.05).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_ABMP
- class negmas.gb.GACAgentFSEGA(offering_policy: OfferingPolicy, multiplier: float = 1.03, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_AgentFSEGA acceptance strategy from Genius (ANAC2010).
Accepts if: - opponent_util * multiplier >= my_last_util, OR - opponent_util > my_next_util, OR - opponent_util == max_utility_in_domain
- Parameters:
offering_policy – The offering strategy to determine next bid.
multiplier – Multiplier for opponent’s offer comparison (default 1.03).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_AgentFSEGA
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACAgentK(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_AgentK acceptance strategy from Genius (ANAC2010).
Probabilistic acceptance based on time and utility. Calculates an acceptance probability and accepts if a random value is below this probability.
The acceptance probability increases as time progresses and as the opponent’s offers improve relative to expectations.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_AgentK
- class negmas.gb.GACAgentK2(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_AgentK2 acceptance strategy from Genius (ANAC2011).
Enhanced probabilistic acceptance with statistics tracking. Similar to AgentK but with improved probability calculations.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_AgentK2
- class negmas.gb.GACAgentLG(accept_ratio: float = 0.99, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_AgentLG acceptance strategy from Genius (ANAC2012).
Frequency-based acceptance that tracks opponent bids and accepts based on relative utility and time pressure.
- Parameters:
accept_ratio – Ratio for acceptance comparison (default 0.99).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_AgentLG
- class negmas.gb.GACAgentMR(minimum_accept_p: float = 0.965, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_AgentMR acceptance strategy from Genius (ANAC2012).
Time-based concession with sigmoid acceptance probability. Tracks opponent offers and adjusts acceptance based on forecasting.
- Parameters:
minimum_accept_p – Minimum acceptance probability threshold (default 0.965).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_AgentMR
- class negmas.gb.GACAgentSmith(accept_margin: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_AgentSmith acceptance strategy from Genius (ANAC2010).
Probabilistic acceptance with a minimum utility threshold. Accepts if opponent’s offer is above the accept margin or if it’s better than or equal to our last offer.
- Parameters:
accept_margin – Minimum utility to accept unconditionally (default 0.9).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_AgentSmith
- class negmas.gb.GACBRAMAgent(offering_policy: OfferingPolicy, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_BRAMAgent acceptance strategy from Genius (ANAC2011).
Best Response Adaptive Model - accepts based on a dynamically calculated threshold that accounts for discounting.
- Parameters:
offering_policy – The offering strategy to determine next bid.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_BRAMAgent
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACBRAMAgent2(offering_policy: OfferingPolicy, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_BRAMAgent2 acceptance strategy from Genius (ANAC2012).
Enhanced BRAM with better threshold adaptation. Similar to BRAMAgent but with improved handling of edge cases.
- Parameters:
offering_policy – The offering strategy to determine next bid.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_BRAMAgent2
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCUHKAgent(offering_policy: OfferingPolicy, min_threshold: float = 0.65, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CUHKAgent acceptance strategy from Genius (ANAC2012).
Complex acceptance with concede degree calculation. Accepts based on threshold that adapts to discounting and opponent behavior.
- Parameters:
offering_policy – The offering strategy to determine next bid.
min_threshold – Minimum utility threshold (default 0.65).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_CUHKAgent
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombi(offering_policy: OfferingPolicy, a: float = 1.0, b: float = 0.0, t: float = 0.99, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Combi acceptance strategy from Genius.
Combines AC_Next and AC_Time: accepts if either condition is met.
- Accepts if:
(a * u(opponent_offer) + b >= u(my_next_offer)) OR (time >= t)
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
a – Scaling factor for opponent’s offer utility (default 1.0).
b – Offset added to scaled opponent utility (default 0.0).
t – Time threshold for acceptance (default 0.99).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Combi
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiAvg(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiAvg acceptance strategy from Genius.
Combines AC_Next with average-based acceptance in the end game.
Before time t: acts like AC_Next. After time t: accepts if opponent’s offer >= average of opponent’s offers in window.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which average-based acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiAvg
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiBestAvg(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiBestAvg acceptance strategy from Genius.
Combines AC_Next with best-average-based acceptance.
Before time t: acts like AC_Next. After time t: accepts if opponent’s offer >= average of offers better than current offer.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which best-average acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiBestAvg
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiBestAvgDiscounted(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiBestAvgDiscounted acceptance strategy from Genius.
Like AC_CombiBestAvg but applies time discount to utilities.
Before time t: acts like AC_Next. After time t: accepts if discounted opponent offer >= discounted avg of better offers.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which best-average acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiBestAvgDiscounted
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiMax(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiMax acceptance strategy from Genius.
Combines AC_Next with maximum-based acceptance.
Before time t: acts like AC_Next. After time t: accepts if opponent’s offer >= max of all previous opponent offers.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which max-based acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiMax
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiMaxInWindow(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiMaxInWindow acceptance strategy from Genius.
Combines AC_Next with a time-window-based acceptance criterion.
Before time t: acts like AC_Next only. After time t: accepts if opponent’s offer is >= best offer seen in remaining time window.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which window-based acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiMaxInWindow
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiMaxInWindowDiscounted(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiMaxInWindowDiscounted acceptance strategy from Genius.
Like AC_CombiMaxInWindow but applies time discount to utilities.
Before time t: acts like AC_Next. After time t: accepts if discounted offer >= discounted best in window.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which window-based acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiMaxInWindowDiscounted
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiProb(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiProb acceptance strategy from Genius.
Probability-based acceptance that combines AC_Next with probabilistic acceptance based on the expected utility of waiting.
Before time t: acts like AC_Next. After time t: accepts with probability based on how good the offer is relative to expected future offers.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which probabilistic acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiProb
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiProbDiscounted(offering_policy: OfferingPolicy, t: float = 0.98, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiProbDiscounted acceptance strategy from Genius.
Like AC_CombiProb but applies time discount to utilities.
Before time t: acts like AC_Next. After time t: probabilistic acceptance with discounted utilities.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which probabilistic acceptance kicks in (default 0.98).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiProbDiscounted
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiV2(offering_policy: OfferingPolicy, a: float = 1.0, b: float = 0.0, t: float = 0.99, decay: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiV2 acceptance strategy from Genius.
A variant of AC_Combi that uses a different combination logic. Accepts if the opponent’s offer utility exceeds a time-dependent threshold based on both the next offer utility and a decay factor.
Before time t: acts like AC_Next. After time t: accepts if opponent’s offer >= next offer utility * decay.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
a – Scaling factor for opponent’s offer utility (default 1.0).
b – Offset added to scaled opponent utility (default 0.0).
t – Time threshold (default 0.99).
decay – Decay factor applied after time threshold (default 0.9).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiV2
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiV3(offering_policy: OfferingPolicy, a: float = 1.0, b: float = 0.0, t: float = 0.95, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiV3 acceptance strategy from Genius.
A variant of AC_Combi that uses linear interpolation between AC_Next threshold and reserved value based on time.
The acceptance threshold decreases linearly from next offer utility to reserved value as time progresses past threshold t.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
a – Scaling factor for opponent’s offer utility (default 1.0).
b – Offset added to scaled opponent utility (default 0.0).
t – Time threshold when interpolation begins (default 0.95).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiV3
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACCombiV4(offering_policy: OfferingPolicy, t: float = 0.98, w: float = 0.5, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_CombiV4 acceptance strategy from Genius.
A variant of AC_Combi that combines AC_Next with a weighted combination of max and average opponent offers in the end game.
Before time t: acts like AC_Next. After time t: accepts if opponent’s offer >= weighted combo of max and avg.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
t – Time threshold after which combined strategy kicks in (default 0.98).
w – Weight for max utility (1-w used for avg utility) (default 0.5).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_CombiV4
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACConst(c: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Const acceptance strategy from Genius.
Accepts an offer if its utility exceeds a constant threshold.
- Parameters:
c – Constant threshold. Accept if utility > c (default 0.9).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Const
- class negmas.gb.GACConstDiscounted(c: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_ConstDiscounted acceptance strategy from Genius.
Accepts an offer if its discounted utility exceeds a constant threshold. Takes time discount into account.
- Parameters:
c – Constant threshold. Accept if discounted utility > c (default 0.9).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_ConstDiscounted
- class negmas.gb.GACFalse(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_False acceptance strategy from Genius.
Never accepts any offer. Useful for debugging and testing.
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_False
- class negmas.gb.GACGahboninho(high_threshold: float = 0.95, min_acceptable: float = 0.7, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Gahboninho acceptance strategy from Genius (ANAC2011).
High threshold strategy that accepts offers above 0.95 utility early, or above a minimum acceptable threshold that adapts over time.
- Parameters:
high_threshold – Utility threshold for early acceptance (default 0.95).
min_acceptable – Minimum acceptable utility (default 0.7).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_Gahboninho
- class negmas.gb.GACGap(c: float = 0.01, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Gap acceptance strategy from Genius.
- Accepts an offer if:
u(opponent_offer) + c >= u(my_previous_offer)
A restricted version of AC_Previous with a=1 and configurable gap.
- Parameters:
c – Gap constant added to opponent utility (default 0.01).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Gap
- class negmas.gb.GACHardHeaded(offering_policy: OfferingPolicy, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_HardHeaded acceptance strategy from Genius (ANAC2011).
Accepts if the opponent’s offer utility is greater than our lowest offered utility so far, or if it’s at least as good as our next bid.
- Parameters:
offering_policy – The offering strategy to determine next bid.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_HardHeaded
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACIAMCrazyHaggler(offering_policy: OfferingPolicy, maximum_aspiration: float = 0.85, accept_multiplier: float = 1.02, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_IAMcrazyHaggler acceptance strategy from Genius (ANAC2010).
A high-aspiration strategy that accepts only when the opponent’s offer is close to our maximum aspiration or our own offers.
- Parameters:
offering_policy – The offering strategy to determine next bid.
maximum_aspiration – Target utility threshold (default 0.85).
accept_multiplier – Multiplier for acceptance comparison (default 1.02).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_IAMcrazyHaggler
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACIAMHaggler2010(offering_policy: OfferingPolicy, maximum_aspiration: float = 0.9, accept_multiplier: float = 1.02, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_IAMHaggler2010 acceptance strategy from Genius (ANAC2010).
Similar to IAMCrazyHaggler but with slightly different thresholds. Uses concession rate estimation for acceptance.
- Parameters:
offering_policy – The offering strategy to determine next bid.
maximum_aspiration – Target utility threshold (default 0.9).
accept_multiplier – Multiplier for acceptance comparison (default 1.02).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_IAMHaggler2010
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACIAMHaggler2011(offering_policy: OfferingPolicy, maximum_aspiration: float = 0.9, accept_multiplier: float = 1.02, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_IAMHaggler2011 acceptance strategy from Genius (ANAC2011).
GP-smoothed estimate based acceptance. Similar to IAMHaggler2010 with improved estimation.
- Parameters:
offering_policy – The offering strategy to determine next bid.
maximum_aspiration – Target utility threshold (default 0.9).
accept_multiplier – Multiplier for acceptance comparison (default 1.02).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_IAMHaggler2011
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACIAMHaggler2012(offering_policy: OfferingPolicy, accept_multiplier: float = 1.02, maximum_aspiration: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_IAMHaggler2012 acceptance strategy from Genius (ANAC2012).
Adaptive threshold acceptance with multiplier-based comparison.
- Parameters:
offering_policy – The offering strategy to determine next bid.
accept_multiplier – Multiplier for acceptance (default 1.02).
maximum_aspiration – Maximum target utility (default 0.9).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_IAMHaggler2012
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACInoxAgent(reservation_value: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_InoxAgent acceptance strategy from Genius (ANAC2013).
Scaling threshold acceptance. Breaks when reservation value is better, accepts when opponent’s offer exceeds a time-dependent threshold.
- Parameters:
reservation_value – Minimum acceptable utility (default 0.0).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2013.AC_InoxAgent
- class negmas.gb.GACInoxAgentOneIssue(reservation_value: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_InoxAgent_OneIssue acceptance strategy from Genius (ANAC2013).
Simplified InoxAgent for single-issue domains. Accepts when opponent’s offer exceeds median utility.
- Parameters:
reservation_value – Minimum acceptable utility (default 0.0).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2013.AC_InoxAgent_OneIssue
- class negmas.gb.GACMAC(offering_policy: OfferingPolicy, constant: float = 0.95, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_MAC acceptance strategy from Genius.
Multi-acceptance condition testing. Combines multiple AC strategies and accepts if any of them would accept.
This is a simplified version that combines AC_CombiV4 and AC_CombiMaxInWindow with default parameters.
- Parameters:
offering_policy – The offering strategy to determine next bid.
constant – Utility threshold (default 0.95).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_MAC
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACNext(offering_policy: OfferingPolicy, a: float = 1.0, b: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Next acceptance strategy from Genius.
- Accepts an offer if:
a * u(opponent_offer) + b >= u(my_next_offer)
- where:
u(opponent_offer): Utility of the opponent’s current offer
u(my_next_offer): Utility of the offer we would make next
a: Scaling factor (default 1.0)
b: Offset factor (default 0.0)
With default parameters (a=1, b=0), this accepts if the opponent’s offer is at least as good as what we would offer next.
- Parameters:
offering_policy – The offering strategy used to determine my next offer.
a – Scaling factor for opponent’s offer utility (default 1.0).
b – Offset added to scaled opponent utility (default 0.0).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Next
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACNiceTitForTat(offering_policy: OfferingPolicy, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_NiceTitForTat acceptance strategy from Genius (ANAC2011).
Cooperative strategy based on opponent behavior. Uses AC_Next logic combined with probabilistic acceptance near the deadline.
- Parameters:
offering_policy – The offering strategy to determine next bid.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_NiceTitForTat
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACNozomi(max_util_threshold: float = 0.95, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Nozomi acceptance strategy from Genius (ANAC2010).
A sophisticated strategy that considers opponent modeling, time pressure, and evaluation gap between bids. Accepts based on multiple conditions that change with time phases.
- Parameters:
max_util_threshold – Threshold relative to max utility (default 0.95).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_Nozomi
- class negmas.gb.GACOMACagent(offering_policy: OfferingPolicy, discount_threshold: float = 0.845, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_OMACagent acceptance strategy from Genius (ANAC2012).
Accepts if we’ve made this bid before or if opponent’s utility is at least as good as our planned bid.
- Parameters:
offering_policy – The offering strategy to determine next bid.
discount_threshold – Discount threshold for special behavior (default 0.845).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_OMACagent
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACPrevious(a: float = 1.0, b: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Previous acceptance strategy from Genius.
- Accepts an offer if:
a * u(opponent_offer) + b >= u(my_previous_offer)
Similar to AC_Next but compares against our previous offer instead of next.
- Parameters:
a – Scaling factor for opponent’s offer utility (default 1.0).
b – Offset added to scaled opponent utility (default 0.0).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Previous
- class negmas.gb.GACTheFawkes(offering_policy: OfferingPolicy, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_TheFawkes acceptance strategy from Genius (ANAC2013).
ACcombi = ACnext || (ACtime(T) & ACconst(MAXw)). Accepts when our bid is worse than opponent’s, or near deadline when opponent’s bid has maximum value in a window.
- Parameters:
offering_policy – The offering strategy to determine next bid.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2013.AC_TheFawkes
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACTheNegotiator(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_TheNegotiator acceptance strategy from Genius (ANAC2011).
State machine with phases: hardball, conceding, and desperate. Acceptance threshold varies based on the current phase.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_TheNegotiator
- class negmas.gb.GACTheNegotiatorReloaded(offering_policy: OfferingPolicy, a_next: float = 1.0, b_next: float = 0.0, constant: float = 0.98, panic_time: float = 0.99, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_TheNegotiatorReloaded acceptance strategy from Genius (ANAC2012).
Phase-based acceptance with domain analysis. Uses AC_Next variant combined with AC_MaxInWindow for panic phase.
- Parameters:
offering_policy – The offering strategy to determine next bid.
a_next – Scaling factor for AC_next no discount (default 1.0).
b_next – Addition factor for AC_next no discount (default 0.0).
constant – Utility threshold above which to always accept (default 0.98).
panic_time – Time after which panic phase begins (default 0.99).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2012.AC_TheNegotiatorReloaded
- offering_policy: OfferingPolicy[source]¶
- class negmas.gb.GACTime(t: float = 0.99, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Time acceptance strategy from Genius.
Accepts any offer after a certain time threshold has passed.
- Parameters:
t – Time threshold (0 to 1). Accept any offer when time > t (default 0.99).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Time
- class negmas.gb.GACTrue(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_True acceptance strategy from Genius.
Always accepts any offer. Useful for debugging and testing.
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_True
- class negmas.gb.GACUncertain(top_percentile: float = 0.1, utility_ratio: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Uncertain acceptance strategy from Genius.
Handles uncertainty profiles. Accepts if offer is in top 10% of bids or if utility is at least 90% of our last offer.
- Parameters:
top_percentile – Top percentile to accept (default 0.1).
utility_ratio – Minimum ratio to our last offer (default 0.9).
Transcompiled from: negotiator.boaframework.acceptanceconditions.other.AC_Uncertain
- class negmas.gb.GACValueModelAgent(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_ValueModelAgent acceptance strategy from Genius (ANAC2011).
Value model based acceptance that tracks opponent’s maximum utility and accepts based on various thresholds that change with time.
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2011.AC_ValueModelAgent
- class negmas.gb.GACYushu(initial_target: float = 0.95, final_target: float = 0.7, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusAcceptancePolicyAC_Yushu acceptance strategy from Genius (ANAC2010).
Time-dependent threshold strategy. The target utility decreases from a high value (0.95) towards a lower acceptable value (0.7) as time progresses.
- Parameters:
initial_target – Initial target utility (default 0.95).
final_target – Final target utility at deadline (default 0.7).
Transcompiled from: negotiator.boaframework.acceptanceconditions.anac2010.AC_Yushu
- class negmas.gb.GAOEvaluationStrategy[source]¶
Bases:
LocalEvaluationStrategyGAOEvaluation strategy.
- eval(negotiator_id: str, state: ThreadState, history: list[ThreadState], mechanism_state: MechanismState) tuple | None | Literal['continue'][source]¶
Eval.
- Parameters:
negotiator_id – Negotiator id.
state – Current state.
history – History.
mechanism_state – Mechanism state.
- Returns:
The result.
- Return type:
GBResponse
- class negmas.gb.GAgentFSEGAOffering(min_utility: float = 0.5, sigma: float = 0.01, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyAgentFSEGA offering strategy from ANAC 2010.
This strategy uses a time-dependent utility threshold that decreases exponentially over time. It selects bids that maximize opponent utility while staying above the threshold.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.AgentFSEGA_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GAgentK2Offering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyAgentK2 offering strategy from ANAC 2011.
Enhanced version of AgentK with improved opponent modeling.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.AgentK2_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GAgentKOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyAgentK offering strategy from ANAC 2010.
This strategy uses a time-dependent target utility that adapts based on the opponent’s behavior. It maintains a map of offered bids and selects bids above a dynamic target threshold.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.AgentK_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function and parameters.
- class negmas.gb.GAgentLGModel(issue_weights: dict[int, float] = NOTHING, value_utils: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelAgentLG opponent model.
This model uses learning-based estimation of opponent preferences.
Transcompiled from: negotiator.boaframework.opponentmodel.AgentLGModel
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GAgentLGOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyAgentLG offering strategy from ANAC 2012.
This strategy uses learning-based concession.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.AgentLG_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GAgentMROffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyAgentMR offering strategy from ANAC 2012.
This strategy uses risk-based concession.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.AgentMR_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GAgentSmithOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyAgentSmith offering strategy from ANAC 2010.
This strategy offers bids based on a time-dependent concession, similar to Boulware but with specific parameters.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.AgentSmith_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GAgentXFrequencyModel(learning_rate: float = 0.25, default_value: int = 1, issue_weights: dict[int, float] = NOTHING, value_counts: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelAgentX frequency-based opponent model from Genius.
From AgentX (ANAC 2015). An advanced frequency model that uses both value frequencies and issue weight learning based on bid patterns.
Tracks issue weights by observing which issues change less frequently, and uses exponential smoothing for weight updates.
- Parameters:
learning_rate – Learning rate for weight updates (default 0.25).
default_value – Default value for unseen issue values (default 1).
Transcompiled from: negotiator.boaframework.opponentmodel.AgentXFrequencyModel
- eval(offer: Outcome | None) Value[source]¶
Evaluate opponent utility.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Estimated opponent utility (0 to 1).
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
Update model based on opponent’s offer.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset the model when preferences change.
- class negmas.gb.GBComponent(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ComponentGBComponent implementation.
- after_proposing(state: GBState, offer: Outcome | ExtendedOutcome | None, dest: str | None = None)[source]¶
Called after proposing
- after_responding(state: GBState, offer: Outcome | None, response: ResponseType | ExtendedResponseType, source: str | None = None)[source]¶
Called before offering
- before_responding(state: GBState, offer: Outcome | None, source: str | None = None)[source]¶
Called before offering
- on_partner_ended(partner: str)[source]¶
Called when a partner ends the negotiation.
Note that the negotiator owning this component may never receive this offer. This is only receivd if the mechanism is sending notifications on every offer.
- on_partner_joined(partner: str)[source]¶
Called when a partner joins the negotiation.
This is only receivd if the mechanism is sending notifications.
- on_partner_left(partner: str)[source]¶
Called when a partner leaves the negotiation.
This is only receivd if the mechanism is sending notifications.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
A callback called by the mechanism when a partner proposes something
- Parameters:
state –
MechanismStategiving the state of the negotiation when the offer was porposed.partner_id – The ID of the agent who proposed
offer – The proposal.
- Remarks:
Will only be called if
enable_callbacksis set for the mechanism
- on_partner_refused_to_propose(state: GBState, partner_id: str) None[source]¶
A callback called by the mechanism when a partner refuses to propose
- Parameters:
state –
MechanismStategiving the state of the negotiation when the partner refused to offer.partner_id – The ID of the agent who refused to propose
- Remarks:
Will only be called if
enable_callbacksis set for the mechanism
- on_partner_response(state: GBState, partner_id: str, outcome: Outcome | None, response: ResponseType) None[source]¶
A callback called by the mechanism when a partner responds to some offer
- Parameters:
state –
MechanismStategiving the state of the negotiation when the partner responded.partner_id – The ID of the agent who responded
outcome – The proposal being responded to.
response – The response
- Remarks:
Will only be called if
enable_callbacksis set for the mechanism
- class negmas.gb.GBMechanism(*args, evaluator_type: type[~negmas.gb.evaluators.base.EvaluationStrategy] | None = None, evaluator_params: dict[str, ~typing.Any] | None = None, local_evaluator_type: type[~negmas.gb.evaluators.base.LocalEvaluationStrategy] | None = None, local_evaluator_params: dict[str, ~typing.Any] | None = None, constraint_type: type[~negmas.gb.constraints.base.OfferingConstraint] | None = None, constraint_params: dict[str, ~typing.Any] | None = None, local_constraint_type: type[~negmas.gb.constraints.base.LocalOfferingConstraint] | None = None, local_constraint_params: dict[str, ~typing.Any] | None = None, response_combiner: ~typing.Callable[[list[tuple | None | ~typing.Literal['continue']]], tuple | None | ~typing.Literal['continue']] = <function all_accept>, dynamic_entry=False, extra_callbacks=False, check_offers=False, enforce_issue_types=False, cast_offers=False, end_on_no_response=True, ignore_negotiator_exceptions=False, parallel: bool = True, sync_calls: bool = False, initial_state: ~negmas.gb.common.GBState | None = None, **kwargs)[source]¶
Bases:
BaseGBMechanismGB mechanism.
- add(negotiator: GBNegotiator, *, preferences: Preferences | None = None, role: str | None = None, ufun: BaseUtilityFunction | None = None) bool | None[source]¶
Add.
- Parameters:
negotiator – Negotiator.
- Returns:
The result.
- Return type:
bool | None
- property extended_trace: list[tuple[int, str, tuple | None]][source]¶
Returns the negotiation history as a list of step/negotiator/offer tuples.
- property full_trace: list[TraceElement][source]¶
Full trace.
- Returns:
The result.
- Return type:
- negotiator_full_trace(negotiator_id: str) list[tuple[float, float, int, tuple, str, str | None, dict[str, Any] | None]][source]¶
Returns the (time/relative-time/step/outcome/response) given by a negotiator (in order)
- negotiator_offers(negotiator_id: str) list[tuple | None][source]¶
Returns the offers given by a negotiator (in order)
- plot(plotting_negotiators: tuple[int, int] | tuple[str, str] = (0, 1), save_fig: bool = False, path: str | None = None, fig_name: str | None = None, ignore_none_offers: bool = True, with_lines: bool = True, show_agreement: bool = False, show_pareto_distance: bool = True, show_nash_distance: bool = True, show_kalai_distance: bool = True, show_max_welfare_distance: bool = True, show_max_relative_welfare_distance: bool = False, show_end_reason: bool = True, show_annotations: bool = False, show_reserved: bool = True, show_total_time=True, show_relative_time=True, show_n_steps=True, colors: list | None = None, markers: list[str] | None = None, colormap: str = 'jet', ylimits: tuple[float, float] | None = None, common_legend: bool = True, xdim: str = 'step', colorizer: Colorizer | None = None, only2d: bool = False, fast=False, simple_offers_view=False, **kwargs)[source]¶
Plot.
- Parameters:
plotting_negotiators – Plotting negotiators.
save_fig – Save fig.
path – Path.
fig_name – Fig name.
ignore_none_offers – Ignore none offers.
with_lines – With lines.
show_agreement – Show agreement.
show_pareto_distance – Show pareto distance.
show_nash_distance – Show nash distance.
show_kalai_distance – Show kalai distance.
show_max_welfare_distance – Show max welfare distance.
show_max_relative_welfare_distance – Show max relative welfare distance.
show_end_reason – Show end reason.
show_annotations – Show annotations.
show_reserved – Show reserved.
show_total_time – Show total time.
show_relative_time – Show relative time.
show_n_steps – Show n steps.
colors – Colors.
markers – Markers.
colormap – Colormap.
ylimits – Ylimits.
common_legend – Common legend.
xdim – Xdim.
colorizer – Colorizer.
only2d – Only2d.
fast – Fast.
simple_offers_view – Simple offers view.
**kwargs – Additional keyword arguments.
- class negmas.gb.GBNMI(id: str, n_outcomes: int | float, outcome_space: OutcomeSpace, time_limit: float, pend: float, pend_per_second: float, step_time_limit: float, negotiator_time_limit: float, n_steps: int | None, dynamic_entry: bool, max_n_negotiators: int | None, _mechanism: Mechanism, annotation: dict[str, Any]=<class 'dict'>)[source]¶
Bases:
NegotiatorMechanismInterfaceGBNMI implementation.
- annotation[source]¶
An arbitrary annotation as a
dict[str, Any]that is always available for all negotiators
- dynamic_entry[source]¶
Whether it is allowed for negotiators to enter/leave the negotiation after it starts
- max_n_negotiators[source]¶
Maximum allowed number of negotiators in the session. None indicates no limit
- negotiator_time_limit[source]¶
The time limit in seconds to wait for negotiator responses of this negotiation session. None indicates infinity
- outcome_space[source]¶
Negotiation agenda as as an
OutcomeSpaceobject. The most common type isCartesianOutcomeSpacewhich represents the cartesian product of a list of issues
- pend[source]¶
The probability that the negotiation times out at every step. Must be less than one. If <= 0, it is ignored
- pend_per_second[source]¶
The probability that the negotiation times out every second. Must be less than one. If <= 0, it is ignored
- class negmas.gb.GBNegotiator(preferences: Preferences | None = None, ufun: BaseUtilityFunction | None = None, name: str | None = None, parent: Controller | None = None, owner: Agent | None = None, id: str | None = None, type_name: str | None = None, **kwargs)[source]¶
Bases:
Negotiator[GBNMI,GBState],Generic[TNMI,TState]Base class for all GB negotiators.
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The utility function of the negotiator (overrides preferences if given)
owner – The
Agentthat owns the negotiator.
- Remarks:
- on_partner_ended(partner: str)[source]¶
Called when a partner ends the negotiation.
Note that the negotiator owning this component may never receive this offer. This is only received if the mechanism is sending notifications on every offer.
- on_partner_proposal(state: GBState, partner_id: str, offer: tuple) None[source]¶
A callback called by the mechanism when a partner proposes something
- Parameters:
state –
GBStategiving the state of the negotiation when the offer was porposed.partner_id – The ID of the agent who proposed
offer – The proposal.
- Remarks:
Will only be called if
enable_callbacksis set for the mechanism
- on_partner_response(state: GBState, partner_id: str, outcome: tuple, response: ResponseType) None[source]¶
A callback called by the mechanism when a partner responds to some offer
- Parameters:
state –
GBStategiving the state of the negotiation when the partner responded.partner_id – The ID of the agent who responded
outcome – The proposal being responded to.
response – The response
- Remarks:
Will only be called if
enable_callbacksis set for the mechanism
- abstractmethod propose(state: GBState, dest: str | None = None) tuple | ExtendedOutcome | None[source]¶
Propose an offer or None to refuse.
- Parameters:
state –
GBStategiving current state of the negotiation.- Returns:
The outcome being proposed or None to refuse to propose
- Remarks:
This function guarantees that no agents can propose something with a utility value
- propose_(state: SAOState, dest: str | None = None) Outcome | ExtendedOutcome | None[source]¶
Propose .
- Parameters:
state – Current state.
dest – Dest.
- Returns:
The result.
- Return type:
Outcome | ExtendedOutcome | None
- abstractmethod respond(state: GBState, source: str | None) ResponseType | ExtendedResponseType[source]¶
Called to respond to an offer. This is the method that should be overriden to provide an acceptance strategy.
- Parameters:
state – a
GBStategiving current state of the negotiation.- Returns:
The response to the offer
- Return type:
- Remarks:
The default implementation never ends the negotiation
The default implementation asks the negotiator to
propose`() and accepts the `offerif its utility was at least as good as the offer that it would have proposed (and above the reserved value).Current offer is accessible through state.threads[source].current_offer as long as source != None otherwise it is None
- respond_(state: SAOState, source: str | None = None) ResponseType | ExtendedResponseType[source]¶
Respond .
- Parameters:
state – Current state.
source – Source identifier.
- Returns:
The result.
- Return type:
- class negmas.gb.GBRAMAgent2Offering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyBRAMAgent2 offering strategy from ANAC 2012.
Enhanced version of BRAMAgent with improved statistics tracking.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.BRAMAgent2_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GBRAMAgentOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyBRAMAgent offering strategy from ANAC 2011.
This strategy uses opponent modeling based on bid frequency statistics to create bids that are acceptable to both parties.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.BRAMAgent_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GBState(running: bool = False, waiting: bool = False, started: bool = False, step: int = 0, time: float = 0.0, relative_time: float = 0.0, broken: bool = False, timedout: bool = False, agreement: Outcome | None = None, results: Outcome | OutcomeSpace | tuple[Outcome] | None = None, n_negotiators: int = 0, has_error: bool = False, error_details: str = '', erred_negotiator: str = '', erred_agent: str = '', threads: dict[str, ThreadState] = NOTHING, last_thread: str = '')[source]¶
Bases:
MechanismStateGBState implementation.
- property base_state: MechanismState[source]¶
Base state.
- Returns:
The result.
- Return type:
- classmethod thread_history(history: list[GBState], source: str) list[ThreadState][source]¶
Thread history.
- Parameters:
history – History.
source – Source identifier.
- Returns:
The result.
- Return type:
- threads: dict[str, ThreadState][source]¶
- class negmas.gb.GBayesianModel(n_hypotheses: int = 10, rationality: float = 5.0, issue_weight_hypotheses: list[dict[int, float]] = NOTHING, hypothesis_probs: list[float] = NOTHING, value_utils: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelBayesian opponent model from Genius.
Uses Bayesian inference to update beliefs about opponent’s utility function based on their bids. Maintains probability distributions over possible opponent preferences and updates them using Bayes’ rule.
This is a simplified version that assumes the opponent is rational and only offers bids above some threshold.
- Parameters:
n_hypotheses – Number of hypotheses to consider (default 10).
rationality – Assumed opponent rationality - higher values assume opponent is more likely to make utility-maximizing bids (default 5.0).
Transcompiled from: negotiator.boaframework.opponentmodel.BayesianModel
- eval(offer: Outcome | None) Value[source]¶
Evaluate opponent utility as weighted average over hypotheses.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Estimated opponent utility (0 to 1).
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
Update hypothesis probabilities using Bayes’ rule.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset the model when preferences change.
- class negmas.gb.GBoulwareOffering(e: float = 0.2, k: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyBoulware offering strategy - a time-dependent strategy with e < 1.
Concedes slowly at first, then faster as deadline approaches. This is a convenience wrapper around GTimeDependentOffering.
- Parameters:
e – Concession exponent (default 0.2, typical Boulware value).
k – Offset constant (default 0).
Transcompiled from: negotiator.boaframework.offeringstrategy.other.TimeDependent_Offering with e < 1
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the delegate time-dependent offering strategy.
- class negmas.gb.GCUHKAgentOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyCUHKAgent offering strategy from ANAC 2012.
This strategy uses sophisticated opponent modeling and adaptive concession.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.CUHKAgent_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GCUHKFrequencyModel(issue_weights: dict[int, float] = NOTHING, value_counts: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelCUHK Frequency-based opponent model.
This model tracks bid frequencies and uses them to estimate opponent preferences with specific adaptations from the CUHK agent.
Transcompiled from: negotiator.boaframework.opponentmodel.CUHKFrequencyModelV2
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GChoosingAllBids(all_outcomes: list[Outcome] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyChoosingAllBids offering strategy from Genius.
Iterates through all possible bids in the domain, offering each one in sequence. Useful for exhaustive exploration or testing.
When all bids have been offered, it restarts from the beginning.
Transcompiled from: negotiator.boaframework.offeringstrategy.other.ChoosingAllBids
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the list of all outcomes.
- class negmas.gb.GConcederOffering(e: float = 2.0, k: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyConceder offering strategy - a time-dependent strategy with e > 1.
Concedes quickly at first, then slows down as deadline approaches. This is a convenience wrapper around GTimeDependentOffering.
- Parameters:
e – Concession exponent (default 2.0, typical Conceder value).
k – Offset constant (default 0).
Transcompiled from: negotiator.boaframework.offeringstrategy.other.TimeDependent_Offering with e > 1
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the delegate time-dependent offering strategy.
- class negmas.gb.GDefaultModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelDefault opponent model from Genius.
A no-op model that doesn’t learn from opponent behavior and assumes uniform preferences. Always returns 0.5 utility for any outcome.
Useful as a baseline or placeholder when no opponent modeling is needed.
Transcompiled from: negotiator.boaframework.opponentmodel.DefaultModel
- eval(offer: Outcome | None) Value[source]¶
Return constant utility (0.5) for any outcome.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Always returns 0.5.
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
No-op - this model doesn’t learn from offers.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
No-op - this model doesn’t adapt.
- class negmas.gb.GFSEGABayesianModel(issue_weights: dict[int, float] = NOTHING, value_utils: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelFSEGA Bayesian opponent model.
This model uses Bayesian inference to estimate opponent preferences, maintaining hypotheses about issue weights and value utilities.
Transcompiled from: negotiator.boaframework.opponentmodel.FSEGABayesianModel
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GFawkesOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyTheFawkes offering strategy from ANAC 2013.
This strategy uses wavelet-based prediction for opponent modeling.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2013.Fawkes_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GGahboninhoOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyGahboninho offering strategy from ANAC 2011.
This strategy uses adaptive concession based on opponent behavior analysis.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.Gahboninho_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GHardHeadedFrequencyModel(learning_coef: float = 0.2, learning_value_addition: int = 1, default_value: int = 1, issue_weights: dict[int, float] = NOTHING, value_weights: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelHard-Headed Frequency-based opponent model from Genius.
This model estimates the opponent’s utility function by tracking which issues remain unchanged between consecutive opponent bids. Issues that don’t change are assumed to be more important to the opponent.
The model works by: 1. Tracking bid frequencies for each issue value 2. When an issue value stays the same between consecutive bids,
increasing its weight (the opponent likely cares about that issue)
Computing opponent utility as a weighted sum of issue value frequencies
- Parameters:
learning_coef – Learning coefficient controlling how fast weights adapt. Higher values mean faster adaptation (default 0.2).
learning_value_addition – Value added to unchanged issue weights (default 1).
default_value – Default value for unseen issue values (default 1).
Transcompiled from: negotiator.boaframework.opponentmodel.HardHeadedFrequencyModel
- eval(offer: Outcome | None) Value[source]¶
Evaluate the estimated opponent utility for an outcome.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Estimated opponent utility (0 to 1).
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Evaluate normalized opponent utility.
- Parameters:
offer – The outcome to evaluate.
above_reserve – Whether to normalize above reserve value.
expected_limits – Whether to use expected limits.
- Returns:
Normalized opponent utility (0 to 1).
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
Update the model based on the opponent’s offer.
- Parameters:
state – Current negotiation state.
partner_id – ID of the partner who made the offer.
offer – The opponent’s offer.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset the model when preferences change.
- Parameters:
changes – List of preference changes.
- class negmas.gb.GHardHeadedOffering(ka: float = 0.05, e: float = 0.05, min_utility: float = 0.585, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyHardHeaded offering strategy from ANAC 2011.
This strategy uses a conservative concession approach with queue-based bid selection. It maintains a queue of potential bids and selects based on utility tolerance.
- Parameters:
ka – Concession parameter (default 0.05).
e – Concession exponent (default 0.05).
min_utility – Minimum acceptable utility (default 0.585).
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.HardHeaded_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function and parameters.
- class negmas.gb.GHardlinerOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyHardliner offering strategy - always offers the best outcome.
Never concedes - always offers the maximum utility outcome. This is equivalent to time-dependent with e = 0.
Transcompiled from: negotiator.boaframework.offeringstrategy.other.TimeDependent_Offering with e = 0
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the inverse utility function.
- class negmas.gb.GIAMCrazyHagglerOffering(breakoff: float = 0.9, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyIAMCrazyHaggler offering strategy from ANAC 2010.
This strategy generates random bids with utility above a breakoff threshold. It’s a simple but effective hardliner strategy that never concedes below a minimum utility level.
- Parameters:
breakoff – Minimum utility threshold (default 0.9).
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.IAMCrazyHaggler_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the inverse utility function.
- class negmas.gb.GIAMHaggler2012Offering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyIAMHaggler2012 offering strategy from ANAC 2012.
Further refined version of IAMhaggler.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.IAMHaggler2012_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GIAMhaggler2010Offering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyIAMhaggler2010 offering strategy from ANAC 2010.
This strategy uses sophisticated time-dependent concession with opponent modeling considerations.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.IAMhaggler2010_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GIAMhaggler2011Offering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyIAMhaggler2011 offering strategy from ANAC 2011.
Updated version of IAMhaggler with improved time management.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.IAMhaggler2011_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GIAMhagglerBayesianModel(issue_weights: dict[int, float] = NOTHING, value_utils: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelIAMhaggler Bayesian opponent model.
This model uses Bayesian inference to estimate opponent preferences with specific adaptation for the IAMhaggler agent family.
Transcompiled from: negotiator.boaframework.opponentmodel.IAMhagglerBayesianModel
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GInoxAgentModel(issue_weights: dict[int, float] = NOTHING, value_utils: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelInoxAgent opponent model.
This model uses adaptive preference estimation.
Transcompiled from: negotiator.boaframework.opponentmodel.InoxAgent_OM
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GInoxAgentOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyInoxAgent offering strategy from ANAC 2013.
This strategy uses adaptive concession based on negotiation dynamics.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2013.InoxAgent_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GLinearOffering(k: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyLinear offering strategy - a time-dependent strategy with e = 1.
Concedes at a constant rate throughout negotiation. This is a convenience wrapper around GTimeDependentOffering.
- Parameters:
k – Offset constant (default 0).
Transcompiled from: negotiator.boaframework.offeringstrategy.other.TimeDependent_Offering with e = 1
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the delegate time-dependent offering strategy.
- class negmas.gb.GNashFrequencyModel(default_value: int = 1, issue_weights: dict[int, float] = NOTHING, value_counts: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelNash frequency-based opponent model from Genius.
A frequency model that aims to estimate outcomes close to the Nash bargaining solution by combining opponent utility estimates with our own utility.
Uses frequency-based opponent modeling but biases toward Pareto-efficient outcomes by considering the product of utilities.
- Parameters:
default_value – Default value for unseen issue values (default 1).
Transcompiled from: negotiator.boaframework.opponentmodel.NashFrequencyModel
- eval(offer: Outcome | None) Value[source]¶
Evaluate opponent utility with Nash-optimal bias.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Estimated opponent utility (0 to 1).
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
Update model based on opponent’s offer.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset the model when preferences change.
- class negmas.gb.GNiceTitForTatOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyNiceTitForTat offering strategy from ANAC 2011.
This strategy mirrors opponent concessions while maintaining a minimum acceptable utility level.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.NiceTitForTat_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GNozomiOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyNozomi offering strategy from ANAC 2010.
This strategy uses adaptive concession based on opponent behavior and time pressure.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.Nozomi_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GOMACagentOffering(min_utility: float = 0.59, eu: float = 0.95, discount_threshold: float = 0.845, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyOMACagent offering strategy from ANAC 2012.
This strategy uses prediction-based bidding with exponential moving average.
- Parameters:
min_utility – Minimum utility threshold (default 0.59).
eu – Expected utility threshold (default 0.95).
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.OMACagent_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GOppositeModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelOpposite opponent model from Genius.
Assumes the opponent has exactly opposite preferences - what’s good for us is bad for them and vice versa. Returns 1 - our_utility.
This is a pessimistic assumption useful for competitive scenarios.
Transcompiled from: negotiator.boaframework.opponentmodel.OppositeModel
- eval(offer: Outcome | None) Value[source]¶
Return opposite utility (1 - our utility).
- Parameters:
offer – The outcome to evaluate.
- Returns:
1 - our_utility for the outcome.
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized opposite utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
No-op - this model uses our utility function inversely.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
No special initialization needed.
- class negmas.gb.GPerfectModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelPerfect opponent model (for testing/debugging).
This model has access to the opponent’s actual utility function. Only useful in experimental settings where opponent preferences are known.
Transcompiled from: negotiator.boaframework.opponentmodel.PerfectModel
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GRandomOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyRandom offering strategy from Genius.
This strategy offers random bids from the outcome space, completely ignoring utility. Also known as “Zero Intelligence” or “Random Walker”.
This is useful for: - Debugging and testing - Creating baseline comparisons - Simulating unpredictable opponents
Transcompiled from: negotiator.boaframework.offeringstrategy.other.Random_Offering
- class negmas.gb.GScalableBayesianModel(learning_rate: float = 0.1, issue_weights: dict[int, float] = NOTHING, value_utils: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelScalable Bayesian opponent model from Genius.
A Bayesian model optimized for large outcome spaces. Uses a more efficient representation that scales better with domain size.
Instead of maintaining full hypothesis distributions, it tracks sufficient statistics and uses approximate inference.
- Parameters:
learning_rate – Rate of belief updates (default 0.1).
Transcompiled from: negotiator.boaframework.opponentmodel.ScalableBayesianModel
- eval(offer: Outcome | None) Value[source]¶
Evaluate opponent utility.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Estimated opponent utility (0 to 1).
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
Update beliefs using online learning.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset the model when preferences change.
- class negmas.gb.GSmithFrequencyModel(default_value: int = 1, value_counts: dict[int, dict] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelSmith frequency-based opponent model from Genius.
From AgentSmith (ANAC 2010). Similar to HardHeadedFrequencyModel but with a simpler weight update mechanism based purely on value frequencies.
The model tracks how often each value appears in opponent bids and assumes higher frequency = higher importance.
- Parameters:
default_value – Default value for unseen issue values (default 1).
Transcompiled from: negotiator.boaframework.opponentmodel.SmithFrequencyModel
- eval(offer: Outcome | None) Value[source]¶
Evaluate opponent utility based on value frequencies.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Estimated opponent utility (0 to 1).
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
Update value frequencies based on opponent’s offer.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset the model when preferences change.
- class negmas.gb.GTheFawkesModel(issue_weights: dict[int, float] = NOTHING, value_utils: dict[int, dict] = NOTHING, bid_history: list[Outcome] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelTheFawkes opponent model.
This model uses wavelet-based analysis for opponent preference estimation.
Transcompiled from: negotiator.boaframework.opponentmodel.TheFawkes_OM
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GTheNegotiatorOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyTheNegotiator offering strategy from ANAC 2011.
This strategy uses time-dependent concession with adaptive parameters.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.TheNegotiator_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GTheNegotiatorReloadedOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyTheNegotiatorReloaded offering strategy from ANAC 2012.
Enhanced version of TheNegotiator with improved time management.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2012.TheNegotiatorReloaded_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GTimeDependentOffering(e: float = 0.2, k: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyTime-dependent offering strategy from Genius.
This strategy offers bids based on a time-dependent target utility curve. The curve is controlled by the concession exponent
e: - e = 0: Hardliner (never concedes) - e < 1: Boulware (concedes slowly, faster near deadline) - e = 1: Linear - e > 1: Conceder (concedes quickly at start)- The target utility at time t is computed as:
f(t) = k + (1 - k) * t^(1/e) target(t) = Pmin + (Pmax - Pmin) * (1 - f(t))
- where:
k: Offset constant (default 0)
e: Concession exponent (default 0.2 for Boulware)
Pmin: Minimum utility (reserved value)
Pmax: Maximum utility (best outcome utility)
- Parameters:
e – Concession exponent. Controls the shape of the concession curve.
k – Offset constant for the time function (default 0).
Transcompiled from: negotiator.boaframework.offeringstrategy.other.TimeDependent_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize the inverse utility function for finding outcomes by utility.
- Parameters:
changes – List of preference changes.
- class negmas.gb.GUniformModel(outcome_utils: dict[tuple, float] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelUniform opponent model from Genius.
Assumes the opponent values all outcomes equally - returns uniform random utility values. Each outcome gets a consistent random value.
Transcompiled from: negotiator.boaframework.opponentmodel.UniformModel
- eval(offer: Outcome | None) Value[source]¶
Return a random but consistent utility for the outcome.
- Parameters:
offer – The outcome to evaluate.
- Returns:
Random utility value in [0, 1], consistent for same outcome.
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
No-op - this model uses random values.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Reset cached utilities when preferences change.
- class negmas.gb.GValueModelAgentOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyValueModelAgent offering strategy from ANAC 2011.
This strategy uses value modeling to predict opponent preferences.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2011.ValueModelAgent_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GWorstModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOpponentModelWorst-case opponent model.
This model assumes the opponent has opposite preferences to ours.
Transcompiled from: negotiator.boaframework.opponentmodel.WorstModel
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Return normalized utility.
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Handle preference changes.
- class negmas.gb.GYushuOffering(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GeniusOfferingPolicyYushu offering strategy from ANAC 2010.
This strategy uses a sigmoid-like concession curve.
Transcompiled from: negotiator.boaframework.offeringstrategy.anac2010.Yushu_Offering
- on_preferences_changed(changes: list[PreferencesChange]) None[source]¶
Initialize utility function.
- class negmas.gb.GeniusAcceptancePolicy(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyBase class for Genius acceptance policies.
- class negmas.gb.GeniusOfferingPolicy(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyBase class for Genius offering policies.
- class negmas.gb.GeniusOpponentModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
VolatileUFunMixin,GBComponent,BaseUtilityFunctionBase class for Genius opponent models.
This base class provides helper methods for updating the negotiator’s private_info with learned opponent utility function estimates.
- class negmas.gb.HybridNegotiator(*args, alpha: float = 1.0, beta: float = 0.0, **kwargs)[source]¶
Bases:
MAPNegotiatorRational Concession Negotiator
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.HybridOfferingPolicy(initial_utility: float = nan, concession_ratio: float = nan, final_utility: float = nan, empathy_score: float = nan, frac_time_based: dict[int, tuple[float, ...]] = NOTHING, above_only: bool = False, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyHybridOffering policy implementation.
- behaviour_based(t: float) float[source]¶
Target utility calculation of Behavior-Based strategy.
- Parameters:
t – Negotiation time.
- Returns:
Target utility.
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
On partner proposal.
- Parameters:
state – Current state.
partner_id – Partner id.
offer – Offer being considered.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.KindConcessionRecommender(kindness: float = 0.0, punish: float = True, initial_concession: float = 0.0, must_concede: bool = True, inverter: UtilityInverter | None = None, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ConcessionRecommenderA simple recommender that does one small concession first then a tit-for-tat response
- Parameters:
kindness – A fraction of the utility range to concede everytime no matter what.
punish – If True, the partner will be punished by pushing our lower utility limit up if the concession (or its expectation) was negative
initial_concession – The amount of concession to do in the first step
must_concede – If
Truethe agent is guaranteed to concede in the first stepinverter – Used only if
must_concedeisTrueto determine the lowest level of concession possible
- inverter: UtilityInverter | None[source]¶
- set_inverter(inverter: UtilityInverter | None) None[source]¶
Set inverter.
- Parameters:
inverter – Inverter.
- set_negotiator(negotiator: GBNegotiator) None[source]¶
Set negotiator.
- Parameters:
negotiator – Negotiator.
- class negmas.gb.LastOfferOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
OfferOrientedSelectorSelects the offer nearest the partner’s last offer
- class negmas.gb.LastOfferOrientedTBNegotiator(*args, distance_fun: ~typing.Callable[[tuple, tuple, ~negmas.outcomes.protocols.OutcomeSpace | None], float] = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
FirstOfferOrientedTBNegotiatorA 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
- class negmas.gb.LimitedOutcomesAcceptancePolicy(prob: dict[Outcome, float] | float | None, p_ending: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAccepts from a list of predefined outcomes
- Remarks:
- class negmas.gb.LimitedOutcomesAcceptor(acceptable_outcomes: list[tuple] | None = None, acceptance_probabilities: list[float] | None = None, p_ending=0.0, preferences=None, ufun=None, **kwargs)[source]¶
Bases:
MAPNegotiator,GBNegotiatorA negotiation agent that uses a fixed set of outcomes in a single negotiation.
- Remarks:
The ufun inputs to the constructor and join are ignored. A ufun will be generated that gives a utility equal to the probability of choosing a given outcome.
- class negmas.gb.LimitedOutcomesNegotiator(acceptable_outcomes: list[tuple] | None = None, acceptance_probabilities: float | list[float] | None = None, proposable_outcomes: list[tuple] | None = None, p_ending=0.0, p_no_response=0.0, preferences=None, ufun=None, **kwargs)[source]¶
Bases:
MAPNegotiatorA negotiation agent that uses a fixed set of outcomes in a single negotiation.
- Parameters:
acceptable_outcomes – the set of acceptable outcomes. If None then it is assumed to be all the outcomes of the negotiation.
acceptance_probabilities – probability of accepting each acceptable outcome. If None then it is assumed to be unity.
proposable_outcomes – the set of outcomes from which the agent is allowed to propose. If None, then it is the same as acceptable outcomes with nonzero probability
p_no_response – probability of refusing to respond to offers
p_ending – probability of ending negotiation
- Remarks:
The ufun inputs to the constructor and join are ignored. A ufun will be generated that gives a utility equal to the probability of choosing a given outcome.
If
proposable_outcomesis passed as None, it is considered the same asacceptable_outcomes
- class negmas.gb.LimitedOutcomesOfferingPolicy(outcomes: list[Outcome] | None, prob: list[float] | None = None, p_ending: float = 0.0, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyOffers from a given list of outcomes
- class negmas.gb.LinearTBNegotiator(*args, **kwargs)[source]¶
Bases:
TimeBasedConcedingNegotiatorA Boulware time-based negotiator that conceeds linearly
- class negmas.gb.LocalEvaluationStrategy[source]¶
Bases:
EvaluationStrategyLocalEvaluation strategy.
- abstractmethod eval(negotiator_id: str, state: ThreadState, history: list[ThreadState], mechanism_state: MechanismState) tuple | None | Literal['continue'][source]¶
Eval.
- Parameters:
negotiator_id – Negotiator id.
state – Current state.
history – History.
mechanism_state – Mechanism state.
- Returns:
The result.
- Return type:
GBResponse
- class negmas.gb.LocalOfferingConstraint[source]¶
Bases:
OfferingConstraint,ABC
- class negmas.gb.MedianOfferSelector(*args, **kwargs)[source]¶
Bases:
OfferSelectorMedianOfferSelector implementation.
- class negmas.gb.MiCRONegotiator(*args, accept_same: bool = True, **kwargs)[source]¶
Bases:
MAPNegotiatorRational Concession Negotiator
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.MiCROOfferingPolicy(next_indx: int = 0, sorter: PresortingInverseUtilityFunction | None = None, received: set[Outcome] = NOTHING, sent: set[Outcome] = NOTHING, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyMiCROOffering policy implementation.
- best_offer_so_far() Outcome | ExtendedOutcome | None[source]¶
Best offer so far.
- Returns:
The result.
- Return type:
Outcome | None
- next_offer() Outcome | ExtendedOutcome | None[source]¶
Next offer.
- Returns:
The result.
- Return type:
Outcome | None
- on_partner_proposal(state: GBState, partner_id: str, offer: Outcome) None[source]¶
On partner proposal.
- Parameters:
state – Current state.
partner_id – Partner id.
offer – Offer being considered.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- negmas.gb.Model[source]¶
alias of
GBComponent
- class negmas.gb.MultiplicativeFirstFollowingTBNegotiator(*args, dist_power: float = 2, issue_weights: list[float] | None = None, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorA 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
- class negmas.gb.MultiplicativeLastOfferFollowingTBNegotiator(*args, dist_power: float = 2, issue_weights: list[float] | None = None, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorA 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
- class negmas.gb.MultiplicativeParetoFollowingTBNegotiator(*args, dist_power: float = 2, issue_weights: list[float] | None = None, offer_filter: OfferFilterProtocol = <function NoFiltering>, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorA 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
- class negmas.gb.MultiplicativePartnerOffersOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, offer_filter: OfferFilterProtocol = <function NoFiltering>, **kwargs)[source]¶
Bases:
PartnerOffersOrientedSelectorOrients offes toward the set of past opponent offers.
The score of an offer is the product of its utility to self and its distance to opponent’s past offers after normalization
- class negmas.gb.MyBestConcensusOfferingPolicy(strategies: list[OfferingPolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
UtilBasedConcensusOfferingPolicyOffers my best outcome from the list of stratgies (different strategy every time).
- class negmas.gb.MyWorstConcensusOfferingPolicy(strategies: list[OfferingPolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
UtilBasedConcensusOfferingPolicyOffers my worst outcome from the list of stratgies (different strategy every time) based on outcome utilities
- class negmas.gb.NaiveTitForTatNegotiator(*args, kindness=0.0, punish=False, initial_concession: float | Literal['min'] = 'min', rank_only: bool = False, stochastic: bool = False, **kwargs)[source]¶
Bases:
MAPNegotiatorImplements a naive tit-for-tat strategy that does not depend on the availability of an opponent model.
- Parameters:
name – Negotiator name
preferences – negotiator preferences
ufun – negotiator ufun (overrides preferences)
parent – A controller
kindness – How ‘kind’ is the agent. A value of zero is standard tit-for-tat. Positive values makes the negotiator concede faster and negative values slower.
stochastic – If
True, the offers will be randomized above the level determined by the current concession which in turn reflects the opponent’s concession.punish – If
Truethe agent punish a partner who does not seem to conede by requiring higher utilitiesinitial_concession – How much should the agent concede in the beginning in terms of utility. Should be a number or the special string value ‘min’ for minimum concession
- Remarks:
This negotiator does not keep an opponent model. It thinks only in terms of changes in its own utility. If the opponent’s last offer was better for the negotiator compared with the one before it, it considers that the opponent has conceded by the difference. This means that it implicitly assumes a zero-sum situation.
- class negmas.gb.NegotiatorAcceptancePolicy(acceptor: GBNegotiator, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyUses a negotiator as an offering strategy
- acceptor: GBNegotiator[source]¶
- class negmas.gb.NegotiatorMechanismInterface(id: str, n_outcomes: int | float, outcome_space: OutcomeSpace, time_limit: float, pend: float, pend_per_second: float, step_time_limit: float, negotiator_time_limit: float, n_steps: int | None, dynamic_entry: bool, max_n_negotiators: int | None, _mechanism: Mechanism, annotation: dict[str, Any]=<class 'dict'>)[source]¶
Bases:
objectAll information of a negotiation visible to negotiators.
- annotation: dict[str, Any][source]¶
An arbitrary annotation as a
dict[str, Any]that is always available for all negotiators
- property cartesian_outcome_space: CartesianOutcomeSpace[source]¶
Returns the
outcome_spaceas aCartesianOutcomeSpaceor raises aValueErrorif that was not possible.Remarks:
Useful for negotiators that only work with
CartesianOutcomeSpaces (i.e.GeniusNegotiator)
- discrete_outcome_space(levels: int = 5, max_cardinality: int = 10000000000) DiscreteOutcomeSpace[source]¶
Returns a stable discrete version of the given outcome-space
- discrete_outcomes(max_cardinality: int | float = inf) Iterable[tuple][source]¶
A discrete set of outcomes that spans the outcome space
- dynamic_entry: bool[source]¶
Whether it is allowed for negotiators to enter/leave the negotiation after it starts
- property estimated_n_steps: int[source]¶
Return an estimate of the number of steps for this negotiation.
- property estimated_time_limit: float[source]¶
Return an estimate of the number of seconds for this negotiation.
- genius_id(id: str | None) str | None[source]¶
Gets the Genius ID corresponding to the given negotiator if known otherwise its normal ID
- property genius_negotiator_ids: list[str][source]¶
Gets the Java IDs of all negotiators (if the negotiator is not a GeniusNegotiator, its normal ID is returned)
- property history: list[source]¶
The full negotiation history of actions, offers, and responses.
- Returns:
Chronological list of all negotiation events and actions
- Return type:
- property issues: tuple[Issue, ...][source]¶
The negotiation issues defining the outcome space dimensions.
- max_n_negotiators: int | None[source]¶
Maximum allowed number of negotiators in the session. None indicates no limit
- n_steps: int | None[source]¶
The allowed number of steps for this negotiation. None indicates infinity
- negotiator_index(source: str) int[source]¶
Returns the negotiator index for the given negotiator. Raises an exception if not found
- negotiator_time_limit: float[source]¶
The time limit in seconds to wait for negotiator responses of this negotiation session. None indicates infinity
- outcome_space: OutcomeSpace[source]¶
Negotiation agenda as as an
OutcomeSpaceobject. The most common type isCartesianOutcomeSpacewhich represents the cartesian product of a list of issues
- property outcomes: Iterable[tuple] | None[source]¶
All outcomes for discrete outcome spaces or None for continuous outcome spaces. See
discrete_outcomes
- property participants: list[NegotiatorInfo][source]¶
Information about all negotiators participating in this negotiation.
- Returns:
List of participant information including IDs and preferences
- Return type:
- pend: float[source]¶
The probability that the negotiation times out at every step. Must be less than one. If <= 0, it is ignored
- pend_per_second: float[source]¶
The probability that the negotiation times out every second. Must be less than one. If <= 0, it is ignored
- random_outcomes(n: int = 1) list[tuple][source]¶
A set of random outcomes from the outcome-space of this negotiation
- property requirements: dict[source]¶
The protocol requirements
- Returns:
A dict of str/Any pairs giving the requirements
- property state: MechanismState[source]¶
Access the current state of the mechanism.
Remarks:
Whenever a method receives a
AgentMechanismInterfaceobject, it can always access the current state of the protocol by accessing this property.
- step_time_limit: float[source]¶
The time limit in seconds for each step of ;this negotiation session. None indicates infinity
- class negmas.gb.NegotiatorOfferingPolicy(*, negotiator: GBNegotiator | None = None, proposer: GBNegotiator)[source]¶
Bases:
OfferingPolicyUses a negotiator as an offering strategy
- proposer: GBNegotiator[source]¶
- class negmas.gb.NiceNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorOffers and accepts anything.
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides prefrences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.NoneOfferingPolicy(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyAlways offers
Nonewhich means it never gets an agreement.
- class negmas.gb.OfferBest(best: Outcome | None = None, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyOffers Only the best outcome.
- Remarks:
You can pass the best outcome if you know it as
bestotherwise it will find it.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.OfferOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, **kwargs)[source]¶
Bases:
OfferSelectorSelects the nearest outcome to the pivot outcome which is updated before responding
- class negmas.gb.OfferSelector(*args, **kwargs)[source]¶
Bases:
OfferSelectorProtocol,GBComponentCan select the best offer in some sense from a list of offers based on an inverter
- class negmas.gb.OfferSelectorProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolCan select the best offer in some sense from a list of offers based on an inverter
- class negmas.gb.OfferTop(fraction: float = 0.0, k: int = 1, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyOffers outcomes that are in the given top fraction or top
k. If neither is given it reverts to only offering the best outcome- Remarks:
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.OfferingPolicy(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GBComponentOffering policy implementation.
- propose(state: GBState, dest: str | None = None) Outcome | ExtendedOutcome | None[source]¶
Propose an offer or None to refuse.
- Parameters:
state –
GBStategiving current state of the negotiation.dest – the thread in which I am supposed to offer.
- Returns:
The outcome being proposed or None to refuse to propose
- Remarks:
Caches results for the same thread and step. If called multiple times for the same thread and step, it will do the computations only once.
Caching is useful when the acceptance strategy calls the offering strategy
- class negmas.gb.OutcomeSetOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, offer_filter: OfferFilterProtocol = <function NoFiltering>, **kwargs)[source]¶
Bases:
OfferSelectorSelects the nearest outcome to a set of pivot outcomes which is updated before responding
- class negmas.gb.ParallelGBMechanism(*args, **kwargs)[source]¶
Bases:
GBMechanismParallelGB mechanism.
- class negmas.gb.PartnerOffersOrientedSelector(distance_fun: DistanceFun = <function generalized_minkowski_distance>, offer_filter: OfferFilterProtocol = <function NoFiltering>, **kwargs)[source]¶
Bases:
OutcomeSetOrientedSelectorOrients offes toward the set of past opponent offers
- negmas.gb.ProposalPolicy[source]¶
alias of
OfferingPolicy
- class negmas.gb.RandomAcceptancePolicy(p_acceptance: float = 0.15, p_rejection: float = 0.25, p_ending: float = 0.1, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyRandomAcceptance policy implementation.
- class negmas.gb.RandomAlwaysAcceptingNegotiator(p_acceptance=0.15, p_rejection=0.75, p_ending=0.1, can_propose=True, accept_around=1.0, eps=0.001, **kwargs)[source]¶
Bases:
MAPNegotiatorRandomAlwaysAccepting negotiator.
- class negmas.gb.RandomConcensusOfferingPolicy(strategies: list[OfferingPolicy], prob: list[float] | None = None, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ConcensusOfferingPolicyOffers a random response from the list of strategies (different strategy every time).
- decide(indices: list[int], responses: list[Outcome | ExtendedOutcome | None]) Outcome | ExtendedOutcome | None[source]¶
Decide.
- Parameters:
indices – Indices.
responses – Responses.
- Returns:
The result.
- Return type:
Outcome | ExtendedOutcome | None
- class negmas.gb.RandomNegotiator(p_acceptance=0.15, p_rejection=0.75, p_ending=0.1, can_propose=True, **kwargs)[source]¶
Bases:
MAPNegotiatorA 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 GBNegotiator
- Remarks:
If p_acceptance + p_rejection + p_ending < 1, the rest is the probability of no-response.
- class negmas.gb.RandomOfferSelector(*args, **kwargs)[source]¶
Bases:
OfferSelectorRandomOfferSelector implementation.
- class negmas.gb.RandomOfferingPolicy(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyAlways offers
Nonewhich means it never gets an agreement.
- class negmas.gb.RejectAlways(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyRejects everything
- class negmas.gb.RepeatFinalOfferOnly(n: int = 9223372036854775807)[source]¶
Bases:
LocalOfferingConstraintRepeatFinalOfferOnly implementation.
- class negmas.gb.RepeatLastOfferOnly(n: int = 9223372036854775807)[source]¶
Bases:
LocalOfferingConstraintRepeatLastOfferOnly implementation.
- eval(state: ThreadState, history: list[ThreadState]) bool[source]¶
Eval.
- Parameters:
state – Current state.
history – History.
- Returns:
The result.
- Return type:
- class negmas.gb.ResponseType(*values)[source]¶
Bases:
IntEnumPossible responses to offers during negotiation.
- class negmas.gb.SerialGBMechanism(*args, **kwargs)[source]¶
Bases:
GBMechanismSerialGB mechanism.
- class negmas.gb.SerialTAUMechanism(*args, cardinality=9223372036854775807, min_unique=0, outcome_space: OutcomeSpace | None = None, issues: list[Issue] | None = None, outcomes: list[tuple] | int | None = None, **kwargs)[source]¶
Bases:
SerialGBMechanismImplements the TAU protocol using the SerialGBMechanism construct in NegMAS
- negmas.gb.SimpleTitForTatNegotiator[source]¶
alias of
NaiveTitForTatNegotiator
- class negmas.gb.TAUEvaluationStrategy(n_outcomes: int = 9223372036854775807, cardinality: int = 9223372036854775807, accepted: dict[tuple | None, set[str]] = NOTHING, offered: dict[tuple | None, set[str]] = NOTHING, repeating: dict[str, bool] = NOTHING, last: dict[str, tuple | None] = NOTHING)[source]¶
Bases:
EvaluationStrategyImplements the Tentative-Accept Unique-Offers Generalized Bargaining Protocol.
- class negmas.gb.TAUMechanism(*args, accept_in_any_thread: bool = True, parallel: bool = True, **kwargs)[source]¶
Bases:
BaseGBMechanismTAU mechanism.
- class negmas.gb.TFTAcceptancePolicy(partner_ufun: UFunModel, recommender: ConcessionRecommender, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
AcceptancePolicyAn acceptance strategy that concedes as much as the partner (or more)
- recommender: ConcessionRecommender[source]¶
- class negmas.gb.TFTOfferingPolicy(partner_ufun: UFunModel, recommender: ConcessionRecommender, stochastic: bool = False, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyAn acceptance strategy that concedes as much as the partner (or more)
- before_responding(state: GBState, offer: Outcome | None, source: str | None = None)[source]¶
Before responding.
- Parameters:
state – Current state.
offer – Offer being considered.
source – Source identifier.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- recommender: ConcessionRecommender[source]¶
- class negmas.gb.ThreadState(new_offer: tuple | None = None, new_data: dict | None = None, new_responses: dict[str, ResponseType] = NOTHING, accepted_offers: list[tuple] = NOTHING)[source]¶
Bases:
objectThreadState implementation.
- new_responses: dict[str, ResponseType][source]¶
- class negmas.gb.TimeBasedConcedingNegotiator(*args, offering_curve: Aspiration | Literal['boulware'] | Literal['conceder'] | Literal['linear'] | float = 'boulware', accepting_curve: Aspiration | Literal['boulware'] | Literal['conceder'] | Literal['linear'] | float | None = None, starting_utility: float = 1.0, **kwargs)[source]¶
Bases:
TimeBasedNegotiatorRepresents a time-based negotiation strategy that is independent of the offers received during the negotiation.
- Parameters:
offering_curve (TimeCurve) – A
TimeCurvethat is to be used to sample outcomes when offeringaccepting_curve (TimeCurve) – A
TimeCurvethat is to be used to decide utility range to acceptstarting_utility (float) – The relative utility (range 1.0 to 0.0) at which to give the first offer. Only used if
offering_curvewas not given
- class negmas.gb.TimeBasedNegotiator(*args, offering_curve: TimeCurve | Literal['boulware'] | Literal['conceder'] | Literal['linear'] | float = 'boulware', accepting_curve: TimeCurve | Literal['boulware'] | Literal['conceder'] | Literal['linear'] | float | None = None, offer_selector: OfferSelector | None = None, **kwargs)[source]¶
Bases:
UtilBasedNegotiatorRepresents a time-based negotiation strategy that is independent of the offers received during the negotiation.
- Parameters:
offering_curve (TimeCurve) – A
TimeCurvethat is to be used to sample outcomes when offeringaccepting_curve (TimeCurve) – A
TimeCurvethat is to be used to decide utility range to acceptinverter (UtilityInverter) – A component used to keep track of the ufun inverse
offer_selector (OfferSelector) – The way to select an offer from the set of valid offers at every time-step
- class negmas.gb.TimeBasedOfferingPolicy(curve: PolyAspiration = NOTHING, stochastic: bool = False, sorter: PresortingInverseUtilityFunction | None = None, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyTimeBasedOffering policy implementation.
- curve: PolyAspiration[source]¶
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.TopFractionNegotiator(min_utility=0.95, top_fraction=0.05, best_first=True, can_propose=True, **kwargs)[source]¶
Bases:
MAPNegotiatorOffers and accepts only one of the top outcomes for the negotiator.
- Parameters:
name – Negotiator name
parent – Parent controller if any
can_propose – If
Falsethe negotiator will never propose but can only acceptpreferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides preferences)
min_utility – The minimum utility to offer or accept
top_fraction – The fraction of the outcomes (ordered decreasingly by utility) to offer or accept
best_first – Guarantee offering will non-increasing in terms of utility value
probabilistic_offering – Offer randomly from the outcomes selected based on
top_fractionandmin_utilityowner – The
Agentthat owns the negotiator.
- class negmas.gb.ToughNegotiator(can_propose=True, **kwargs)[source]¶
Bases:
MAPNegotiatorAccepts and proposes only the top offer (i.e. the one with highest utility).
- Parameters:
- Remarks:
If there are multiple outcome with the same maximum utility, only one of them will be used.
- class negmas.gb.UFunModel(*, negotiator: GBNegotiator | None = None)[source]¶
Bases:
GBComponent,BaseUtilityFunctionA
SAOComponentthat can model the opponent’s utility function.Classes implementing this ufun-model, must implement the abstract
eval()method to return the utility value of an outcome. They can use any callbacks available toSAOComponentto update the model.
- class negmas.gb.UnanimousConcensusOfferingPolicy(strategies: list[OfferingPolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ConcensusOfferingPolicyOffers only if all offering strategies gave exactly the same outcome
- decide(indices: list[int], responses: list[Outcome | ExtendedOutcome | None]) Outcome | ExtendedOutcome | None[source]¶
Decide.
- Parameters:
indices – Indices.
responses – Responses.
- Returns:
The result.
- Return type:
Outcome | ExtendedOutcome | None
- class negmas.gb.UniqueOffers[source]¶
Bases:
LocalOfferingConstraintUniqueOffers implementation.
- class negmas.gb.UtilBasedConcensusOfferingPolicy(strategies: list[OfferingPolicy], *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
ConcensusOfferingPolicy,ABCOffers from the list of stratgies (different strategy every time) based on outcome utilities
- decide(indices: list[int], responses: list[Outcome | ExtendedOutcome | None]) Outcome | ExtendedOutcome | None[source]¶
Decide.
- Parameters:
indices – Indices.
responses – Responses.
- Returns:
The result.
- Return type:
Outcome | ExtendedOutcome | None
- class negmas.gb.UtilBasedNegotiator(*args, stochastic: bool = False, rank_only: bool = False, ufun_inverter: Callable[[BaseUtilityFunction], InverseUFun] | None = None, offer_selector: OfferSelector | None = None, max_cardinality: int = 10000000, eps: float = 0.0001, **kwargs)[source]¶
Bases:
GBNegotiatorA negotiator that bases its decisions on the utility value of outcomes only.
- Parameters:
inverter (UtilityInverter) – A component used to keep track of the ufun inverse
stochastic (bool) – If
Falsethe worst outcome in the current utility range will be usedrank_only (bool) – If
Truethen the ranks of outcomes not their actual utilities will be used for decision makingmax_cardinality (int) – The number of outocmes at which we switch to use the slower
SamplingInverseUtilityFunctioninstead of thePresortingInverseUtilityFunction. Will only be used ifufun_inverterisNoneeps (float) – A tolearnace around the utility range used when sampling outocmes
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- propose(state, dest: str | None = None)[source]¶
Propose.
- Parameters:
state – Current state.
dest – Dest.
- respond(state, source: str | None = None) ResponseType | ExtendedResponseType[source]¶
Respond.
- Parameters:
state – Current state.
source – Source identifier.
- Returns:
The result.
- Return type:
- class negmas.gb.UtilityBasedOutcomeSetRecommender(rank_only: bool = False, ufun_inverter: Callable[[BaseUtilityFunction], InverseUFun] | None = None, max_cardinality: int | float = inf, eps: float = 0.0001, inversion_method: Literal['min', 'max', 'one', 'some', 'all'] = 'some')[source]¶
Bases:
GBComponentRecommends a set of outcome appropriate for proposal
- before_proposing(state: GBState, dest: str | None = None)[source]¶
Before proposing.
- Parameters:
state – Current state.
dest – Dest.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- scale_utilities(urange: tuple[float, ...]) tuple[float, ...][source]¶
Scales given utilities to the range of the ufun.
Remarks:
Assumes that the input utilities are in the range [0-1] no matter what is the range of the ufun.
Subtracts the
tolerancefrom the first and adds it to the last utility value which slightly enlarges the range to account for small rounding errors
- set_negotiator(negotiator: GBNegotiator) None[source]¶
Set negotiator.
- Parameters:
negotiator – Negotiator.
- class negmas.gb.UtilityInverter(*args, offer_selector: OfferSelectorProtocol | Literal['min'] | Literal['max'] | None = None, **kwargs)[source]¶
Bases:
GBComponentA component that can recommend an outcome based on utility
- before_proposing(state: GBState, dest: str | None = None)[source]¶
Before proposing.
- Parameters:
state – Current state.
dest – Dest.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- set_negotiator(negotiator: GBNegotiator) None[source]¶
Set negotiator.
- Parameters:
negotiator – Negotiator.
- class negmas.gb.WABNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorWasting Accepting Better (neither complete nor an equilibrium)
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides preferences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.WANNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorWasting Accepting Any (an equilibrium but not complete)
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides preferences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.WARNegotiator(*args, **kwargs)[source]¶
Bases:
MAPNegotiatorWasting Accepting Any (an equilibrium but not complete)
- Parameters:
name – Negotiator name
parent – Parent controller if any
preferences – The preferences of the negotiator
ufun – The ufun of the negotiator (overrides preferences)
owner – The
Agentthat owns the negotiator.
- class negmas.gb.WAROfferingPolicy(next_indx: int = 0, sorter: PresortingInverseUtilityFunction | None = None, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
OfferingPolicyWAROffering policy implementation.
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- class negmas.gb.WorstOfferSelector(*args, **kwargs)[source]¶
Bases:
OfferSelectorWorstOfferSelector implementation.
- class negmas.gb.ZeroSumModel(above_reserve: bool = True, rank_only: bool = False, *, negotiator: GBNegotiator | None = None)[source]¶
Bases:
StationaryMixin,UFunModelAssumes a zero-sum negotiation (i.e. $u_o$ = $-u_s$ )
Remarks:
Because some negotiators do not work well with negative ufun values, we return (max - u(w)) instead of (- u(w))
- eval(offer: Outcome) Value[source]¶
Eval.
- Parameters:
offer – Offer being considered.
- Returns:
The result.
- Return type:
- eval_normalized(offer: Outcome | None, above_reserve: bool = True, expected_limits: bool = True) Value[source]¶
Eval normalized.
- Parameters:
offer – Offer being considered.
above_reserve – Above reserve.
expected_limits – Expected limits.
- Returns:
The result.
- Return type:
- on_preferences_changed(changes: list[PreferencesChange])[source]¶
On preferences changed.
- Parameters:
changes – Changes.
- negmas.gb.all_accept(responses: list[tuple | None | Literal['continue']]) tuple | None | Literal['continue'][source]¶
All accept.
- Parameters:
responses – Responses.
- Returns:
The result.
- Return type:
GBResponse
- negmas.gb.all_negotiator_types() list[GBNegotiator][source]¶
Returns all the negotiator types defined in negmas.gb.negotiators