Giter VIP home page Giter VIP logo

devotionzhu / fmu-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ntnu-ihb/fmu-proxy

0.0 0.0 0.0 24 MB

Framework that allows Functional Mock-up Units (FMUs) to be accessed through language independent RPC calls on any platform using gRPC or Apache Thrift

License: MIT License

Kotlin 41.57% HTML 0.64% Python 8.87% Batchfile 0.25% Thrift 2.14% Java 31.97% Shell 0.38% JavaScript 14.19%

fmu-proxy's Introduction

FMU-proxy (work in progress)

License: MIT contributions welcome

Join the chat at https://gitter.im/NTNU-IHB/FMU-proxy

CI

The main goal of the Functional Mock-up Interface (FMI) standard is to allow simulation models to be shared across tools. To accomplish this, FMI relies on a combination of XML-files and compiled C-code packaged in a zip archive. This archive is called a Functional Mock-up Unit (FMU) and uses the extension .fmu. In theory, an FMU can support multiple platforms, however this is not always the case and depends on the type of binaries the exporting tool was able to provide. Furthermore, a library providing FMI support may not be available in a particular language or platform, and/or it may not support the whole standard. Another issue is related to the protection of Intellectual Property (IP). While an FMU is free to only provide the C-code in its binary form, other resources shipped with the FMU may be unprotected.

In order to overcome these challenges, we present an open-source framework for working with functional mock-up units across languages and platforms. This is done by wrapping a set of FMUs inside a server program supporting multiple language independent Remote Procedure Calls (RPCs) and protocols over several network transports. Currently, Apache Thrift (HTTP, TCP/IP) and gRPC (HTTP/2) are supported.

Together, they allow FMUs to be invoked from virtually any language on any platform. As users don't have direct access to the FMU or the resources within it, IP is effectively protected.


FMU-proxy is a framework for accessing FMUs compatible with FMI for Co-simulation and Model Exchange 2.0 in a language and platform independent way. This is achieved using well established RPC technologies. Due to the technologies involved, clients and servers for FMU-proxy can be written in almost any language, on any platform!

A server implementation has been realized on the JVM, while client implementations exists for C++, JVM, Python and (browser) JavaScript. It's easy to add additional implementations, as the RPC frameworks will generate most of the code for you!

FMU-proxy is different from other frameworks for distributed FMU invocations such as DACCOSIM, FMI GO! and Coral in that it completely separates itself from the master algorithm (logically and physically). FMU-proxy is a completely standalone project which provides access to FMUs over the wire. And just that.

The idea is that other applications should use FMU-proxy whenever FMUs are required to run distributed, rather than having each application creating their own solution.


Publications

Implementation

Server

This repository comes bundled with a server implementation written in Kotlin (JVM).

The JVM implementation of FMU-proxy is written in Kotlin and uses the gradle build system.

It features a server implementation that supports Apache Thrift (HTTP/JSON, TCP/IP/binary) and gRPC (HTTP2) RPCs.

For interacting with the FMUs on the JVM, FMI4j is used.

FMU-proxy server executable commands
Usage: fmu-proxy [-h] 
                 [-grpc=<grpcPort>]
                 [-r=<remote>] [-thrift/http=<thriftHttpPort>]
                 [-thrift/tcp=<thriftTcpPort>] FMUs...
      FMUs...             FMU(s) to include.
      -grpc=<grpcPort>    Specify the gRPC port (enables this server).
  -h, --help              Print this message and quits.
      -thrift/http=<thriftHttpPort> Specify the Thrift http port (enables this server).
      -thrift/tcp=<thriftTcpPort> Specify the Thrift tcp port (enables this server).

You can now connect to the FMU in a language of your choosing using one of the schemas available from the web server or located here.

Clients

Clients have been implemented for all server end-points. A feature of the implemented clients is that they all implement the same interface. The interface is specified by FMI4j, allowing local and remote FMU instances to be used interchangeably in user code.

The available client implementations are given in the table below:

RPC JVM C++ Python Javascript
gRPC x x x
Thrift/TCP x x x
Thrift/HTTP x x x

NOTE: Thanks to the language independent nature of the RPC technologies and network protocols involved, servers and clients may be implemented in virtually any language with relative ease.

Python

This repository comes bundled with simple client implementations in Python for gRPC and Thrift.

JavaScript

A simple Thrift client running in the browser can be found here.


fmu-proxy's People

Contributors

markaren avatar gitter-badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.