MechanismState
- class negmas.common.MechanismState(running=False, waiting=False, started=False, step=0, time=0.0, relative_time=0.0, broken=False, timedout=False, agreement=None, results=None, n_negotiators=0, has_error=False, error_details='', erred_negotiator='', erred_agent='')[source]
Bases:
object
Encapsulates the mechanism state at any point
Attributes Summary
Agreement at the end of the negotiation (it is always None until an agreement is reached).
True if the negotiation has started and ended with an END_NEGOTIATION
ID of the agent owning the negotiator that raised the last error
ID of the negotiator that raised the last error
Details of the error if any
Does the mechanism have any errors
Number of agents currently in the negotiation.
A number in the period [0, 1] giving the relative time of the negotiation.
In its simplest form, an agreement is a single outcome (or None for failure).
Whether the negotiation has started and did not yet finish
Whether the negotiation has started
The current round of the negotiation
The current real time of the negotiation.
True if the negotiation was timedout
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:
tuple
|None
Agreement at the end of the negotiation (it is always None until an agreement is reached).
- completed
- done
- ended
-
n_negotiators:
int
Number of agents currently in the negotiation. Notice that this may change over time if the mechanism supports dynamic entry
-
relative_time:
float
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:
tuple
|OutcomeSpace
|tuple
[tuple
] |None
In its simplest form, an agreement is a single outcome (or None for failure). Nevertheless, it can be a tuple of outcomes or even a complete outcome space.
Methods Documentation
-
agreement: