Hardaware Loop¶
- class HardwareLoop(scenario, manual_triggering=False, plot_information=True, iteration_priority=IterationPriority.DROPS, record_drops=True, **kwargs)[source]¶
Bases:
Serializable
,Generic
[PhysicalScenarioType
,PDT
],Pipeline
[PhysicalScenarioType
,PDT
]Hermespy hardware loop configuration.
- Parameters:
scenario (PhysicalScenarioType) – The physical scenario being controlled by the hardware loop.
manual_triggering (bool, optional) – Require a keyboard user input to trigger each drop manually. Disabled by default.
plot_information (bool, optional) – Plot information during loop runtime. Enabled by default.
iteration_priority (IterationPriority, optional) – Which dimension to iterate over first. Defaults to
IterationPriority.DROPS
.record_drops (bool, optional) – Record drops during loop runtime. Enabled by default.
- add_dimension(dimension)[source]¶
Add a new dimension to the simulation grid.
- Parameters:
dimension (GridDimension) – Dimension to be added.
- Raises:
ValueError – If the dimension already exists within the grid.
- Return type:
- add_plot(plot)[source]¶
Add a new plot to be visualized by the hardware loop during runtime.
- Parameters:
plot (HardwareLoopPlot) – The plot to be added.
- Return type:
- add_post_drop_hook(hook)[source]¶
Add a post-drop hook.
- Parameters:
hook (Callable[[PhysicalScenarioType, Console], None]) – The hook to be added. The hook must accept the scenario and console as arguments.
- Raises:
ValueError – If the hook is already registered.
- Return type:
- add_pre_drop_hook(hook)[source]¶
Add a pre-drop hook.
- Parameters:
hook (Callable[[PhysicalScenarioType, Console], None]) – The hook to be added. The hook must accept the scenario and console as arguments.
- Raises:
ValueError – If the hook is already registered.
- Return type:
- evaluator_index(evaluator)[source]¶
Index of the given evaluator.
Returns: The index of the evaluator.
- new_dimension(dimension, sample_points, *args)[source]¶
Add a dimension to the sweep grid.
Must be a property of the
HardwareLoop.scenario()
.- Parameters:
dimension (str) – String representation of dimension location relative to the investigated object.
sample_points (List[Any]) – List points at which the dimension will be sampled into a grid. The type of points must be identical to the grid arguments / type.
*args (Tuple[Any], optional) – References to the object the imension belongs to. Resolved to the investigated object by default, but may be an attribute or sub-attribute of the investigated object.
- Return type:
Returns: The newly created dimension object.
- run(overwrite=True, campaign='default', serialize_state=True)[source]¶
Run the hardware loop configuration.
- property iteration_priority: IterationPriority¶
Iteration priority of the hardware loop.
- manual_triggering: bool¶
Require a user input to trigger each drop manually
- plot_information: bool¶
Plot information during loop runtime
- property post_drop_hooks: list[Callable[[PhysicalScenarioType, Console], None]]¶
List of post-drop hooks.
Post-drop hooks are called after each drop is generated and can be used to add additional actions not natively supported by the hardware loop.
- property pre_drop_hooks: list[Callable[[PhysicalScenarioType, Console], None]]¶
List of pre-drop hooks.
Pre-drop hooks are called before each drop is generated and can be used to add additional actions not natively supported by the hardware loop.
- record_drops: bool¶
Record drops during loop runtime
- yaml_tag: Optional[str] = 'HardwareLoop'¶
YAML serialization tag