User Tools

Site Tools


gams:different_variable_types_within_one_definition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
gams:different_variable_types_within_one_definition [2020/05/26 12:14]
Lutz Westermann
gams:different_variable_types_within_one_definition [2020/05/26 12:19] (current)
Lutz Westermann link to docu; remove reference to very old gams version
Line 16: Line 16:
 // //
  
-Starting with Distribution 22.1 this can be achieved using the priority ​ attribute. The priority attribute of a discrete variable can be used to relax a specific variable instance. The priority attribute ''​.prior''​ establishes in what order variables are to be fixed to integral values while searching for a solution. Variables with a specific ''​.prior''​ value will remain relaxed until all variables with a lower ''​.prio''​values have been fixed. Setting the .prior value to +inf will relax this variable permanently. This relaxation is done independent of the model attribute ''​.prioropt''​.+This can be achieved using the [[https://​www.gams.com/​latest/​docs/​UG_Variables.html#​UG_Variables_VariableAttributes|priority attribute]]. The priority attribute of a discrete variable can be used to relax a specific variable instance. The priority attribute ''​.prior''​ establishes in what order variables are to be fixed to integral values while searching for a solution. Variables with a specific ''​.prior''​ value will remain relaxed until all variables with a lower ''​.prio''​ values have been fixed. ​**Setting the .prior value to +inf will relax this variable permanently.** This relaxation is done independent of the model attribute ''​.prioropt''​.
  
  
-This feature is useful in solving difficult discrete models. The Model Library model "​Linear Recursive Sequence Optimization Model" (''​lrs.gms''​) illustrates the use of this feature that specifies that only the first n variables of k are binary, whereas the remaining ones are fractional. Find below a simple example:+This feature is useful in solving difficult discrete models. The Model Library model "​Linear Recursive Sequence Optimization Model" ([[https://​www.gams.com/​latest/​gamslib_ml/​libhtml/​gamslib_lrs.html|lrs.gms]]) illustrates the use of this feature that specifies that only the first n variables of k are binary, whereas the remaining ones are fractional. Find below a simple example:
 <​code>​ <​code>​
 Set a       '​all variables'​ /a1*a5/ Set a       '​all variables'​ /a1*a5/
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/different_variable_types_within_one_definition.txt ยท Last modified: 2020/05/26 12:19 by Lutz Westermann