Coder Social home page Coder Social logo

fahaxikiii / 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 42.5 MB

Tool that allows Functional Mock-up Units (FMUs) to be accessed through language independent RPC calls by wrapping the original FMU into a new one with network capabilities.

License: MIT License

Java 0.28% Kotlin 93.35% Thrift 6.36%

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 FMUs across languages and platforms.

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.


fmu-proxify

fmu-proxify is a CLI that transforms a co-simulation FMU compatible with either version FMI 1.0 or 2.0 into a proxified version of the same FMU. Internally, the proxy FMU wraps the original FMU in a server program. Each new instance of the original FMU runs in a separate process.

This allows you to:

  • Import FMI 1.0 models in software that otherwise only supports FMI 2.0.
  • Instantiate multiple instances of FMUs that only allows one instance per process.
  • The ability to run the FMU on some remote resource
    • Which in turn allows FMUs to run on otherwise unsupported platforms.
Usage: fmu-proxify [-h] [-d=<destFile>] [-r=<remoteAddress>] FMU-FILE
      FMU-FILE            Path to the FMU to proxify.
  -d, --dest=<destFile>   Where to save the FMU (defaults to current folder).
  -h, --help              Print this message and quits.
  -r, --remote=<remoteAddress>
                          Optional host to connect to. e.g. 127.0.0.1:9090

By default, the generated FMU seemingly behaves like a regular FMU. However, internally the FMU is communicating with the original FMU over TCP/IP. When targeting localhost, this all happens automatically.

To install the necessary tools, run ./gradlew build. The CLI tool is then located under fmu-proxify/build/install
Likewise, the booter executable needed to spawn processes on a different computer when not targeting localhost is located under fmu-proxy-booter/build/install

Running the FMU on another computer

  1. The target computer needs to start fmu-proxy-booter
    ./fmu-proxy-booter <port>

  2. Generate the FMU with the option --remote <hostname:port>
    (or modify proxySettings.txt inside an existing FMU)

  3. Load the FMU as usual.

Environment setup

FMU-proxy relies on Java and thus requires a suitable environment to run.

Windows
  1. JAVA_HOME should point to a JDK8+ installation.
  2. %JAVA_HOME%\jre\bin\server must be added to PATH.
Linux

On linux things should just work after installing the JDK.

Publications


Want to import FMUs in C++? Check out FMI4cpp
Want to develop or import FMUs in Java? Check out FMI4j
Want to develop FMUs in Python? Check out PythonFMU
Need a complete co-simulation framework with SSP support? Check out Vico

fmu-proxy's People

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.