-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - add some boolean indicators for OCP #153
Conversation
I am OK but don't forget to not use the fields but use calls to function. |
Sure, there are actually no fields for the booleans, only the functions :D |
@PierreMartinon second thoughts: if they are more or less already present in |
Exactly ! It just happens that most did not seem to exist in CTBase already, unless I missed them, which is possible. Tell me if you spot redundant ones in what I added
|
@ocots @jbcaillau On a side note, are you ok with the convention to set variable_dimension to 0 for variable-independent problems ? It would simplify things a bit for me. |
Yes |
@PierreMartinon seems to be still WIP, so I have updated the title |
And while I'm on CTBase, do we agree to rename OCPInit to OptimalControlInit ? |
Ok, I think we can merge @ocots @jbcaillau :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment about consistency.
src/model.jl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering about consistency since it seems that the fields containing infos about dimensions and so the getters will return the right values only after the function constraint
has been called once. We may add a function to set the dimensions and set them when:
- a getter is called if it was not set
- a constraint is added
- a constraint is removed
- ...
But I am not sure that this is the right thing to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PierreMartinon I think you haven't reply to this comment. I think it is quite important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocots Indeed I missed it. More precisely, the constraints dimensions are set in nlp_constraints since this is where the different kinds of constraints are parsed.
Ideally, the various dimensions would be updated at each constraint! call, but I don't think it's worth the effort. These are pretty internal parameters, and are supposed to be called only after the ocp is fully defined.
Maybe change the default value to -1 instead of 0 to make it more obvious ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: erf, -1 is not compatible with Dimension type. Just let it be ? If you prefer I will revert to dimensions internal to CTDirect
src/init.jl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace OCPInit
by OptimalControlInit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done :D
[NB. The PR is not ready yet!]
Hi @ocots, @jbcaillau
I started to add a few boolean indicators for the OCP, that I originally introduced in the DOCP struct. You can find them in Model.jl
I started with
I also have a bunch of indicators and dimensions for the different kinds of constraints, that I think belong to CTBase as well. Any comments before I add them ?