KindConcessionRecommender
- 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
Attributes Summary
Methods Summary
__call__(partner_concession, state)Returns an estimate of the concession to be made given the partner_concession
after_join(nmi)A call back called after joining a negotiation to confirm wwe joined.
after_proposing(state, offer[, dest])Called after proposing
after_responding(state, offer, response[, ...])Called before offering
before_proposing(state[, dest])Called before proposing
before_responding(state, offer[, source])Called before offering
can_join(nmi, state, *[, preferences, ufun, ...])A call back called before joining a negotiation to confirm that we can join it.
on_leave(state)A call back called after leaving a negotiation.
on_mechanism_error(state)A call back called whenever an error happens in the mechanism.
on_negotiation_end(state)A call back called at each negotiation end
on_negotiation_start(state)A call back called at each negotiation start
on_partner_ended(partner)Called when a partner ends the negotiation.
on_partner_joined(partner)Called when a partner joins the negotiation.
on_partner_left(partner)Called when a partner leaves the negotiation.
on_partner_proposal(state, partner_id, offer)A callback called by the mechanism when a partner proposes something
on_partner_refused_to_propose(state, partner_id)A callback called by the mechanism when a partner refuses to propose
on_partner_response(state, partner_id, ...)A callback called by the mechanism when a partner responds to some offer
on_preferences_changed(changes)Called to inform the component that the ufun has changed and the kinds of change that happened.
on_round_end(state)A call back called at each negotiation round end
on_round_start(state)A call back called at each negotiation round start
set_inverter(inverter)set_negotiator(negotiator)Sets the negotiator of which this component is a part.
Attributes Documentation
- inverter: UtilityInverter | None
- negotiator
Methods Documentation
- __call__(partner_concession: Value, state: GBState) float[source]
Returns an estimate of the concession to be made given the partner_concession
- after_join(nmi: NegotiatorMechanismInterface) None
A call back called after joining a negotiation to confirm wwe joined.
- after_proposing(state: GBState, offer: Outcome | None, dest: str | None = None)
Called after proposing
- after_responding(state: GBState, offer: Outcome | None, response: ResponseType, source: str | None = None)
Called before offering
- before_responding(state: GBState, offer: Outcome | None, source: str | None = None)
Called before offering
- can_join(nmi: NegotiatorMechanismInterface, state: MechanismState, *, preferences: Preferences | None = None, ufun: BaseUtilityFunction | None = None, role: str = 'negotiator') bool
A call back called before joining a negotiation to confirm that we can join it.
- on_leave(state: MechanismState) None
A call back called after leaving a negotiation.
- on_mechanism_error(state: MechanismState) None
A call back called whenever an error happens in the mechanism. The error and its explanation are accessible in
state
- on_negotiation_end(state: MechanismState) None
A call back called at each negotiation end
- on_negotiation_start(state: MechanismState) None
A call back called at each negotiation start
- on_partner_ended(partner: str)
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)
Called when a partner joins the negotiation.
This is only receivd if the mechanism is sending notifications.
- on_partner_left(partner: str)
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
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
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
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
- on_preferences_changed(changes: list[PreferencesChange])
Called to inform the component that the ufun has changed and the kinds of change that happened.
- on_round_end(state: MechanismState) None
A call back called at each negotiation round end
- on_round_start(state: MechanismState) None
A call back called at each negotiation round start
- set_inverter(inverter: UtilityInverter | None) None[source]
- set_negotiator(negotiator: GBNegotiator) None[source]
Sets the negotiator of which this component is a part.