GithubHelp home page GithubHelp logo

mtiller / fmusdk Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 10.0 760 KB

This is an SDK (originally developed by QTronic) for testing the new Functional Mockup Interface developed by the Modelisar project.

C 100.00%

fmusdk's People

Contributors

dietmarw avatar mtiller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fmusdk's Issues

Value storage out of bounds for mixed variable types

Hi,
I've been fiddling with your lib to build an own co-simulation FMU, and I just realized that things get messy when mixing different kinds of variables in the same model.

A thing that I've assumed this far is that a value reference is unique throughout the model, no matter what type the variable it is referencing. (Correct me here if I'm wrong.)

That said, I think the in-memory storage mechanism for model variables needs to be modified.
Let's say I have 1 real and 1 integer to store. This is how the storage is allocated:

comp->r = calloc(NUMBER_OF_REALS,    sizeof(fmiReal));
comp->i = calloc(NUMBER_OF_INTEGERS, sizeof(fmiInteger));

...where each of those macros are defined to be 1.
I naturally pick the value references to 0 and 1 for my two variables. When trying to set the value of the variable with value reference = 1, I get "fmiSetInteger: Illegal value reference 1", This is because we can't store the integer at the second position in the allocated array of length 1:

comp->i[vr[i]] = value[i]; // vr[i] == 1

I find this inconsistent.

Thanks for all your great work.
Stefan

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.