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.

Initialization of decision variable arraysThe dynamic collection of decision variables allows you to dynamically initialize an array ofdecision variables. The variables are then shared between the two arrays of variables.Here is an example of what is possible:int n = 5;range R = 1..n;dvar int x[i in R] in R;dvar int y1 = x[1];dvar int y[R] = all[R](i in R) x[i];dvar int y2[i in R] = x[i];dvar int y3[R] = [ i:x[i] | i in R ];dvar int y4[R] = [ x[1], x[2], x[3], x[4], x[5] ]; dvar int y5[0..n-1] =append(all(i in R: i=2) i);88I 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 L

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

Saved successfully!

Ooh no, something went wrong!