Relative Content

Tag Archive for cplexopl

how to initialize a derived set that has fewer elements than the original set im OPL, CPLEX

tuple Combination_L { int labrooms; int instructors; int studentgroups; int labcourses; }; {Combination_L} L = …; tuple Combination_T { int days; int slots; }; {Combination_T} T = …; tuple Combination_L_T{ int labrooms; int days; int slots; int instructors; int studentgroups; int labcourses; }; {Combination_L_T} V_l; execute { for (var p in L){ for (var q […]

3-dimension Parameter in Cplex

I’ve got a model that I need to calculate the capacity of rooms (i) divided by the number of students in a student group (m). I use this value in my object function. I’m not sure how to code this parameter though. Do I use “execute”?
Also, the parameter H_jkl is used to show the instructor l’s mood during the time period (j k) (H = 1 “happy”, = 2 “okay”, = 3 “sonst”). There are five days, and each day has four time slots. That means there are twenty time periods in a week. So, I think H_jkl is a range of [timeperiod] and [1..d] (set of instructors). But this can’t show the index (j k). I think I need to use this “int timeperiod [1..b, 1..c] = [j: [k: (k + (j-1)*4)] | j in 1..b, k in 1..c]” to connect timeperiod and (j k), but I think it is wrong.
The object function is: minimize c_im * H_jkl * x_ijklmn