|
Domain checking |
Top Previous Next |
|
The GAMS compiler conducts 'domain checking,' with respect to subset definition and set element usage. Domain checking verifies that each element defined in a subset is in fact a member of the superset. It also insures that each referenced element of a set in GAMS calculations or other equations is in fact a member of the set associated with the definition of that location in parameters, variables, sets etc. When the items are not in the domain of the referenced set GAMS issues a compilation error and points to the missing element. Examples: In the following case, the elements in bold and blue would pass the domain check, but the elements in bold and red would stimulate compiler errors because Baltimore is not an element of the set places and seatle is a misspelling.
Set places list of locations /boston,Miami,seattle/; Set place(places) /boston,Miami,seatle,Baltimore/; Parameter dataitem(places) / boston 5,Miami 8,seatle 4,Baltimore 3/; Notes:
|