Originally posted by: GGR
Hi
Modeling in constraint programming needs to use Cp Optimizer language algebra and in particular the global constraints and other algebraic facilities. I suppose you have access to the documentation. You may have access to the concepts page in the user manual.
To do this it would be preferable to have a "textual" description of your problem
Reading your model , it looks like to a an allocation problem mix . I suspect you may need a distribute constraint (count expression) (const. 5) and all different constraints (const. 6) (note I may be wrong)
I will try to express the model from my understanding (sorry if I eventually mistaken). For sake of simplicity I suppose facility location j is j.
//I,J,K are integer that index demands, location and drone from 1 to max. take value 0 if demands or drone and unassigned. table w is modified accordingly w[0] = 0
int var F_d[I in 1...I] in 0 ...J; //Demand I facility are Integer Variable in 1...V
int var K_d[I in 1...I] in 0...K // Demand i Drone
int var F[k in 1...k] in 0...J // Drone facility
maximize sum (I in 1...I) w[F_d] // element expression
//const 1 useless (variable domain)
//const. 2 the number of facilities located to be less than or equal to p
sum(j in J) ( count(all (I in 1...I), j) = 0) >= J-p ;// at most p used (count > 0)
//const. 3 battery range constraints on all the drones
forall(j in 1...J)
sum(I in 1.. I) b_j[F_d] <= B*sum (k in 1..K) ( F[k] > 0) ; \\ b_j energy used by a demand at location j (null for location 0)
//const. 4 the demand served by each located facility to be less than or equal to the capacity of the facility
forall(j in 1..J)
sum(i in 1..I) w_i[j]*(F_d[I] == j) <= U;
//const. 5 Vehicle are assigned only to located facilites
forall(k in1..K, I in 1..I)
(K_d[i] == k) == (F[k] == F_d[I]);
/const. 6 useless
Hope that helps
#DecisionOptimization#OPLusingCPOptimizer