-
Notifications
You must be signed in to change notification settings - Fork 248
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
[OptApp] Adding combined response function #12432
[OptApp] Adding combined response function #12432
Conversation
I think it'd make sense if you gave these response functions the same treatment as expressions. I.e.: overload the operators of ResponseFunction to yield a compound one. |
I think that is an overkill for compound responses. Even for averaging out multiple responses, we need to be very careful about the weighting. Another reason is, having an output mechanism for elements of the compound response will be much difficult |
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.
@sunethwarna thanks for your work. In general, it does look great! I have only one worry, I have placed in the code.
response_params.ValidateAndAssignDefaults(default_settings["combining_responses"].values()[0]) | ||
self.list_of_responses.append( | ||
( | ||
self.optimization_problem.GetResponse(response_params["response_name"].GetString()), |
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.
How do you make sure that this response is called after other ones are already added to the optimization_problem?
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.
We cannot. Responses should be added in the order which they are used. It is the users responsibility.
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.
Then, add a descriptive error so that the user can understand why it doesn't work (if the response is not found in the optimization_problem object)
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.
done :)
…mbined_response_function
response_params.ValidateAndAssignDefaults(default_settings["combining_responses"].values()[0]) | ||
self.list_of_responses.append( | ||
( | ||
self.optimization_problem.GetResponse(response_params["response_name"].GetString()), |
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.
Then, add a descriptive error so that the user can understand why it doesn't work (if the response is not found in the optimization_problem object)
@Igarizza I have added a descriptive error. Could you check? |
📝 Description
This PR adds
CombinedResponseFunction
which can be used to combine responses in a recursive manner.🆕 Changelog
CombinedResponseFunction