1
votes

I am building a model that requires me to factor in the capacity of various vessels and I am not sure how to declare this in ampl.

Currently, I have:

Cap1: forall {i in I, t in T} x[1,i] * people[1,t] <= 500;

where I is the set of routes and T is the set of trips taken by the vessel. x[a,i] is an indicator variable which =1 when vessel a travels route i and people[a,t] is the amount of people taken on vessel a on trip t.

ampl always throws up the following error with respect to this constraint:

logical constraint _slogcon[1] is not an indicator constraint.

How can I fix this?

1

1 Answers

1
votes

The syntax in AMPL is different than CPLEX. When you want to declare a "forall" you do this:

subject to constraint{index in set}: content of constraint

So, in your case that would be:

subject to Cap1{i in I, t in T}: x[1,i] * people[1,t] <= 500;

Regards!