subTasks := { t | Assign(t,f) }
only those tasks assigned to facility f (Assign(t,f) = 1 in the MIP master model) is defined in the single machine f problem.
Figure 1. OPL Studio code for the CP version of a minimum cost problem.
[declarations]
scheduleHorizon=max(j in J) task[j].d;
DiscreteResource facility[i in I](C[i]);
AlternativeResources facilitySet(facility);
Activity scheduleTask[j in J];
minimize
sum(j in J) cost[j]
subject to {
forall(j in J)
scheduleTask[j] requires(taskf[i,j].r) facilitySet;
forall(j in J)
forall(i in I)
activityHasSelectedResource(scheduleTask[j],facilitySet,facility[i])<=>scheduleTask[j].duration=taskf[i,j].p& cost[j]=taskf[i,j].F;
forall(j in J) {
scheduleTask[j].start>=task[j].r;
scheduleTask[j].end<=task[j].d;
};
};
search {
assignAlternatives;
setTimes;
};
Notes. Parameters rj , dj , pij , and Fij are represented by task[j].r, task[j].d,taskf[i,j].p, and taskf[i, j].F, respectively. The resource limit Ci is C[i]. Index set J is {1,...,n} and I is {1,...,m}
没有评论:
发表评论