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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In Declaring a tuple using a set of keys (nurses.mod), a shift is uniquely identified by thedepartment name, the date, and start and end times, all defined as key fields.Initializing tuplesYou initialize tuples by giving the list of the values of the various fields, as in:Point p = ;which initializes p.x to 2 and p.y to 3. See Initializing tuples for details.Limitations on tuplesWhen using tuples in your models, you should be aware of various limitations.Data types in tuplesNot all types are allowed inside tuples. Limitations regarding types in tuples lists allowed andillegal types.Limitations regarding types in tuplesAllowedPrimitives (int, float, string)Tuples (also known as subtuples)Arrays with primitive items (not string), that is: integer or floatarraysSets with primitive items, that is: integer, float or string setsTuple indices and tuple patternsNot AllowedSets of tuples (instances of IloTupleSet)Arrays of strings, tuples, and tuple setsMultidimensional arraysYou cannot mix tuple indexes and patterns within the declaration and the use of decisionexpressions. For example, these code lines raise the following error message Data notconsistent for "xxx": can not mix pattern and index betweendeclaration of dexpr and instantiation.Do not mix tuple indices and tuple patterns in dexprdexpr float y[i in t] = ...;subject to {forall( in t) y[]==...; };dexpr float y[ in t] = ...;subject to {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 L29

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

Saved successfully!

Ooh no, something went wrong!