swarmsim.world.spawners.DonutSpawner#

Donut Agent Spawner

class swarmsim.world.spawners.DonutSpawner.DonutAgentSpawner(world, center=(5.0, 5.0), inner_radius=4.0, outer_radius=6.0, **kwargs)[source]#

Spawn agents uniformly within an annular region about a center point.

Inheritance diagram of swarmsim.world.spawners.DonutSpawner.DonutAgentSpawner

Parameters:
  • world (RectangularWorld) – The world to spawn agents in.

  • agent (Agent | BaseAgentConfig | dict) – The agent config to use for the spawned agents. Can be a config dataclass, dictionary, or instance of an agent.

  • center (tuple[float, float] | np.ndarray) – The center of the circle.

  • inner_radius (float) – The inner radius of the donut.

  • outer_radius (float) – The outer radius of the donut.

  • **kwargs – Additional keyword arguments to pass to the base class. This spawner takes the same arguments as PointAgentSpawner and BaseAgentSpawner.

Attributes:
center_point

Methods

angle_between

do_spawn

generate_config

generate_position

make_agent

set_agent_config

set_angle_post_spawn

set_seed

step

generate_config(name=None)[source]#
generate_position()[source]#

Classes

DonutAgentSpawner(world[, center, ...])

Spawn agents uniformly within an annular region about a center point.