Comments (6)
I again totally agree, these global counters have been a handicap that is getting only worse also for developing the code, since things start probably only depending on it more and more..
Since I had the issue myself once, I can propose a quick fix if you are interested:
you can reset the counters at the end of your 'code generation code' which turns it into something more or less modular.. ;-)
But in any case, I believe it would be worth it to spend the effort getting rid of these global counters if possible ! What does the rest think?
Maybe it is also better to assign these issues to a certain milestone..
from acado.
This is an inherent property of AD within ACADO -- I am referring to the static variables. I agree this is not the smartest way to deal with enumerating expressions, and whoever is willing to work on AD within ACADO is welcome.
From what @ghorn says it looks to me that there is an elegant workaround in python.
Bindings are the separate issue, not related to the aforementioned issue. What I would like to see is SWIG in ACADO, something maintainable.
Those can be set as a task for a milestone, and I would close this issue.
from acado.
I don't fully understand what you changed the name of this issue to. Are DifferentialState / Control / etc. incrementing static counters? Or is this only internal to AD?
from acado.
@ghorn You can study the class inheritance tree starting from Expression
class if you want to understand this matter. Those classes hold static counters. Function
like classes use those enumerations.
from acado.
Hey Rien, can you give me a little code example which shows how to reset the counters?
from acado.
sure, it looks like this depending on which ones you want to reset:
Control dummy1; dummy1.clearStaticCounters();
DifferentialState dummy2; dummy2.clearStaticCounters();
Parameter dummy3; dummy3.clearStaticCounters();
IntermediateState dummy4; dummy4.clearStaticCounters();
...
from acado.
Related Issues (20)
- S-Function through legacy Code Generation in Matlab
- When will there be a stable version?
- error: no rule to make target 'qpdunes/src/utils.o', needed by 'libacado_exported_rti.a'
- Timed solver interruption
- Autogenerated MPC Code segfaults in acado_feedbackStep( ) on large OCP definitions HOT 1
- Problem with IntermediateStates
- Slicing Matrices and Vectors in ACADO matrix class
- Installation in Mac OS HOT 2
- Inquires on ACADO with MATLAB and SIMULINK for the single-precision microcontroller
- MPC with on/off value HOT 1
- unable to interface with MATLAB HOT 2
- Setting LSQ reference in ACADO code, getting error
- what is the status of acado tookit?
- Trouble getting started HOT 1
- Constraint violation with Time-Scaled model
- how to improve the accuracy of the generated NMPC solver
- Unable to understand 'Shifting' and 'initialization' option in ACADO MPC simulink interface
- can you anybody explain what is online data ? HOT 1
- Code generation template path stays persistent between builds
- mpc.exportCode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acado.