Issue
If I have a variable like Y[i][j] and t[i][j] where i=1..20 (I), j=1..10 (J) and this constraint
forall (i in I)
forall (j in J)
t[i][j] <= Y[i][j]
Why in output if I go to see the constraint is of the type t#0#1 <= Y#0#1 when it really should be: t[1][1]<=Y[1][1] ? Thanks.
Solution
Because when you have arrays with many values , opl cplex will change the indexes in order to save memory but you can tell cplex not to do that by changing the setting
Let me quote documentation:
More about the “Big map naming threshold” option
The setting determines how the map name is printed, both on most screen outputs and in CPLEX exported files:
•If the map is considered big (by default, greater than or equal to 100), then numerical indices are used. For example, in the LP file exported from the nurses example:
id1985: costByDepartments#0 - 150 nurseAssignments#0#0
- 168 nurseAssignments#1#0 - 102 nurseAssignments#2#0 ...
•If the map is considered small (by default, smaller than 100), then the real index values are used:
id1985: costByDepartments("Emergency")
- 150 nurseAssignments({"Anne",11,1,25})({"Emergency","Monday",2,8,3,5})
- 168 nurseAssignments({"Bethanie",4,5,28})({"Emergency","Monday",2,8,3,5}) ...
This option is currently used to switch between short and full map item names, for example, the names of decision variables or submaps. Big maps have short names.
Suppose you want to change this threshold. You can write
execute
{
thisOplModel.settings.bigmapthreshold=1000000;
}
Answered By - Alex Fleischer Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.