NegAgent

class negmas.situated.NegAgent(*args, negotiator_type: Union[str, Type[negmas.negotiators.Negotiator]], negotiator_params: Optional[Dict[str, Any]] = None, **kwargs)[source]

Bases: negmas.situated.Agent

Wraps a negotiator for evaluaton

Attributes Summary

short_type_name

Returns a short name of the type of this entity

type_name

Returns a short name of the type of this entity

Methods Summary

init()

Called to initialize the agent after the world is initialized.

make_negotiator([ufun])

Makes a negotiator of the appropriate type passing it an optional ufun

on_contract_breached(contract, breaches, …)

Called after complete processing of a contract that involved a breach.

on_contract_cancelled(contract, rejectors)

Called whenever at least a partner did not sign the contract

on_contract_executed(contract)

Called after successful contract execution for which the agent is one of the partners.

on_contract_signed(contract)

Called whenever a contract is signed by all partners

on_neg_request_accepted(req_id, mechanism)

Called when a requested negotiation is accepted

on_neg_request_rejected(req_id, by)

Called when a requested negotiation is rejected

on_negotiation_failure(partners, annotation, …)

Called whenever a negotiation ends without agreement

on_negotiation_success(contract, mechanism)

Called whenever a negotiation ends with agreement

respond_to_renegotiation_request(contract, …)

Called to respond to a renegotiation request

set_renegotiation_agenda(contract, breaches)

Received by partners in ascending order of their total breach levels in order to set the renegotiation agenda when contract execution fails

step()

Called by the simulator at every simulation step

Attributes Documentation

short_type_name

Returns a short name of the type of this entity

type_name

Returns a short name of the type of this entity

Methods Documentation

init()[source]

Called to initialize the agent after the world is initialized. the AWI is accessible at this point.

make_negotiator(ufun: Optional[negmas.utilities.UtilityFunction] = None)[source]

Makes a negotiator of the appropriate type passing it an optional ufun

on_contract_breached(contract: negmas.situated.Contract, breaches: List[negmas.situated.Breach], resolution: Optional[negmas.situated.Contract])None[source]

Called after complete processing of a contract that involved a breach.

on_contract_cancelled(contract: negmas.situated.Contract, rejectors: List[str])None[source]

Called whenever at least a partner did not sign the contract

on_contract_executed(contract: negmas.situated.Contract)None[source]

Called after successful contract execution for which the agent is one of the partners.

on_contract_signed(contract: negmas.situated.Contract)None[source]

Called whenever a contract is signed by all partners

on_neg_request_accepted(req_id: str, mechanism: negmas.common.AgentMechanismInterface)[source]

Called when a requested negotiation is accepted

on_neg_request_rejected(req_id: str, by: Optional[List[str]])[source]

Called when a requested negotiation is rejected

on_negotiation_failure(partners: List[str], annotation: Dict[str, Any], mechanism: negmas.common.AgentMechanismInterface, state: negmas.common.MechanismState)None[source]

Called whenever a negotiation ends without agreement

on_negotiation_success(contract: negmas.situated.Contract, mechanism: negmas.common.AgentMechanismInterface)None[source]

Called whenever a negotiation ends with agreement

respond_to_renegotiation_request(contract: negmas.situated.Contract, breaches: List[negmas.situated.Breach], agenda: negmas.situated.RenegotiationRequest)Optional[negmas.negotiators.Negotiator][source]

Called to respond to a renegotiation request

set_renegotiation_agenda(contract: negmas.situated.Contract, breaches: List[negmas.situated.Breach])Optional[negmas.situated.RenegotiationRequest][source]

Received by partners in ascending order of their total breach levels in order to set the renegotiation agenda when contract execution fails

step()[source]

Called by the simulator at every simulation step