Engine

class eagerx.core.specs.EngineSpec(params)[source]

A parameter specification that specifies how BaseEnv should initialize the engine.

add_object(name, **kwargs)[source]

Adds an object to the simulator that is interfaced by the engine.

Parameters

kwargs (Union[bool, int, float, str, List, Dict]) – Other arguments of add_object().

Return type

None

property config: eagerx.core.view.SpecView

Provides an API to set/get the parameters to initialize.

The default parameters are:

  • Spec.config.rate: float

    Rate (Hz) at which the callback() is called.

  • Spec.config.process: int = 0

    Process in which the engine is launched. See process for all options.

  • Spec.config.sync: bool = True

    Flag that specifies whether we run reactive or asynchronous.

  • Spec.config.real_time_factor: float = 0

    A specified upper bound on the real-time factor. Wall-clock-rate`=`real_time_factor`*`rate. If real_time_factor < 1 the simulation is slower than real time.

  • Spec.config.simulate_delays: bool = True

    Flag that specifies whether input delays are simulated. You probably want to set this to False when running in the real-world.

  • Spec.config.color: str = grey

    Specifies the color of logged messages. Check-out the termcolor documentation for the supported colors.

  • Spec.config.print_mode: int = 1

    Specifies the different modes for printing: {1: TERMCOLOR, 2: ROS}.

  • Spec.config.log_level: int = 30

    Specifies the log level for the engine: {0: SILENT, 10: DEBUG, 20: INFO, 30: WARN, 40: ERROR, 50: FATAL}.

Return type

SpecView

Returns

API to get/set parameters.

property inputs: eagerx.core.view.SpecView

Provides an API to set/get the parameters of registered eagerx.core.register.inputs().

The mutable parameters are:

  • Spec.inputs.<name>.window: int = 1

    A non-negative number that specifies the number of messages to pass to the node’s callback().

    • window = 1: Only the last received input message.

    • window = x > 1: The trailing last x received input messages.

    • window = 0: All input messages received since the last call to the node’s callback().

    Note

    With window = 0, the number of input messages may vary and can even be zero.

  • Spec.inputs.<name>.processor: ProcessorSpec = None

    A processor that preprocesses the received input message before passing it to the node’s callback().

  • Spec.inputs.<name>.space: dict = None

    This space defines the format of valid messages.

  • Spec.inputs.<name>.delay: float = 0.0

    A non-negative simulated delay (seconds). This delay is ignored if simulate_delays = True in the engine’s spec().

  • Spec.inputs.<name>.skip: bool = False

    Skip the dependency on this input during the first call to the node’s callback(). May be necessary to ensure that the connected graph is directed and acyclic.

Return type

SpecView

Returns

API to get/set parameters.

property objects: eagerx.core.view.SpecView

Provides an API to set/get the parameters to add an object to the engine.

To add a new object, please use add_object().

Arguments correspond to the signature of add_object().

Return type

SpecView

Returns

API to get/set parameters.

property outputs: eagerx.core.view.SpecView

Provides an API to set/get the parameters of registered eagerx.core.register.outputs().

The mutable parameters are:

  • Spec.outputs.<name>.processor: ProcessorSpec = None

    A processor that preprocesses the output message, returned by callback(), before publishing it.

  • Spec.outputs.<name>.space: dict = None

    This space defines the format of valid messages.

Return type

SpecView

Returns

API to get/set parameters.

property states: eagerx.core.view.SpecView

Provides an API to set/get the parameters of registered eagerx.core.register.states().

The mutable parameters are:

  • Spec.states.<name>.space: dict = None

    This space defines the format of valid messages.

Return type

SpecView

Returns

API to get/set parameters.