Why should I use system.empty in a set

Problems with syntax of GAMS
Post Reply
User avatar
Renger
Posts: 639
Joined: 7 years ago

Why should I use system.empty in a set

Post by Renger »

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
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Lutz
User
User
Posts: 59
Joined: 7 years ago

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

Post by Lutz »

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