Skip to content

Latest commit

 

History

History
141 lines (97 loc) · 4.9 KB

README_pypi.md

File metadata and controls

141 lines (97 loc) · 4.9 KB

Self-configurable Manufacturing Industrial Agent: SMIA

Docker badge GitHub release (latest SemVer) Codacy Badge Documentation Status

SMIA Logo

The Self-configurable Manufacturing Industrial Agent (SMIA) is a proposal for the implementation of the concept of the I4.0 Component from the Reference Architectural Model Industrie 4.0 (RAMI 4.0) as an AAS-compliant agent-based Digital Twin (DT). The features of the SMIA approach include:

  • free & open-source
  • AAS-compliant: standardized approach
  • Ontology-based
  • easily customizable and configurable
  • self-configuration at software startup
  • easy to usage
  • containerized solution

💡 TIP: For more details on Self-configurable Manufacturing Industrial Agent (SMIA) see the 📄 full documentation.

Usage

IMPORTANT: At the moment there is no final version available for the SMIA. The project is currently under development. Therefore, SMIA is not a ready-to-use implementation. New features and bug fixes will be uploaded during development.

Multiple ways of running SMIA software are available. The associated GitHub repository shows how to run the base SMIA software.

In this case, how to use the SMIA Python package is shown.

Installation

The SMIA approach can be easily installed using pip:

pip install smia

Available facilities

The SMIA approach offers different facilities for its use:

  • smia.launchers: Some launchers to run the base SMIA software.
  • smia.agents: The Agent classes available to be instantiated and used.
  • smia.assetconnection: Tools related to connection with assets.

Examples

Create and run an SMIAAgent:

import smia
from smia.agents.smia_agent import SMIAAgent

smia.load_aas_model('<path to the AASX package containing the AAS model>')
my_agent = SMIAAgent()

smia.run(my_agent)

Extensibility examples

Create an ExtensibleSMIAAgent:

import smia
from smia.agents.extensible_smia_agent import ExtensibleSMIAAgent

smia.load_aas_model('<path to the AASX package containing the AAS model>')
my_agent = ExtensibleSMIAAgent()

Add new Agent Capability to ExtensibleSMIAAgent:

import spade
from smia.agents.extensible_smia_agent import ExtensibleSMIAAgent  # Import from the SMIA package

new_capability = spade.behaviour
my_extensible_agent.add_new_agent_capability(new_capability)

Add new Agent Service to ExtensibleSMIAAgent:

from smia.agents.extensible_smia_agent import ExtensibleSMIAAgent  # Import from the SMIA package

my_extensible_agent.add_new_agent_service(new_service_method)

Complete example of an Extensible SMIA agent:

import smia
import asyncio
from spade.behaviour import CyclicBehaviour
from smia.agents.extensible_smia_agent import ExtensibleSMIAAgent  # Import from the SMIA package

class MyBehaviour(CyclicBehaviour):
    async def on_start(self):
        print("MyBehaviour started")
        self.iteration = 0

    async def run(self):
        print("MyBehaviour is in iteration {}.".format(self.iteration))
        self.iteration += 1
        await asyncio.sleep(2)

def new_service_method():
    print("This is a new service to be added to SMIA.")
    
def main():
    my_extensible_agent = ExtensibleSMIAAgent()
    smia.load_aas_model('<path to the AAS model>')
    
    my_extensible_agent.add_new_agent_capability(MyBehaviour)
    my_extensible_agent.add_new_agent_service(new_service_method)
    
    smia.run(my_extensible_agent)

if __name__ == '__main__':
    main()

Dependencies

The SMIA software requires the following Python packages to be installed to run correctly. These dependencies are listed in pyproject.toml so that they are automatically obtained when installing with pip:

  • spade (MIT license)
  • basyx-python-sdk (MIT license)
  • owlready2 (GNU LGPL licence v3)

License

GNU General Public License v3.0. See LICENSE for more information.