Why should I use system.empty in a set

Problems with syntax of GAMS
Post Reply
User avatar
Renger
Posts: 263
Joined: 2 years ago

Why should I use system.empty in a set

Post by Renger » 1 month ago

Hi

In the first example of the embedded code documentation, the following code is shown:

Code: Select all

Set cc      / "France - Paris", "France - Lille", "France - Toulouse" 
              "Spain - Madrid", "Spain - Cordoba", "Spain - Seville", "Spain - Bilbao" 
              "USA - Washington DC", "USA - Houston", "USA - New York", 
              "Germany - Berlin", "Germany - Munich", "Germany - Bonn" / 
    country / system.empty / 
    city    / system.empty / 
    mccCountry(cc,country), mccCity(cc,city); 
What is the reason for using /system.empty/ as it seems to work fine when I drop the /system.empty/:

Code: Select all

    country 
    city   
Cheers
Renger

Lutz
User
User
Posts: 26
Joined: 2 years ago

Re: Why should I use system.empty in a set

Post by Lutz » 1 month ago

Renger,

In general the system.empty is used to initialize an empty set and set its dimension (1 in this example) at the same time. But you are right, that it is actually not needed in this example.

Best regards,
Lutz

Post Reply