0

I have this constraint:

B #> P1*V1 + P2*V2 + P3*V3+ P4*V4 + P5*V5 + P6*V6 +P7*V7 + P8*V8 + P9*V9 + P10*V10

with P=[1,2,3,4,5,6,7,8,9,10] and V=[V1,V2,V3,....], V::0..1

I want implement this constraint in dynamic way with N elements (cardinality of P and V will be N).

If I implement this with a cycle I have problem of instantiation because V is not yet labeled at this point of code.


Solved

I've resolved the question using scalar product B #> P*V implemented directly in CLP.

Community
  • 1
  • 1

1 Answers1

0

that's an instance of 'scalar product', in ECLiPSe you can find it in Eplex Instances. But I don't understand your problem, V will be labelled when you instruct the system to do, isn't this true ? Then you can post your expressions as usual.

CapelliC
  • 59,646
  • 5
  • 47
  • 90
  • Now I have this constraint (scalar product of P and V must be less then B) with cardinality 10 and it work, but I want realize this constraint in dynamic way with N elements. P is labeled, V is not labelled, and will be labelled after the declaration of this constraint. – Luigi Louis Sassano Apr 29 '13 at 07:52