Shared Objects

A Shared object is the simplest object shared by agents. A Shared object can be used only within a single process. To share objects across processes use multicore or distributed versions. The methods that an agent can execute on a shared object are as follows:

  1. Register: An agent can subscribe to be activated when a shared object changes value. Any agent A subscribe to a shared object x by calling x.register(A).

  2. Activate all agents that subscribe to a shared variable: An agent is either active or idle (not active). An idle agent takes no action. All the agents that register for a shared object x are activated by calling x.activate(). An active agent executes a next() step at some point.

  3. Deregister: An agent A that is registered with a shared object x can be removed from the registry by calling x.delete().

In addition, any agent A can be activated by calling activate(A).

Examples of shared objects using UNITY are found here.