semantic_digital_twin.mixin#
Attributes#
The concrete kind of property a lookup asks for, so that the lookup returns that kind |
Classes#
Marks a field of a simulator property whose attribute the simulator spells |
|
Class representing an additional property for a simulator. |
|
A simulator property an entity carries at most one of, such as the physical |
|
Mixin class to add simulator additional properties to a data class. |
Module Contents#
- class semantic_digital_twin.mixin.SimulatorAttributeName#
Bases:
krrood.patterns.field_metadata.FieldMetadataMarks a field of a simulator property whose attribute the simulator spells differently than the field is named.
- attribute_name: str#
The simulator’s own name for the attribute.
- class semantic_digital_twin.mixin.SimulatorAdditionalProperty#
Class representing an additional property for a simulator.
- to_dict() Dict[str, Any]#
- Returns:
The fields as a dictionary, each under the simulator’s own name for it if the field declares one (see
SimulatorAttributeName), else under its own.
- class semantic_digital_twin.mixin.UniqueSimulatorProperty#
Bases:
SimulatorAdditionalPropertyA simulator property an entity carries at most one of, such as the physical settings of one body or one geometry; a simulator reads exactly one and would silently ignore the rest.
Properties an entity may carry several of, such as cameras or lights, are plain
SimulatorAdditionalProperty.
- semantic_digital_twin.mixin.TUniqueSimulatorProperty#
The concrete kind of property a lookup asks for, so that the lookup returns that kind rather than the base class.
- class semantic_digital_twin.mixin.HasSimulatorProperties#
Mixin class to add simulator additional properties to a data class.
- simulator_additional_properties: List[SimulatorAdditionalProperty] = []#
A list of additional properties for the simulator, it can contain properties of multiple simulators. Extend it with
add_simulator_property(), which keeps aUniqueSimulatorPropertyfrom being attached twice.
- add_simulator_property(simulator_property: SimulatorAdditionalProperty) None#
Attach a property to this entity.
- Parameters:
simulator_property – The property to attach.
- Raises:
DuplicateSimulatorPropertyError – If the property is a
UniqueSimulatorPropertyand one of its type is attached already.
- get_simulator_property_of_type(property_type: Type[TUniqueSimulatorProperty]) TUniqueSimulatorProperty | None#
The property of
property_typethis entity carries.- Parameters:
property_type – The type of property to look up.
- Returns:
The property, or
Noneif none of that type is attached.