negmas.st

Implements single text negotiation mechanisms.

class negmas.st.HillClimbingSTMechanism(*args, **kwargs)[source]

Bases: VetoSTMechanism

A single text mechanism that use hill climbing

Parameters:
  • *args – positional arguments to be passed to the base Mechanism

  • **kwargs – keyword arguments to be passed to the base Mechanism

property current_offer[source]

Current offer.

neighbors(outcome: tuple) list[tuple][source]

Returns all neighbors

Neighbor is an outcome that differs any one of the issues from the original outcome.

next_outcome(outcome: tuple | None) tuple | None[source]

Generate the next outcome given some outcome.

Parameters:

outcome – The current outcome

Returns:

a new outcome or None to end the mechanism run

class negmas.st.VetoSTMechanism(*args, epsilon: float = 1e-06, initial_outcome=None, initial_responses: tuple[bool] = (), initial_state: STState | None = None, **kwargs)[source]

Bases: Mechanism[NegotiatorMechanismInterface, STState, MechanismAction, BinaryComparatorNegotiator]

Base class for all single text mechanisms

Parameters:
  • *args – positional arguments to be passed to the base Mechanism

  • **kwargs – keyword arguments to be passed to the base Mechanism

  • initial_outcome – initial outcome. If None, it will be selected by next_outcome which by default will choose it randomly.

  • initial_responses – Initial set of responses.

Remarks:

  • initial_responses is only of value when the number of negotiators that will join the negotiation is less then or equal to its length. By default it is not used for anything. Nevertheless, it is here because next_outcome may decide to use it with the initial_outcome

property current_offer[source]

Current offer.

initial_outcome[source]

The initial offer

initial_responses[source]

The initial set of responses. See the remarks of this class to understand its role.

last_responses[source]

The responses of all negotiators for the last offer

next_outcome(outcome: tuple | None) tuple | None[source]

Generate the next outcome given some outcome.

Parameters:

outcome – The current outcome

Returns:

a new outcome or None to end the mechanism run

on_negotiation_end() None[source]

Used to pass the final offer for agreement between all negotiators

plot(visible_negotiators: tuple[int, int] | tuple[str, str] = (0, 1), show_all_offers=False, show: bool = True, **kwargs)[source]

Plot.

Parameters:
  • visible_negotiators – Visible negotiators.

  • show_all_offers – Show all offers.

  • show – Whether to display the figure immediately.

  • **kwargs – Additional keyword arguments.

Returns:

The plotly Figure object.