Hello,
I have written a cplex model to do scheduling optimization. But it seems not possible to export the results of the interval variables - the copy paste method was not working ( I could not select multiple rows in the Tabular Grid.) The excel export is not working because my version is only 12.10.
So I resort to doopl in python. Could you please help me on how to write the code to generate the tables in cplex ? so that i can use opl.get_table() in python ?
My codes look like the following:
using CP;
tuple Workcenter {string name; int cap;}
tuple Alt {string po; string wc;}
{Workcenter} WCs = ...;
{string} PONames = ...;
{Alt} Alts = ...;
int Duration [t in PONames] = ...;
tuple Precedence {
string pre;
string post;
};
{Precedence} Precedences = ...;
int ReleaseDate[t in PONames] = ...;
int DueDate [t in PONames] = ...;
float Weight [t in PONames] = ...;
//Create the production order interval variables
dvar interval itvs[t in PONames] size Duration[t];
//Create the alternative resource, i.e., workcenter interval variables
dvar interval alt[a in Alts] optional;
minimize max(t in PONames)
(Weight[t] * maxl(0, endOf(itvs[t])-DueDate[t]) + lengthOf(itvs[t]) );
subject to {
//Add the precendence constraints
forall(p in Precedences)
endBeforeStart(itvs[p.pre], itvs[p.post]);
//start after the release date
forall(t in PONames)
ReleaseDate[t] <= startOf(itvs[t]);
}
Thanks!
------------------------------
Quan Long
------------------------------
#DecisionOptimization