Originally posted by: katherine_707
Hi,
I am trying to solve a scheduling problem by splitting it into small horizons and I'm having a hard time moving from the first planning period to the next one. Basically I just don't want jobs that were already assigned to be assigned again. Jobs are selected to be scheduled based on some priority. I tried 2 different approaches and none of them is working properly.
In one of them I tried setting the upper bounds of the decision variables x (that assign jobs to machines) and I am getting the error: "OPL cannot extract expression: x#0#1" even though the first index describing jobs starts from 1 (not zero). No line is highlighted but the line where I set the upper bound of the x's to zero seems to be causing the error. I used the statement:
thisOplModel.x[j][m].UB = 0;
In the other approach I tried creating an array to keep track of the assignments. Suppose job 1 is assigned to machine 3. I was trying to store in a dynamic array the values 1 and 3, then continue adding rows for other assigned jobs. The idea was to use the array in a constraint, such as assign jobs that are not in the array of assigned jobs. Even though I declared the assignments array in the .mod it was saying it could not be found when I tried to assign values to it in the script. I did not initialize the array in the .dat file because I wanted it to start empty and have information added to it as jobs are assigned.
Does anyone know which approach seems better for this rolling horizon problem and how to correct the errors? Any help is appreciated.
Thanks!
#CPLEXOptimizers#DecisionOptimization