-
Notifications
You must be signed in to change notification settings - Fork 6
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
@system: error handling for variable names #155
Conversation
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 agree that @system(w' = Aw + Bu)
working automatically would be preferred, but that is more complicated. This PR is an improvement already.
Sorry, i don't understand the purpose of this change and the purpose of this item list, |
Yes, that is what I said above, but that is more complicated. The current macro (in
Right, and this PR prints an error message instead of doing something unexpected. I find that better than the version in |
The purpose is to prevent the user from doing things that could have arbitrary behaviour such as having both input and noise defined as
I think we should have these checks, it improves the quality, but we could do them more intelligent. # we do not check for identical variable names
@system(w'=Aw+Bx)
# we do check for identical variable names because the user changed the bindings
@system(x'=Ax+Bw, input:w) |
Ok, thanks. I guess what you are saying is to verify if the default_state_var = :x
default_input_var = :u
default_noise_var = :w
state_var = nothing
input_var = nothing
noise_var = nothing
...
# if state_var == nothing then it hasn't been set
# do consistency checks
state_var = state_var == nothing ? default_state_var
... |
I will close this PR, since it is replaced by #164 |
Complete an element of checklist in #133.
I am not sure about this point on the checklist. It helps for error handling in general, but in some cases, e.g. if you want to name your state
u
orw
it would make the macro more verbose (see tests).