SAOSyncController

class negmas.sao.SAOSyncController(*args, global_ufun=False, **kwargs)[source]

Bases: negmas.sao.SAOController

A controller that can manage multiple negotiators synchronously.

Parameters

global_ufun – If true, the controller assumes that the ufun is only defined globally for the complete set of negotiations

Remarks:
  • The controller waits for an offer from each one of its negotiators before deciding what to do.

  • Loops may happen if multiple controllers of this type negotiate with each other. For example controller A is negotiating with B, C, while B is also negotiating with C. These loops are broken by the SAOMechanism by forcing some controllers to respond before they have all of the offers. In this case, counter_all will receive offers from one or more negotiators but not all of them.

Methods Summary

counter_all(offers, states)

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

first_offer(negotiator_id)

Finds the first offer for this given negotiator.

first_proposals()

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

on_negotiation_end(negotiator_id, state)

A call back called at each negotiation end

propose(negotiator_id, state)

respond(negotiator_id, state, offer)

Methods Documentation

abstract counter_all(offers: Dict[str, Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]], states: Dict[str, negmas.sao.SAOState])Dict[str, negmas.sao.SAOResponse][source]

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

Parameters
  • offers – Maps negotiator IDs to offers

  • states – Maps negotiator IDs to offers AT the time the offers were made.

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.

first_offer(negotiator_id: str)Optional[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]][source]

Finds the first offer for this given negotiator. By default it will be the best offer

Parameters

negotiator_id – The ID of the negotiator

Returns

The first offer to use.

Remarks:

Default behavior is to use the ufun defined for the controller if any then try the ufun defined for the negotiator. If neither exists, the first offer will be None.

first_proposals()Dict[str, Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]][source]

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

on_negotiation_end(negotiator_id: str, state: negmas.common.MechanismState)None[source]

A call back called at each negotiation end

Parameters
  • negotiator_id – The negotiator ID

  • stateMechanismState or one of its descendants giving the state at which the negotiation ended.

propose(negotiator_id: str, state: negmas.common.MechanismState)Optional[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]][source]
respond(negotiator_id: str, state: negmas.common.MechanismState, offer: Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]])negmas.outcomes.ResponseType[source]