Reset all manually set options

  • 24 October 2022
  • 4 replies


In our project we set options manually. For example, we have lines of code like ‘option CPLEX_22_1.integrality := 1e-05;’. For a specific case that we have, we would like set all these options to their default values and run the case again. What procedure can we use for this?

Two things we tried that did not work:

  • We cannot just remove all lines of code where we manually set options, since the case that we have problems with has been run before; hence, the default options in this case have already been overridden.
  • We also tried using the procedure ‘OptionGetValue’ to get the default value and set every option to its default value, but this does not work for the majority of our options. For example, when applying our procedure to the option ‘Advanced_Start’ we get the error ‘Option not found, or not a numeric option’. Another example is the option ‘CPLEX_22_1.integrality’; in that case we get the error ‘The option “CPLEX_22_1.integrality” has not been found’.

Thank you!



Best answer by Marcel Hunting 26 October 2022, 13:40

View original

4 replies

Userlevel 5
Badge +7



Assuming that most options are set in a few specific procedures, how about the following approach:


Separate the procedure to solve into a procedure that does not contain option settings, and name it: pr_solveWithoutAnySpecificOptionSettings;


Based on this procedure, you can create two procedures as follows:

block where
CPLEX_22_1.integrality := 0,
CPLEX_22_1.feasibility := 1e-06,

endblock ;

block ! Using default option settings
endblock ;


Does this approach help?


Perhaps interesting is the how-to:


With kind regards,




Thank you for your quick response!

Unfortunately this would be quite cumbersome for us.

  • Options are not set in one but in multiple procedures.
  • Your approach requires us to set the default value manually. However it is quite cumbersome to find out what the default value is.

Is there any other way to automatically reset all settings? We would expect this to be a natural use case.


Userlevel 5
Badge +6

How about opening a new project, exporting its empty settings and importing to your project? It is not ideal, but it might work. 

Userlevel 5
Badge +4

You can use the following procedure to reset all options for a certain solver:

Procedure ResetSolverOptions {
Arguments: SolverName;
Body: {
SolverString := SolverName + '::';

for ( IndexOptions | FindString(IndexOptions,SolverString) ) do
res := OptionGetDefaultString( IndexOptions, defkey );
if ( res ) then ! Keyword option
res := OptionGetString( IndexOptions, curkey );
if ( res and ( defkey <> curkey ) ) then
OptionSetString( IndexOptions, defkey );
else ! Numerical option
res := OptionGetValue( IndexOptions, low, cur, def, upp );
if ( res and ( def <> cur ) ) then
OptionSetValue( IndexOptions, def );
StringParameter SolverName {
Property: Input;
StringParameter SolverString;
Parameter low;
Parameter upp;
Parameter cur;
Parameter def;
StringParameter curkey;
StringParameter defkey;
Parameter res;

I have attached a small example project in which several CPLEX 22.1 options have been set to a non-default value. After calling ResetSolverOptions(‘CPLEX 22.1’) all these options are reset to their default.


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator