fml40 reference implementation basic functions
Project description
ForestML 4.0 (fml40) reference implementation - Python
Overview
ForestML 4.0 (fml40) reference implementation provides Software Development Kit (SDK) to build a Digital Twin based on the Forest Modeling Language 4.0 (fml40), as specified in the fml40 white paper (Only in German).
Additionally, the SDK supports the use of Smart Systems Service Infrastructure (S³I) to enable an inter-twin interconnection with other Digital Twins, making data and service identifiable, available, and accessible.
The developed Digital Twin using this SDK is technically structured as below:
- An entry contains all ForestML 4.0 conform models (incl. services, properties and events), which are stored under the ml folder and can be serialized as JSON
- A function mapper that maps user-defined methods to concretize ForestML 4.0 service functions.
- A value synchronization module that collects the value (e.g., sensor data) from physical assets to Digital Twins and maps to ForestML 4.0 properties.
- A connector to establish an connection with the S³I.
Docs
A documentation, which introduces basic classes and methods of this SDK, can be found under this link.
Getting Started
Installation
The use the ForestML 4.0 (fml40) reference implementation requires an installation of the SDK on your local device. Currently, the SDK is available via Pypi:
python -m pip install fml40-reference-implementation
Example - Quickly develop a Digital Twin of Harvester (DT Harvester)
Here, we provide a brief guide on how to develop a DT Harvester, which consists of a location property, a property representing operation hours, and a service for accepting felling orders. All these features can be modeled using ForestML 4.0.
Step 1: Serialize JSON file
The model of Harvester (and also its Digital Twin) can be serialized as JSON, as shown below:
{
"thingId": "",
"policyId": "",
"attributes": {
"class": "ml40::Thing",
"name": "Demo Harvester",
"features": [
{
"class": "fml40::AcceptsFellingJobs"
},
{
"class": "ml40::OperatingHours",
"total": 0
},
{
"class": "ml40::Location",
"longitude": 0,
"latitude": 0,
"orientation": 0
}
]
}
}
Step 2: Registration
Identity ensures global identification of DT Harvester and is necessary for connecting to the S³I. The S³I Manager is a web-based service supporting configuration of identities which can be assigned to users and their Digital Twin. Using the S³I manager, identities can be created, which is required to log in the S³I Manager. After logging in, Thing identity can be registered by clicking Create Thing. The returned identifier and secret should be kept locally. Afterwards, a message queue and a cloud copy should be created to DT Harvester under Create, such that DT Harvester is reachable via the S³I Broker and the current state of DT Harvester can be stored in the S³I Repository.
Step 3: Runs demo_harvester.py
The from Step 2 obtained identifier and secret used to launch demo_harvester.py
python demo_harvester.py -i OAUTH2_ID -s OAUTH2_SECRET
Step 4: Check the state update
To verify whether DT Harvester is currently running, one can use Explore in the S³I Manager to check the current state of DT Harvester. There, the continuous changes in operation hours will be shown.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fml40_reference_implementation-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fml40_reference_implementation-1.0.0-py3-none-any.whl
- Upload date:
- Size: 227.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80869f5b77a2018485976a7660bd11f3284d7017ff8ed9fcedc2fe1b3fd0b841
|
|
| MD5 |
72b8c2a6b335be437c33e495b681d143
|
|
| BLAKE2b-256 |
df4b137eb9407481daead625a84a76020152fd096b95e418b48e2db9bf323b86
|