sierra.plugins.platform.argos.variables.physics_engines

Classes mapping an extent to a set of non-overlapping ARGoS physics engines.

Extent does not have to be the whole arena. 2D and 3D engines.

class sierra.plugins.platform.argos.variables.physics_engines.PhysicsEngines(engine_type: str, n_engines: int, iter_per_tick: int, layout: str, extents: List[ArenaExtent])[source]

Defines 2D/3D physics engines within ARGoS and how they are laid out.

engine_type

The type of physics engine to use (one supported by ARGoS).

n_engines

# of engines. Can be one of [1,4,8,16,24].

iter_per_tick

# of iterations physics engines should perform per tick. layout: Engine arrangement method. Can be one of:

  • uniform_grid2D: Arrange the engines in a uniform 2D grid that extends up to the maximum height in Z. For 2D engines, this is the maximum height of objects that can be present in the arena (I think).

extents

List of (X,Y,Zs) tuple of dimensions of area to assign to engines of the specified type.

Inheritance

Inheritance diagram of PhysicsEngines
__dict__ = mappingproxy({'__module__': 'sierra.plugins.platform.argos.variables.physics_engines', '__doc__': 'Defines 2D/3D physics engines within ARGoS and how they are laid out.\n\n    Attributes:\n\n        engine_type: The type of physics engine to use (one supported by ARGoS).\n\n        n_engines: # of engines. Can be one of [1,4,8,16,24].\n\n        iter_per_tick: # of iterations physics engines should perform per tick.\n                       layout: Engine arrangement method. Can be one of:\n\n                       - ``uniform_grid2D``: Arrange the engines in a uniform 2D\n                         grid that extends up to the maximum height in Z. For 2D\n                         engines, this is the maximum height of objects that can\n                         be present in the arena (I think).\n\n        extents: List of (X,Y,Zs) tuple of dimensions of area to assign to\n                 engines of the specified type.\n\n    ', '__init__': <function PhysicsEngines.__init__>, 'gen_attr_changelist': <function PhysicsEngines.gen_attr_changelist>, 'gen_tag_rmlist': <function PhysicsEngines.gen_tag_rmlist>, 'gen_tag_addlist': <function PhysicsEngines.gen_tag_addlist>, 'gen_files': <function PhysicsEngines.gen_files>, '_gen_all_engines': <function PhysicsEngines._gen_all_engines>, 'gen_single_engine': <function PhysicsEngines.gen_single_engine>, '_gen1_engines': <function PhysicsEngines._gen1_engines>, '_gen2_engines': <function PhysicsEngines._gen2_engines>, '_gen4_engines': <function PhysicsEngines._gen4_engines>, '_gen6_engines': <function PhysicsEngines._gen6_engines>, '_gen8_engines': <function PhysicsEngines._gen8_engines>, '_gen12_engines': <function PhysicsEngines._gen12_engines>, '_gen16_engines': <function PhysicsEngines._gen16_engines>, '_gen24_engines': <function PhysicsEngines._gen24_engines>, '_gen_engine_name': <function PhysicsEngines._gen_engine_name>, '_gen_engine_name_stem': <function PhysicsEngines._gen_engine_name_stem>, '__dict__': <attribute '__dict__' of 'PhysicsEngines' objects>, '__weakref__': <attribute '__weakref__' of 'PhysicsEngines' objects>, '__annotations__': {'tag_adds': 'tp.List[xml.TagAddList]'}})
__doc__ = 'Defines 2D/3D physics engines within ARGoS and how they are laid out.\n\n    Attributes:\n\n        engine_type: The type of physics engine to use (one supported by ARGoS).\n\n        n_engines: # of engines. Can be one of [1,4,8,16,24].\n\n        iter_per_tick: # of iterations physics engines should perform per tick.\n                       layout: Engine arrangement method. Can be one of:\n\n                       - ``uniform_grid2D``: Arrange the engines in a uniform 2D\n                         grid that extends up to the maximum height in Z. For 2D\n                         engines, this is the maximum height of objects that can\n                         be present in the arena (I think).\n\n        extents: List of (X,Y,Zs) tuple of dimensions of area to assign to\n                 engines of the specified type.\n\n    '
__init__(engine_type: str, n_engines: int, iter_per_tick: int, layout: str, extents: List[ArenaExtent]) None[source]
__module__ = 'sierra.plugins.platform.argos.variables.physics_engines'
__weakref__

list of weak references to the object (if defined)

_gen12_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 12 physics engines for the specified extent.

The 2D layout is:

8 9 10 11 7 6 5 4 0 1 2 3

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen16_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 16 physics engines for the specified extent.

The 2D layout is:

15 14 13 12 8 9 10 11 7 6 5 4 0 1 2 3

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen1_engines() TagAddList[source]

Generate definitions for 1 physics engine for the specified extent.

_gen24_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 16 physics engines for the specified extent.

The 2D layout is:

23 22 21 20 19 18 12 13 14 15 16 17 11 10 9 8 7 6 0 1 2 3 4 5

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen2_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 2 physics engines for the specified extents.

Engines are layed out as follows in 2D, regardless if they are 2D or 3D engines:

0 1

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen4_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 4 physics engines for the specified extent.

Engines are layed out as follows in 2D, regardless if they are 2D or 3D engines:

3 2 0 1

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen6_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 6 physics engines for the specified extent.

Engines are layed out as follows in 2D, regardless if they are 2D or 3D engines:

5 4 3 0 1 2

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen8_engines(extent: ArenaExtent) TagAddList[source]

Generate definitions for 8 physics engines for the specified extent.

The 2D layout is:

7 6 5 4 0 1 2 3

Volume is NOT divided equally among 3D engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

_gen_all_engines(extent: ArenaExtent, n_engines_x: int, n_engines_y: int, forward_engines: List[int]) TagAddList[source]

Generate definitions for the specified # of engines for the extent.

_gen_engine_name(engine_id: int) str[source]

Generate the unique ID for an engine.

ID is comprised of a type + numeric identifier of the engine.

_gen_engine_name_stem() str[source]

Generate the name stem for the specified engine type.

gen_attr_changelist() List[AttrChangeSet][source]

No effect.

All tags/attributes are either deleted or added.

gen_files() None[source]
gen_single_engine(engine_id: int, extent: ArenaExtent, n_engines_x: int, n_engines_y: int, forward_engines: List[int]) TagAddList[source]

Generate definitions for a specific 2D/3D engine.

Volume is NOT divided equally among engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

Parameters:
  • engine_id – Numerical UUID for the engine.

  • extent – The mapped extent for ALL physics engines.

  • exceptions – List of lists of points defining polygons which should NOT be managed by any of the engines currently being processed.

  • n_engines_x – # engines in the x direction.

  • n_engines_y – # engines in the y direction.

  • forward_engines – IDs of engines that are placed in increasing order in X when layed out L->R.

gen_tag_addlist() List[TagAddList][source]
gen_tag_rmlist() List[TagRmList][source]

Remove the <physics_engines> tag if it exists may be desirable.

Obviously you must call this function BEFORE adding new definitions.

class sierra.plugins.platform.argos.variables.physics_engines.PhysicsEngines2D(engine_type: str, n_engines: int, spatial_hash_info: Optional[Dict[str, Any]], iter_per_tick: int, layout: str, extents: List[ArenaExtent])[source]

Specialization of PhysicsEngines for 2D.

Inheritance

Inheritance diagram of PhysicsEngines2D
__doc__ = '\n    Specialization of :class:`PhysicsEngines` for 2D.\n    '
__init__(engine_type: str, n_engines: int, spatial_hash_info: Optional[Dict[str, Any]], iter_per_tick: int, layout: str, extents: List[ArenaExtent]) None[source]
__module__ = 'sierra.plugins.platform.argos.variables.physics_engines'
gen_single_engine(engine_id: int, extent: ArenaExtent, n_engines_x: int, n_engines_y: int, forward_engines: List[int]) TagAddList[source]

Generate definitions for a specific 2D/3D engine.

Volume is NOT divided equally among engines, but rather each of the engines is extended up to some maximum height in Z, forming a set of “silos”.

Parameters:
  • engine_id – Numerical UUID for the engine.

  • extent – The mapped extent for ALL physics engines.

  • exceptions – List of lists of points defining polygons which should NOT be managed by any of the engines currently being processed.

  • n_engines_x – # engines in the x direction.

  • n_engines_y – # engines in the y direction.

  • forward_engines – IDs of engines that are placed in increasing order in X when layed out L->R.

tag_adds: List[TagAddList]
class sierra.plugins.platform.argos.variables.physics_engines.PhysicsEngines3D(engine_type: str, n_engines: int, iter_per_tick: int, layout: str, extents: List[ArenaExtent])[source]

Specialization of PhysicsEngines for 3D.

Inheritance

Inheritance diagram of PhysicsEngines3D
__doc__ = '\n    Specialization of :class:`PhysicsEngines` for 3D.\n    '
__init__(engine_type: str, n_engines: int, iter_per_tick: int, layout: str, extents: List[ArenaExtent]) None[source]
__module__ = 'sierra.plugins.platform.argos.variables.physics_engines'
tag_adds: List[TagAddList]