swarmsim.world.objects.StaticObject#
Module for StaticObject class.
StaticObject is a class for objects that do not move.
It is a subclass of StaticAgent
and is basically the same except it does not step()
or
draw_direction()
.
Object Config Class#
- class swarmsim.world.objects.StaticObject.StaticObjectConfig(position: tuple[float, ...] | numpy.ndarray = (0, 0), angle: float | typing.Any = 0.0, name: str | typing.Any = None, controller: typing.Any | None = None, grounded: bool = True, collides: bool | int = True, sensors: list = <factory>, team: str | None = None, seed: int | None | str = 'unspecified', agent_radius: float = 0.0, body_color: tuple[int, int, int] = (255, 255, 255), body_filled: bool = False, points: list[tuple[float, float]] | numpy.ndarray | str = <factory>, anchor_point: None | tuple[float, float] | str = None, debug: bool = False)[source]#
- Attributes:
- anchor_point
- controller
- name
- team
Methods
as_config_dict
as_dict
as_generator
asdict
attach_world_config
from_dict
Object Class#
- class swarmsim.world.objects.StaticObject.StaticObject(config: StaticAgentConfig, world: RectangularWorld, name=None, initialize=True)[source]#
- Attributes:
- is_poly
- poly_rotated
position
Alias for
pos
.
Methods
copy
()Create a copy of this agent.
from_config
(config, world)Returns a new agent instance from the given config and world.
getPosition
()Alias for
pos
.getVelocity
()Alias for
dpos
.get_aabb
()Get the agent's
AABB
.get_sensors
()Alias for
sensors
.make_aabb
()Return the Bounding Box of the agent
orientation_uvec
([offset])Returns the agent's 2D orientation matrix.
set_heading
(new_heading)Set the agent's heading (radians).
set_name
(new_name)Set the name of the agent.
set_pos_vec
(vec)Set the
x
,y
, andangle
of the agent.setup_controller_from_config
()Creates and adds the
AgentConfig.controller
to the agent.setup_sensors_from_config
()Creates and adds sensors from the
AgentConfig.sensors
to the agent.attach_agent_to_sensors
build_collider
debug_draw
draw
draw_direction
getFrontalPoint
get_heading
get_name
get_simple_poly_radius
get_x_pos
get_y_pos
on_key_press
rotmat2d
rotmat2dT
rotmat3d
set_seed
set_x_pos
set_y_pos
step
Classes
|
|
|