Originally posted by: SystemAdmin
Hi Philippe,
Regarding your first question, when I first tried to do clustering and thought of using a duple with an ID and one member of the cluster, I didn't want to use oppID (which is a triple) to input thousands of such tuples. But since it probably is more efficient internally, once I have everything correct in the updated model, you are correct in that I could reference it using the oppID.
I don't follow your second question: a cluster should contain the integer IDs of all real tasks in that cluster. Thus, given an oppID of <1,1,1>, assume it clusters tasks 4, 6, and 8 together. I assumed that meant I need to create an integer set called 'cluster' and make it a member of the OPP tuple or create a separate tuple called "Cluster" and make IT a member of the OPP tuple. I don't think I need a separate tuple so I'm assuming I should do:
{
int
} cluster
. The 'sorted' is not necessary though I had it in there to keep my input neat.
For the alternative constraint question, start with the model I use with no clusters. For real task 5, there may be 25 different OPPs (each with its own unique oppID). If real task 5 is not of type "PI", then exactly one OPP can be scheduled for it:
forall(i in realTasks) ctRealTaskOneLook:
//can't do the same underlying task twice except for PIs alternative(targets[i], all(t in allOpps: t.isPI == 0) routeLegOpps[t]);
where 'targets' is an array of optional interval variables over all realTasks.
If I now allow for clusters, I have to find all OPPs that don't contain tasks of type PI, and I have to look through each OPP's cluster of real tasks to create an alternative constraint accomplishing the same as the above constraint. This is what I don't know how to do using this
{
int
} cluster
idea.
Using my only successful modeling of the clustering idea (however inefficient), where I use the tuple Cluster {
int cInd;
int rInd;
}
construct, this enabled me to use the 'alternative' constraint that you question below. Your understanding of what I'm trying to do is correct, but I do not understand how a boolean in the oppID would work. Wouldn't I need an array of booleans in every single oppID tuple to know which tasks it contains and which it doesn't? or wouldn't I need an array of arrays for the realtasks, where for each realTask, I store an array of the oppIDs that contain it?
Again, maybe these are ignorant questions, but all direction is appreciated... thanks.
#DecisionOptimization#OPLusingCPOptimizer