Giter Site home page Giter Site logo

Comments (8)

mvukov avatar mvukov commented on July 28, 2024

This has to be discussed first. I feel that this might be app specific -- test and initialization.

I am more in favor to provide a few examples how this can be done, so that users have a good starting point.

from acado.

mvukov avatar mvukov commented on July 28, 2024

@ferreau, what is your opinion on this?

from acado.

ferreau avatar ferreau commented on July 28, 2024

I suggest the following:

  1. Still, I think there needs to be an auto-generated basic initialisation for all variables (eg. x,u,p to zero, Q=Id, R=Id and so forth). Of course, a user needs to adapt this for each application, but it makes the code more fool-proof.

  2. I have implemented a reset() function on my local copy (but I think it does not really make sense if I merge it back to the current version on the web). This hard-codes an initialization for all above-mentioned variables based on user-defined values. These values are passed to the MPCExport class before exporting the code.

from acado.

mvukov avatar mvukov commented on July 28, 2024

Default initialization in some cases (in fact a lot of them) leads to erratic behavior of a solver, e.g. to produce NaNs. Some users immediately think "solver made an error", instead to look and think about initialization. Thus, I am not in favor to generate test file in a new version of the codegen (which is on the way) any more, but to provide a set of well documented examples. Users should really think about how to initialize a solver. Furthermore, up to my knowledge, nobody inside our group is using auto-generated test files any more -- just to be sure: @rienq can give us an update on this if he thinks different.

However, if somebody wants to implement this functionality in a fool-proof way, I will not obstruct it. I just think that is not a path to go.

from acado.

rienq avatar rienq commented on July 28, 2024

I agree with Milan actually, although generating a test file without initializing any of the ACADO variables is not the answer. Because users would still not get a (compilation) error or anything, the solver would just give back NaNs and the "solver made an error" remark remains.

I feel like auto generated test files are still very useful, because (as a new user) you at least get a code structure where you can start from. If you then provide trivial initializations of all the variables, it would at least be clear they have to modify these to get the correct behaviour from the solver. This could also be stressed in the form of code comments for example.

from acado.

mvukov avatar mvukov commented on July 28, 2024

I agree with the second paragraph. We can export a template, i.e. well documented example, and force the user to modify it.

from acado.

ferreau avatar ferreau commented on July 28, 2024

I am typically exporting a test file once for a project and then keep editing myself. However, if test file generation would be more flexible I would even prefer to generate it afresh each time. Moreover, leaving the test file generation away does not really help as exporting a Matlab or Simulink interface is basically the same a generating a test file.

However, I very much like the idea of forcing the user to provide a meaningful initialization. One way could be generate a test file that does not compile if no initilization is provided when exporting the code. However, this needs to be documented very well as not compiling examples naturally raises questions.

In any case, I am happy to help with making the test file generation more fool-proof.

from acado.

mvukov avatar mvukov commented on July 28, 2024

I provided a dummy test file in the pre120branch. You can take a look at it, or wait until I merge it to the master, which should happen soon. Anyways, it is not so smart, I put some comments in there, but it should be possibly improved.

from acado.

Related Issues (20)

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.