Include comments on procedures and data nature and sources

Top  Previous  Next

Procedures for documentation and clarity may also be employed in setting up the model and the data therein.  Questions I ask when looking at a set of model data are:

Why was a constraint set up in the way it is implemented?
What are the units on the variables and equations?
Where did the data come from?
What are the characteristics of the data such as units, and year of applicability?

Such questions often apply to segments of GAMS code.  Frequently it's nice to add in descriptions identifying assumptions, intent of equation terms, data sources including document name, page number, table number, year of applicability, units, URL etc.  You can do this with comments  (* in column 1) statements, $Ontext $Offtext sequences or inline comments as illustrated in commentdol.gms or as discussed in the Including Comments chapter as follows

 

* this is a one line comment that could describe data

$Ontext

My data would be described in this multiline comment

This is the second line

$Offtext

*I could tell what the equation below is doing

x = sum(I,z(i)) ; # this is an end of line comment 

x = sum(I,z(i)) ; { this is an inline comment } r=sum(I,z(i)) ;

 

Note inline comments must be enabled with the commands $inlinecom or $eolcom as in the following two statements

 

$eolcom #

$inlinecom {}