larvaworld.lib.model.envs.arena =============================== .. py:module:: larvaworld.lib.model.envs.arena Classes ------- .. autoapisummary:: larvaworld.lib.model.envs.arena.Arena Module Contents --------------- .. py:class:: Arena(model: Any | None = None, **kwargs: Any) Bases: :py:obj:`ViewableBoundedArea`, :py:obj:`agentpy.Space` Simulation arena providing spatial environment for agents. Combines bounded area geometry with agentpy.Space functionality to create a simulation environment where agents can be placed, moved, and interact with sources. Supports both stable and displaceable source management. Attributes: boundary_margin: Margin from arena boundaries (default: 0.96) edges: List of boundary edge segments as Point pairs stable_sources: List of non-movable sources displacable_sources: List of movable sources accessible_sources: Cached accessible sources for agents Example: >>> arena = Arena(model=sim_model, dims=(1.0, 1.0)) >>> arena.place_agent(agent, (0.5, 0.5)) >>> arena.add_sources([food1, food2], [(0.2, 0.3), (0.8, 0.7)]) .. py:attribute:: boundary_margin .. py:attribute:: edges .. py:attribute:: stable_source_positions :value: [] .. py:attribute:: displacable_source_positions :value: [] .. py:attribute:: displacable_sources :value: [] .. py:attribute:: stable_sources :value: [] .. py:attribute:: accessible_sources :value: None .. py:attribute:: accessible_sources_sorted :value: None .. py:method:: place_agent(agent: Any, pos: Any) -> None .. py:method:: move_agent(agent: Any, pos: Any) -> None .. py:method:: add_sources(sources: list[Any], positions: list[Any]) -> None .. py:method:: source_positions_in_array() -> None .. py:method:: accessible_sources_multi(agents: Any, positive_amount: bool = True, return_closest: bool = True) -> None .. py:method:: draw(v: Any | None = None) -> matplotlib.figure.Figure