|
Set definition through Tables |
Top Previous Next |
|
One can define set elements for sets that have 2 or more dimensions through tables. This is done using a set then a table command or a set table command where the table entries are numerical or yes/no. Examples: The following four definitions all have the same effect (sets.gms)
set Linkedbyroad2(origins,destinations) Places linked by roadways /"NEW York" .Portland, "New York" .Houston, boston.portland, boston.Houston/;
set Table Linkedbyroad3(origins,destinations) Places linked by roadways Portland London Houston "NEW York" yes yes boston yes No yes;
set Linkedbyroad4(origins,destinations) Places linked by roadways; Table Linkedbyroad4(origins,destinations) Places linked by roadways Portland London Houston "NEW York" yes yes boston yes No yes;
set Table Linkedbyroad5(origins,destinations) Places linked by roadways Portland London Houston "NEW York" 3209 1429 boston 3180 0 1520; Notes: One can
|