OneShotIndNegotiatorsAgent

class scml.oneshot.OneShotIndNegotiatorsAgent(*args, default_negotiator_type='negmas.sao.AspirationNegotiator', default_negotiator_params=None, normalize_ufuns=False, set_reservation=False, **kwargs)[source]

Bases: scml.OneShotAgent

A one-shot agent that deligates all of its decisions to a set of independent negotiators (one per partner per day).

Parameters
  • default_negotiator_type – An SAONegotiator descendent to be used for creating all negotiators. It can be passed either as a class object or a string with the full class name (e.g. “negmas.sao.AspirationNegotiator”).

  • default_negotiator_type – A dict specifying the paratmers used to create negotiators.

  • normalize_ufuns – If true, all utility functions will be normalized to have a maximum of 1.0 (the minimum value may be negative).

  • set_reservation – If given, the reserved value of all ufuns will be guaranteed to be between the minimum and maximum of the ufun. This is needed to avoid failures of some GeniusNegotiators.

Remarks:

  • To use this class, you need to override generate_ufuns. If you want to change the negotiator type used depending on the partner, you can also override generate_negotiator.

  • If you are using a GeniusNegotiator you must guarantee the following:
    • All ufuns are of the type LinearUtilityAggregationFunction.

    • All ufuns are normalized with a maximum value of 1.0. You can use normalize_ufuns=True to gruarantee that.

    • All ufuns have a finite reserved value and at least one outcome is

    above it. You can guarantee that by using set_reservation=True.

    • All ufuns are created with outcome_type=tuple. See test_ind_negotiators_genius() at tests/test_scml2021oneshot.py for an example.

    • All weights of the LinearUtilityAggregationFunction must be between zero and one and the weights must sum to one.

Methods Summary

generate_negotiator(partner_id)

Returns a negotiator to be used with some partner.

generate_ufuns()

Returns a utility function for each partner.

init()

Called once after the AWI is set.

make_negotiator([negotiator_type, name])

Creates a negotiator but does not add it to the controller.

propose(negotiator_id, state)

Proposes an offer to one of the partners.

step()

Called every step.

Methods Documentation

generate_negotiator(partner_id)[source]

Returns a negotiator to be used with some partner.

Remarks:

The default implementation will use the default_negotiator_type and default_negotiator_params.

Return type

SAONegotiator

abstract generate_ufuns()[source]

Returns a utility function for each partner. All ufuns MUST be of type LinearUtilityAggregationFunction if a genius negotiator is used.

Return type

Dict[str, UtilityFunction]

init()[source]

Called once after the AWI is set.

Remarks:
  • Use this for any proactive initialization code.

make_negotiator(negotiator_type=None, name=None, **kwargs)[source]

Creates a negotiator but does not add it to the controller. Call add_negotiator to add it.

Parameters
  • negotiator_type – Type of the negotiator to be created.

  • name (Optional[str]) – negotiator name

  • **kwargs – any key-value pairs to be passed to the negotiator constructor

Returns

The negotiator to be controlled. None for failure

Remarks:

If you would like not to negotiate, just return EndingNegotiator() instead of None. The value None should only be returned if an exception is to be thrown.

propose(negotiator_id, state)[source]

Proposes an offer to one of the partners.

Parameters
  • negotiator_id – ID of the negotiator (and partner)

  • state – Mechanism state including current step

Returns

an outcome to offer.

step()[source]

Called every step.

Remarks:
  • Use this for any proactive code that needs to be done every simulation step.