swarmsim#

This is the root swarmsim module.

See the API Reference for a description of the layout of this module.

Most code in the package is organized into submodules, but some commonly used functions and classes are available directly in the root module. This page lists those.

Functions#

associated_type(type_name)

Decorate a config dataclass to add an associated_type field

filter_unexpected_fields(cls)

Decorate a dataclass to filter out unexpected fields

register_agent_type(name, agent_type[, ...])

Register an agent class with the config system

register_world_type(name, world_type[, ...])

Register a world class with the config system

register_dictlike_namespace(key)

Register a new namespace for classes configured using dicts

register_dictlike_type(key, name, cls)

Register a class for a given namespace

config_from_dict(d)

Create a world config dataclass from a dict.

config_from_yaml(path[, env])

Load a YAML file or template and return a config object.

config_from_yamls(s)

Load a YAML string or stream and return a config object.

world_from_config(config)

Returns a new world instance from the given config.

run_sim(world_config[, show_gui, gui, ...])

Classes#

World(config)

Base world class.

BaseWorldConfig(size, ...)

RectangularWorld(config[, initialize])

RectangularWorldConfig(*args, **kwargs)

Config dataclass for a RectangularWorld.

Agent(config, world[, name, group, initialize])

BaseAgentConfig(position, ...)

StaticAgent(config, world[, name, initialize])

StaticAgentConfig(position, ...)

MazeAgent(config, world[, name, initialize])

MazeAgentConfig(position, ...)

Sensor([agent, parent, static_position, ...])

Controller([agent, parent, controller])

Given agent observations, return agent actions

Spawner(world[, seed])

Spawner: An abstract object creator

PointAgentSpawner(world[, facing, avoid_overlap])

UniformAgentSpawner(world[, region, holes])

CollisionMode(*values)

Functions in this module#

swarmsim.print_debugversions()[source]#

Prints the versions of the operating system and Python.

Functions

print_debugversions()

Prints the versions of the operating system and Python.

Modules

agent

Houses agent submodules.

cache

config

Lazy initialization of built-in types

gui

metrics

sensors

util

world

Houses World modules.

yaml

YAML support for novel swarms