API Reference#

This is the API reference for the swarmsim package.

The World

The world contains all the objects that will be simulated.

Population

The population is the collection of agents in the world.

Agent

An agent is an object that exists in the world and has volition.

Sensor

An agent can have sensors which distill information from the world into observations for the agent to use on each step() of the simulation.

Controller

Each agent has a controller that can control the agent’s movement and act based on the sensor information each step() of the simulation.

Agent

A population often has multiple agents, each of which can have a different type, controller, or set of sensors.

World Objects (props)

objects are a special type of agent that are not part of the population. It is used to represent objects in the world that are not agents, such as walls, props, and triggers. They are stored in the world’s objects list.

Spawners

spawners can create new agents and add them to the population.

Metrics

A world can have one or more metrics which reduce the state of the world. They can describe the behavior of the agents and are useful for quantifying or training global behaviors.

Subscribers

A world can have subscribers which allow user-defined hooks to run each step() of the simulation.

config

The config module houses the initialization machinery and class registry.

yaml

The yaml module provides additional functionality on top of PyYAML’s yaml module.

util

The util module contains miscellaneous utility functions.

gui

The gui module contains user interface and other display code not related to the world simulation.