12.07.2015 Views

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Data and decision variable identifiersSince data and decision variable identifiers are the basic components of expressions, we willreview briefly here how they are used to build expressions. If r is a tuple with a fieldcapacity of type T, then r.capacity is an expression of type T. If a is an n-dimensionalarray of type T, a[e 1 ]...[e n] is an expression of type T, provided that e i is well-typed.For instance, the excerptint limit[routes] = ...;dvar int transp[r in routes] in 0..limit[r];contains an expression limit[r] of type integer. Indices of arrays can be complexexpressions. For instance, the excerptint nbFlights = ...;range Flight = 1..nbFlights;{string} Employee = ...;dvar int crew[Flight][Employee] in 0..1;constraints {}forall(e in Employee)forall(i in 1..nbFlights - 2)crew[i][e] + crew[i+1][e] + crew[i+2][e] >= 1;contains an integer expression crew[i+1][e] whose first index is itself an integerexpression.I L O G O P L D E V E L O P M E N T S T U D I O L A N G U A G ER E F E R E N C E M A N U A L91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!