Oracle#
An oracle is a particular node used by the test environment to compare flows to expected values in a simulation data file (*.sd). The oracle uses a key to reference the simulation data file in the project Resources. Signals defined in the simulation data file are used as inputs of the oracle.
To include an oracle in a test harness, use the DiagramCreator.add_oracle() method.
Oracle class#
- class ansys.scadeone.core.swan.Oracle(id: Identifier)#
Bases:
OperatorExpressionClass representing an oracle in the harness.
- get_full_path() str#
Full path of the Swan construct.
This method is implemented by derived classes that correspond to a declaration at the module level (such as sensor, type, group, const, operator), or a module itself.
- Returns:
strPath within the owner and name of the Swan construct.
- Raises:
ScadeOneExceptionIf the method is not implemented for the current SwanItem type.
- static set_owner(owner: SwanItem | IModel | None, children: SwanItem | Iterable[SwanItem] | None) None#
Helper to set owner as the owner of each item in the Iterable items.
- property id: Identifier#
Oracle key as identifier.
- property is_protected: bool#
Tell if a construct item is syntactically protected with some markup and is stored as a string (without the markup).
- property model: IModel#
Return model containing the Swan item.
- property module: ModuleBase | None#
Module containing the item.
- Returns:
ModuleBase: module container, see
ModuleBodyandModuleInterfaceor None if the object is itself a module.