A High-Level Overview of BaseAgent Concepts

A straightforward foundation for your creative simulations

The starting point of every BaseAgent program is a Simulation. All of the parts of your agent-based model are provided to the Simulation, and the Simulation runs through iterations of the model. Simulations may be run with or without a visualization.

The Universe is the world in which everything happens. This is where agents live and act. It can be of any shape: a two-dimensional Flatland, a 3D world, a network of connected nodes, a “soup” in which every position is connected to every other position, and so on.

BaseAgent provides two Universes to support the most commonly-used geometries in agent-based modeling. A Grid is a 2-dimensional world with multiple GridLayers, and a PathNetwork is a world of connected positions. (In BaseAgent, a Network itself is a general concept that can be used in a variety of ways, such as the brains of an agent or to represent social network concepts.)

A spot in the Universe that responds to the simulation but does not change its position or have agency is called a Patch. The logic of a Patch is instantiated once and applied to each position in the Universe like a rubber stamp. Using a Patch is an excellent way to create a computationally efficient simulation of Wolfram’s Cellular Automata, Conway’s Game of Life, or Langton’s Loops.

An Agent has agency in the Universe, and they can do a lot of things out-of-the-box. They possess an Inventory that lets them take and drop items in the Universe, or give and take items with other Agents. They have Knowledge and Properties, each being a map of strings to objects, with Knowledge expected be things that Agents learn over time, and Properties being initial settings for agents. They have a set of Behaviors and they remember their current Behavior. They have State. Behaviors could be a function of Knowledge, Properties, and State. Finally, they are able to send and receive a Message to other Agents.

BaseAgent provides special Agents for the default Universes. A GridAgent is a special type of Agent that knows how to traverse a Grid, and a PathAgent is an Agent that knows how to traverse a PathNetwork.

A special type of GridAgent is an EmbodiedAgent, which exists in a Grid and has a body (which is also a Grid), on which Sensors and Effectors may be placed. Sensors detect things in the environment, including Signals, which could include things like pheromones. They can also detect situations in the Universe, such as being surrounded. Effectors can affect the Universe by moving the agent, moving other things, placing Signals, and so on. Sensors and Effectors may be connected to Processors or special Behaviors that produce a network between observations and actions.

A Behavior can be a single type of action or a selector that chooses other Behaviors to execute. Special behaviors intended for GridAgents and PathAgents give those kinds of Agents a way to explore their Universe.

Agents communicate with each other using a Message, each of which has a title, a subtitle, and a payload that may consist of any object. Agents may also communicate through Pheromones, which are special types of Signals that spread and dissipate over time.

Messages are sent to other Agents through a Communicator. Examples of Communicators include a BroadcastCommunicator, where all Agents hear all Messages; an InRangeCommunicator, which works in a Grid and limits the receipt of Messages to those Agents that are within a certain distance from the sender; and a PathCommunicator, which limits Messages to Agents who are connected to the sender in a PathNetwork. If you want to implement communication issues that mimic the real world, such as electromagnetic interference, this is where to do it.

An Environment contains processing that affects anything at all in the Universe. It may cause simulated weather, sow simulated seeds, and otherwise affect the world.

Any actions in the Simulation may be triggered by a Schedule, which executes one-time events, conditional events, and recurring events.

If one wishes to collect data from a Simulation, a DataCollector collects data at the end of a turn of the simulation. Immediately thereafter, any number of Metrics are evaluated against the collected data.

If one wishes to visualize the Simulation, several of the Simulation Components are Drawable and the Universes may be visualized with a GridCanvas or a PathNetworkCanvas. An Indicator is a visualization component that is responsive to settings in the Simulation, and a Toast provides a way to display text on top of the Simulation. BaseAgent provides a number of default visualization techniques, including a library of shapes for visualizing Agents.

Finally, commonly-used functions may be found in BaseAgentUtils, and common agent-based mathematics are in BaseAgentMath.

Aside from these high-level concepts, BaseAgent has a philosphy of using common, well-understood programming classes and metaphors whenever possible. For example, the most frequent data structures for sharing data between concepts are standard maps and lists.