Physical Scenario

class PhysicalScenario(seed=None, devices=None)[source]

Bases: Generic[PDT], Scenario[PDT, DeviceState, Drop]

Scenario of physical device bindings.

Managing physical devices by a scenario enables synchronized triggering and shared random seed configuration.

Parameters:
  • seed (int, optional) – Random seed used to initialize the pseudo-random number generator.

  • devices (Sequence[Device], optional) – Devices to be added to the scenario during initialization.

add_device(device)[source]

Add a new device to the scenario.

Parameters:

device (Device) – New device to be added to the scenario.

Raises:
Return type:

None

receive_devices(impinging_signals=None, states=None, notify=True)[source]

Receive over all scenario devices.

Internally calls Scenario.process_inputs() and Scenario.receive_devices().

Parameters:
  • impinging_signals (Sequence[DeviceInput | Signal | Sequence[Signal]] | None, optional) – List of signals impinging onto the devices. If not specified, the device will download the signal samples from its binding.

  • states (Sequence[DeviceState | None], optional) – States of the transmitting devices. If not specified, the current device states will be queried by calling :meth:`Device.state

  • notify (bool, optional) – Notify the receiving DSP layer’s callbacks about the reception results. Enabled by default.

Return type:

Sequence[DeviceReception]

Returns: List of the processed device input information.

Raises:

ValueError – If the number of impinging_signals does not match the number of registered devices.

trigger_direct(transmissions, devices=None, calibrate=True)[source]

Trigger a synchronized transmission and reception for all managed devices.

Parameters:
  • transmissions (list[Signal]) – List of signals to be transmitted.

  • devices (list[TypeVar(PDT, bound= PhysicalDevice)] | None) – List of devices to be triggered.

  • calibrate (bool) – Apply device calibrations during transmission and reception.

Return type:

list[Signal]

Returns: List of signals received by all devices.