Skip to content

Probabilistic Relational Models

For now, pyAgrum only allows to explore Probabilistic Relational Models written with o3prm syntax (see O3PRM website).

PRMexplorer helps navigate through probabilistic relational models.

PRMexplorer() -> PRMexplorer : default constructor

min/max/count/exists/forall/or/and/amplitude/median

  • Parameters: class_name (str) – a class name
  • Returns: the list of aggregates in the class
  • Return type: list
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: class_name (str) – a class name
  • Returns: the list of attributes
  • Return type: list
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: class_name (str) – a class name
  • Returns: a description of the DAG
  • Return type: tuple
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: class_name (str) – a class name
  • Returns: the list of interfaces implemented by the class
  • Return type: list
  • Parameters: class_name (str) – a class name
  • Returns: the list of parameters
  • Return type: list
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: class_name (str) – a class name
  • Returns: the list of references
  • Return type: list
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: class_name (str) – a class name
  • Returns: the list of class slot chains
  • Return type: list
  • Raises: pyagrum.IndexError – if the class is not in the PRM
  • Returns: the list of classes
  • Return type: list
  • Parameters:
    • class_name (str) – a class name
    • attribute (str) – an attribute
  • Returns: the tensor of the attribute
  • Return type: pyagrum.Tensor
  • Raises:
    • pyagrum.OperationNotAllowed – If the class element doesn’t have any “pyagrum.Tensor” (like a pyagrum.PRMReferenceSlot).
    • pyagrum.IndexError – If the class is not in the PRM
    • pyagrum.IndexError – If the attribute in parameters does not exist
  • Parameters: class_name (str) – a class name
  • Returns: the list of direct subclasses
  • Return type: list
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: interface_name (str) – an interface name
  • Returns: the list of direct subinterfaces
  • Return type: list
  • Raises: pyagrum.IndexError – If the interface is not in the PRM
  • Parameters: type_name (str) – a type name
  • Returns: the list of direct subtypes
  • Return type: list
  • Raises: pyagrum.IndexError – If the type is not in the PRM
  • Parameters: interface_name (str) – an interface name
  • Returns: the list of classes implementing the interface
  • Return type: str
  • Raises: pyagrum.IndexError – If the interface is not in the PRM
  • Parameters: type_name (str) – a type name
  • Returns: a dict containing pairs of label and their values
  • Return type: dict
  • Raises: pyagrum.IndexError – If the type is not in the PRM
  • Parameters: type_name (str) – a type name
  • Returns: the list of type labels
  • Return type: list
  • Raises: pyagrum.IndexError – If the type is not in the PRM
  • Parameters: class_name (str) – a class name
  • Returns: the class extended by class_name
  • Return type: str
  • Raises: pyagrum.IndexError – If the class is not in the PRM
  • Parameters: interface_name (str) – an interface name
  • Returns: the interace extended by interface_name
  • Return type: str
  • Raises: pyagrum.IndexError – If the interface is not in the PRM
  • Parameters: type_name (str) – a type name
  • Returns: the type extended by type_name
  • Return type: str
  • Raises: pyagrum.IndexError – If the type is not in the PRM
  • Returns: the list of all the systems and their components
  • Return type: list

interAttributes(interface_name, allAttributes=False)

Section titled “interAttributes(interface_name, allAttributes=False)”
  • Parameters:
    • interface_name (str) – an interface
    • allAttributes (bool) – True if supertypes of a custom type should be indicated
  • Returns: the list of (,<attribute_name>) for the given interface
  • Return type: list
  • Raises: pyagrum.IndexError – If the type is not in the PRM
  • Parameters: interface_name (str) – an interface
  • Returns: the list of (<reference_type>,<reference_name>,) for the given interface
  • Return type: list
  • Raises: pyagrum.IndexError – If the type is not in the PRM
  • Returns: the list of interfaces in the PRM
  • Return type: list
  • Parameters:
    • class_name (str) – a class name
    • att_name (str) – the name of the attribute to be tested
  • Returns: True if att_name is an attribute of class_name
  • Return type: bool
  • Raises:
    • pyagrum.IndexError – If the class is not in the PRM
    • pyagrum.IndexError – If att_name is not an element of class_name
  • Parameters: name (str) – an element name
  • Returns: True if the parameter correspond to a class in the PRM
  • Return type: bool
  • Parameters: name (str) – an element name
  • Returns: True if the parameter correspond to an interface in the PRM
  • Return type: bool
  • Parameters: name (str) – an element name
  • Returns: True if the parameter correspond to a type in the PRM
  • Return type: bool

Load a PRM into the explorer.

  • Parameters:
    • filename (str) – the name of the o3prm file
    • classpath (str) – the classpath of the PRM
  • Raises: pyagrum.FatalError – If file not found
  • Return type: None
  • Returns: the list of the custom types in the PRM
  • Return type: list