Multiple solve management - merge replace

Top  Previous  Next

When multiple solves are present one needs to pay attention to the way that GAMS manages solutions.  In particular, when multiple models are solved GAMS by default merges subsequent solutions in with prior solution.  This is not an issue if all the models operate over the same set of variables.  However, if different variables appear in the solved models (due to recursive procedures, different equation inclusion or $ conditionals that can eliminate variables) then one should be aware that GAMS permits the user to modify the solution management procedure.  This attribute tells GAMS how to manage the model solution when only part of the variables are in a particular problem being solved.  In particular, the solution can either be merged with the prior solution for all variables or it can replace "All" old values associated with a the variables and equations in the model just solved being reset to default values before new solution values are brought in.  Note clear is a new option introduced to remedy the problems discussed in wontgo.pdf.  This is controlled using the model attribute solveopt

 

Transport.solveopt =0; (activates solution replace option)

Modelname.solveopt =1; (activates solution merge option -- the default)

Modelname.solveopt =2; (activates solution clear option)

 

or the option command

option solveopt = replace;

option solveopt = merge; (default)

option solveopt = clear;

 

The values do the following

replace (0) causes the solution information for all equations appearing in the model to be completely replaced by the new model results. Variables are only replaced if they appear in the final model.
merge (1) causes the solution information for all equations and variable to be merged into the existing solution information. This is the default.
clear (2) causes the solution information for all equations appearing in the model to be completely replaced; in addition, variables appearing in the symbolic equations but removed by conditionals to be removed (set to zero).

 

as discussed in the Option Command and Model Attributes chapters.