subject to Time {t in 1..T}:
avail[t] > 0 ==> sum {p in PROD} (1/rate[p]) * Make[p] <= avail;If avail[t] and cost[t] are variables then you need to reformulate using additional binary (zero-one) variables to put the constraint into a form that standard solvers will accept. To start you can define
var za {1..T} binary;
...
subject to zadef {t in 1..T}: za[t] = 0 ==> avail[t] = 0;
Then avail[t] > 0 will imply za[t] = 1. The same can be done for binary variables zc[t] associated with cost[t]. Next you can define binary variables z[t] constrained by
subject to zdef {t in 1..T}: z[t] = 0 ==> za[t] + zc[t] <= 1;
Then za[t] = zc[t] = 1 will imply z[t] = 1. Finally you can have "z[t] = 1 ==> (your constraint);". Because these constraints are all of the form "binary-var = 0 ==> linear-constraint" or "binary-var = 1 ==> linear-constraint" they are in the form of "indicator" constraints accepted by CPLEX or Gurobi (vers 7.0). For other solvers these constraints can be reformulated to linear constraints by using well-known tricks; there are some examples in the Integer Programming chapter of the AMPL book (http://ampl.com/BOOK/CHAPTERS/23-integer.pdf).
Bob Fourer
am...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.