|
Omitted Set elements - error D Domain errors |
Top Previous Next |
|
One can forget to include elements in set declarations. In turn, when these elements are referenced then an error arises (i.e., an error would occur if the element maketable was omitted from the declaration of set PROCESS but used when data were defined under the PARAMETER PRICE(PROCESS)) and subsequent sets. GAMS identifies such errors with message $170. The example shorterr06.gms provides a case where the element maketable is omitted from the set PROCESS.
6 SET PROCESS PRODUCTION PROCESSES /makechair,makelamp/ 7 RESOURCE RESOURCES /plantcap capacity ,salecontrct contract/; 8 PARAMETER PRICE(PROCESS) PRODUCT PRICES BY PROCESS 9 /makechair 6.5 ,maketable 3, makelamp 0.5/ **** $170 10 Yield(PROCESS) yields per unit of the process 11 /Makechair 2 ,maketable 6 ,makelamp 3/ **** $170 12 PRODCOST(PROCESS) COST BY PROCESS 13 /Makechair 10 ,maketable 6, Makelamp 1/ **** $170 14 RESORAVAIL(RESOURCE) RESOURCE AVAILABLITY 15 /plantcap 10 ,salecontrct 3/; 16 TABLE RESOURUSE(RESOURCE,PROCESS) RESOURCE USAGE 17 Makechair Maketable Makelamp **** $170 18 plantcap 3 2 1.1 19 salecontrct 1 -1;
Error Messages 170 Domain violation for element |