Hello,
I have a scheduling model and i have no way to export the decision variables (I cannot select all and copy paste in excel). My version 12.10.0.0 so I am not able to export the results in excel. In this connection, I am trying to use doopl for the purpose of extracting the results. But I am not sure how to convert the interval variables to a table, so that i can use get_table() in the doopl. Could anybody help me with several lines of code ?
The extraction of my mod file is 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;
////Create the sequence variables
//dvar sequence wcs[w in WCs] in
//all(t in PONames: WCs[t]==w) itvs[t] ;
execute {
cp.param.FailLimit = 10000;
}
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]);
//Add the capacity constraints
forall(w in WCs)
sum(a in Alts: a.wc == w.name) pulse(alt[a],1) <= w.cap;
//alternative constraints
forall(t in PONames)
alternative(itvs[t], all(a in Alts: a.po==t) alt[a]);
}
------------------------------
Quan Long
------------------------------
#DecisionOptimization