negmas.situated Package
This module defines the base classes for worlds within which multiple agents engage in situated negotiations
The Agent
class encapsulates the managing entity that creates negotiators to engage in negotiations within a world
Simulation
in order to maximize its own total utility.
Remarks:
When immediate_negotiations is true, negotiations start in the same step they are registered in (they may also end in that step) and
negotiation_speed_multiple
steps of it are conducted. That entails that requesting a negotiation may result in new contracts in the same time-step only ofimmediate_negotiations
is true.
Simulation steps:
It is possible to control the order of the simulation steps differently using the
operations
parameter to the world constructor. this is the default order
prepare custom stats (call
_pre_step_stats
)step all existing negotiations
negotiation_speed_multiple
times handling any failed negotiations and creating contracts for any resulting agreementsAllow custom simulation (call
simulation_step
) with stage 0run all
Entity
objects registered (i.e. all agents) in the predefinedsimulation_order
.sign contracts that are to be signed at this step calling
on_contracts_finalized
/on_contract_signed
as neededexecute contracts that are executable at this time-step handling any breaches
allow custom simulation steps to run (call
simulation_step
) with stage 1remove any negotiations that are completed!
update basic stats
update custom stats (call
_post_step_stats
)
Monitoring a simulation:
You can monitor a running simulation using a WorldMonitor
or StatsMonitor
object. The former monitors events in the
world while the later monitors the statistics of the simulation.
This is a list of some of the events that can be monitored by WorldMonitor
. World designers can add new events
either by announcing them using announce
or as a side-effect of logging them using any of the log functions.
Event |
Data |
---|---|
extra-step |
none |
mechanism-creation-exception |
exception: |
zero-outcomes-negotiation |
caller: |
entity-exception |
exception: |
contract-exception |
|
agent-exception |
|
agent-joined |
agent: |
negotiation-request |
caller: |
negotiation-request-immediate |
caller: |
negotiation-request-rejected |
caller: |
negotiation-request-accepted |
caller: |
negotiation-success |
mechanism: |
negotiation-failure |
|
contract-executing |
contract: |
contract-nullified |
contract: |
contract-breached |
|
breach-resolved |
contract: |
contract-executed |
contract: |
dropped-contract |
contract: |
Functions
|
Returns min(a, b) assuming None is less than anything. |
Plots the edge colors used with their meaning |
|
|
Saves the statistics of a world run. |
Classes
|
Keeps track of running negotiations for an agent |
|
Keeps track to negotiation requests that an agent sent |
|
A request for renegotiation. |
|
Saves information about a negotiation |
|
|
|
An action that an |
|
Represents an adapter agent that makes some included object act as an agent in some world. |
|
Base class for all agents that can run within a |
|
Defines an entity that is a part of the world but does not participate in the simulation |
|
Agent World Interface class |
|
The way breaches are to be handled |
|
|
The bulletin-board which carries all public information. |
|
|
A agreement definition which encapsulates an agreement with partners and extra information |
|
A mechanism creation class. |
A mixin to add when there is no contract execution |
|
A mixin that can be added to Agent to minimize the number of abstract methods |
|
|
A monitor object capable of receiving stats of a world |
|
A monitor object capable of monitoring a world. |
|
Base world class encapsulating a world that runs a simulation with several agents interacting within some dynamically changing environment. |
|
Represents a simple world with no simulation and sane values for most callbacks and methods. |
|
A world that runs a list of negotiators in a given scenario to evaluate them |
|
Wraps a negotiator for evaluaton |
|
A representation of a negotiation scenario in which a negotiator can be evaluated |