OneShotSyncAgent

class scml.oneshot.OneShotSyncAgent(*args, **kwargs)[source]

Bases: negmas.sao.controllers.SAOSyncController, scml.OneShotAgent, abc.ABC

An agent that automatically accumulate offers from opponents and allows you to control all negotiations centrally in the counter_all method.

Parameters
  • owner – The adapter owning the agent. You do not need to directly deal with this.

  • ufun – An optional OneShotUFun to set for the agent.

  • name – Agent name.

Methods Summary

counter_all(offers, states)

Calculate a response to all offers from all negotiators (negotiator ID is the key).

first_proposals()

Gets a set of proposals to use for initializing the negotiation.

sign_all_contracts(contracts)

Signs all contracts (used internally)

Methods Documentation

abstract counter_all(offers, states)[source]

Calculate a response to all offers from all negotiators (negotiator ID is the key).

Parameters
Return type

Dict[str, SAOResponse]

Returns

A dictionary mapping negotiator ID to an SAOResponse. The response per agent consist of a tuple. In case of acceptance or ending the negotiation the second item of the tuple should be None. In case of rejection, the second item should be the counter offer.

Remarks:
  • The response type CANNOT be WAIT.

  • If the system determines that a loop is formed, the agent may

receive this call for a subset of negotiations not all of them.

abstract first_proposals()[source]

Gets a set of proposals to use for initializing the negotiation.

Return type

Dict[str, Union[OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]]

Returns

A dictionary mapping each negotiator (in self.negotiators dict) to an outcome to be used as the first proposal if the agent is to start a negotiation.

sign_all_contracts(contracts)[source]

Signs all contracts (used internally)

Return type

List[Optional[str]]