Originally posted by: Yusuf_OR
Hi,
I just realized that OPL had not written values of a decision variable to Excel sheet correctly. Indexes are not ordered from smallest to largest and some of them are repeated. Here are a couple of lines (sorted before posted):
|
Index
|
Value
|
|
5684
|
7
|
|
5684
|
34
|
|
5685
|
2
|
|
5686
|
5
|
|
5686
|
6
|
|
5687
|
2
|
|
5687
|
2
|
|
5688
|
2
|
|
5688
|
2
|
|
5688
|
6
|
|
5691
|
1
|
|
5691
|
1
|
|
5691
|
1
|
|
5692
|
1
|
|
5692
|
1
|
|
5692
|
1
|
|
5693
|
1
|
|
5693
|
1
|
|
5693
|
1
|
|
5694
|
1
|
|
5694
|
1
|
|
5694
|
1
|
The OPL script to get these values are as follows:
tuple FLYNUMBER {
int r;
int flyTimesV;
};
setof(FLYNUMBER) f = { <r,flyTimes[r]> | r in route: flyTimes[r]>0};
int sizeFlyTimes = card(f) + 1;
string array1;
I need to get this array in a correct way because I use this solution array as an input for further steps in my own program.
What the problem could be and how can I fix it?
Thanks in advance!
Yusuf
#DecisionOptimization#OPLusingCPLEXOptimizer