Engine State

class eagerx.core.entities.EngineState(ns, name, simulator, backend, params)[source]

Baseclass for engine states.

Use this baseclass to implement engine states for an Object.

Users must call make() to make the subclass’ specification.

Subclasses must implement the following methods:

classmethod info(method=None)

A helper method to get info on a method of the specified subclass.

Parameters:

method (Union[List[str], str, None]) – The registered method we would like to receive info on. If no method is specified, it provides info on the class itself.

Return type:

str

Returns:

Info on the subclass’ method.

abstract initialize(spec, simulator)[source]

An abstract method to initialize the engine state.

Parameters:
  • spec (EngineStateSpec) – The engine state specification.

  • simulator (Any) – A reference to the engine’s simulator.

Return type:

None

abstract classmethod make(*args, **kwargs)

An abstract method that makes the specification (also referred to as spec) of this entity.

Parameters:
  • args (Any) – Arguments to the subclass’ make function.

  • kwargs (Any) – Optional Arguments to the subclass’ make function.

Returns:

A (mutable) spec that can be used to build and subsequently initialize the entity (e.g. node, engine, …).

abstract reset(state)[source]

An abstract method to reset the engine state of an Object.

Parameters:

state (Any) – The desired state that the user can specify before calling reset().

Return type:

None

backend

Responsible for all I/O communication within this process.

name

Name of the state.

ns

Namespace of the environment. Can be set with the name argument to BaseEnv.