Originally posted by: trxw
I have done some progress on this. However, I have a doubt:
- If I have an undefined number of intervals in a sequence, is there any way to do it? What I have done as a workaround is to defined a maximum number of intervals with an array. It works fine because with the use of precenceOf I am able to have all the intervals created consecutive and at the hightest positions in the array. So if the arra max is 10, the intervales created occupies 8, 9 and 10 positions for example. My problem now is that I don´t know how to access the first interval in the sequence (the last is always the max of the array). I need to know the lengthOf the first interval. With this
dvar interval RosterPeople[People][1..MaxNumbArray ] optional in 1..ShiftDuration+1 size 5..15;
FirstInterval[i in People] = MaxNumbArray +1-max(r in 1..MaxNumbArray ) (presenceOf(RosterPeople[i][r]) * (MaxNumbArray +1-r)))
I am able to know the interval number of the first one. Howeven if I tried to use this inside lengthOf(RosterPeople[i][FirstInterval[i]]), i get an error...
Any idea how to solve this?
Thanks
#DecisionOptimization#OPLusingCPLEXOptimizer