Originally posted by: appleme
Hi,all
{string} Process = ...;
tuple JUP
{
string p;
string u;
} ;
{JUP} jup=...;
tuple ShiftC
{
string p;
int index;
int count;
int startT;
int endT;
};
{ShiftC} shiftCon=...;
dvar interval jup1[o in jup];
cumulFunction f[p in Process] = sum(o in jup:o.bo.p==p) stepAtStart(jup1[o],1)-sum(o in jup:o.bo.p==p) stepAtEnd(jup1[o],1);
forall(p in Process:p)
forall(shift in shiftCon:shift.p==p)
{
alwaysIn(f[p],shift.startT ,shift.endT, 0, shift.count);
}
I found It run very slower if I use cumulFunction and alwaysIn,Is there a faster method?
Or I want to add a prior condition before "alwaysIn(f[p],shift.startT ,shift.endT, 0, shift.count)"
tuple ConC
{
string p;
int index;
string u;
};
{ConC} conCon=...;
dvar int+ zz[conCon] in 0..1;
forall(o in jup:o.bo.p==p,con in conCon:con.p==p&&con.index==shift.index&&con.u==o.u) ((startOf(jup1[o])>=shift.startT&&startOf(jup1[o])<=shift.endT && sizeOf(jup1[o])!=0)|| (endOf(jup1[o])>=shift.startT&&endOf(jup1[o])<=shift.endT && sizeOf(jup1[o])!=0)) => (zz[con] == 1);
count(all(con in conCon:con.p==p&&con.index==shift.index) zz[con], 1)>shift.count=>alwaysIn(f[p],shift.startT ,shift.endT, 0, shift.count);
,But it does not work.
How could I do?
waiting for your help! thanks
#DecisionOptimization#OPLusingCPOptimizer