Skip to main content

Automata Learning Routine for Auto-Twin

Description

Module developed within the Auto-Twin Horizon EU project perform an automata learning experiment with data extracted from a System Knowledge Graph (SKG), store the resulting model in the SKG, and create semantic links between the learned features and the existing nodes representing the system.

Authors:

Name E-mail address
Lestingi Livia livia.lestingi@polimi.it

Requirements

Dependencies are listed in the environment.yml file.

Module Structure

This module acts as an orchestrator of the following submodules:

  • lsha: Automata learning component, specifically implementing algorithm L*_SHA for Stochastic Hybrid Automata (SHA) learning;
  • skg_connector: Component performing queries on the SKG to extract data and store the newly created model;
  • sha2dt_semantic_mapper: Component identifying the semantic links between learned features and the existing representation of the System Under Learning (e.g., between an edge of the learned automaton and the sensor that triggers it).

Upon cloning the repository, run the following commands to initialize the submodules:

git submodule init	
git submodule update

Note that it is necessary to run git submodule update everytime submodules must synchronize with the corresponding repositories.

Configuration

The configuration file for the skg_connector module (config.ini), by default, is set up as follows:

  • instance: name of the .ini file containing the information necessary to connect to the SKG (mainly URI, user, and password). By default, this points to the local.ini file pointing to a local Neo4j instance with password 12345678. Should a connection to a connection to a differently parameterized instance be needed, a new file with the same structure as local.ini must be added to the same folder, and parameter instance accordingly.
  • schema.name: identifier of the use case targeted by the automata learning experiment. By default, this is set to legoFactory, but it can be changed to any value from the schema folder.

Note that the following must be added to your local PYTHONPATH environment variable:

How to use

The automata_learner script contains an example of a learning procedure for testing purposes:

  • function learn_automaton takes as input:
    • the pov, i.e., a string out of 'item', 'resource', 'plant';
    • the start date of the time window for events, e.g., '2023-11-04-13-0-0';
    • the end date of the time window for events, e.g., '2023-11-04-14-2-0';
    • The learned automaton will be saved in resources/learned_sha.
  • function delete_automaton deletes nodes representing the learned automaton from the SKG, if there already exists one with the same name;
  • function store_automaton stores the learned automaton into the SKG;
  • function write_semantic_links identifies and stores the semantic links between the learned automaton and existing SKG nodes.

Copyright © 2024 Livia Lestingi

Metadata

Release files for autotwin-autlib 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autotwin-autlib 0.1.6
File Size Uploaded
autotwin_autlib-0.1.6.tar.gz 135.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autotwin-autlib 0.1.6
File Interpreter ABI Platform
autotwin_autlib-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 330.8 kB

Release files / autotwin_autlib-0.1.6.tar.gz

Download URL autotwin_autlib-0.1.6.tar.gz
Size 135.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9d74e9ad5391b6d9bc947118e5af93f4b77fb54fc77d99a5d8e013b1ac8599f8
BLAKE2b-256 checksum
How to use checksums
027996821a1945b3d55af0c1cb3543ff68d18401e8e719f82a4cf8798db86f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / autotwin_autlib-0.1.6-py3-none-any.whl

Download URL autotwin_autlib-0.1.6-py3-none-any.whl
Size 195.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38c650493446c25cfdaa7baa7040a43c0a4099f2ed301812c048b7b3832d65ed
BLAKE2b-256 checksum
How to use checksums
4be4f10c26a6217330e2f868aaedeed80c76362062c61ff5fd3d58fab0194911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page