MechanismState

class negmas.common.MechanismState(running: bool = False, waiting: bool = False, started: bool = False, step: int = 0, time: float = 0.0, relative_time: float = 0.0, broken: bool = False, timedout: bool = False, agreement: Optional[Outcome] = None, results: Optional[Union[Outcome, List[Outcome], List[Issue]]] = None, n_negotiators: int = 0, has_error: bool = False, error_details: str = '')[source]

Bases: object

Encapsulates the mechanism state at any point

Attributes Summary

agreement

Agreement at the end of the negotiation (it is always None until an agreement is reached).

broken

True if the negotiation has started and ended with an END_NEGOTIATION

ended

error_details

Details of the error if any

has_error

Does the mechanism have any errors

n_negotiators

Number of agents currently in the negotiation.

relative_time

A number in the period [0, 1] giving the relative time of the negotiation.

results

In its simplest form, an agreement is a single outcome (or None for failure).

running

Whether the negotiation has started and did not yet finish

started

Whether the negotiation has started

step

The current round of the negotiation

time

The current real time of the negotiation.

timedout

True if the negotiation was timedout

waiting

Whether the negotiation is waiting for some negotiator to respond

Methods Summary

asdict()

Converts the outcome to a dict containing all fields

keys()

values()

Attributes Documentation

agreement: Optional[Outcome] = None

Agreement at the end of the negotiation (it is always None until an agreement is reached).

broken: bool = False

True if the negotiation has started and ended with an END_NEGOTIATION

ended
error_details: str = ''

Details of the error if any

has_error: bool = False

Does the mechanism have any errors

n_negotiators: int = 0

Number of agents currently in the negotiation. Notice that this may change over time if the mechanism supports dynamic entry

relative_time: float = 0.0

A number in the period [0, 1] giving the relative time of the negotiation. Relative time is calculated as max(step/n_steps, time/time_limit).

results: Optional[Union[Outcome, List[Outcome], List[Issue]]] = None

In its simplest form, an agreement is a single outcome (or None for failure). Nevertheless, it can be a list of outcomes or even a list of negotiation issues for future negotiations.

running: bool = False

Whether the negotiation has started and did not yet finish

started: bool = False

Whether the negotiation has started

step: int = 0

The current round of the negotiation

time: float = 0.0

The current real time of the negotiation.

timedout: bool = False

True if the negotiation was timedout

waiting: bool = False

Whether the negotiation is waiting for some negotiator to respond

Methods Documentation

asdict()[source]

Converts the outcome to a dict containing all fields

keys()[source]
values()[source]