Skip to content
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

[MINOR] Unclear return argument success from optimizerFORCES #14

Open
AndreasHempel opened this issue Jan 3, 2017 · 1 comment
Open

Comments

@AndreasHempel
Copy link
Contributor

The documentation for optimizerFORCES shows a second return argument success which is not used consistently throughout. Some problems are handled by throwing an error(...) (which leaves success unset), others use disp to show a message and set success = 0.

Since success is initialized as 1 I suspect potential for misreporting success, e.g. in cases where no error is thrown but success is not re-set or if it is set multiple times.

Due to the high complexity in optimizerFORCES I find it preferable to throw an error as soon as a game-breaking issue occurs, e.g. a model incompatible with FORCES Pro. success should exactly mirror the return argument of generateCode in FORCES Pro.

@GianUlli
Copy link
Contributor

GianUlli commented Jan 3, 2017

What you described is already implemented. success is the result of combining all of the success outputs of the internal solvers (combined using logical AND). However, if one of the internal solvers couldn't be generated, an error is thrown by optimizerFORCES. disp was only used for the case that the user decided to cancel code generation after being asked about binary variables. I fixed that with commit b70630f. Instead of using disp to display the error message and returning an empty object, an actual error is thrown.

So, now, if optimizerFORCES returns a object (hence no error was thrown), success is always 1. It could be removed as output argument because it doesn't help the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants