prod.mod#
Warning
The original AMPL book does not reflect many of the latest features available in AMPL. For example, it doesn’t cover our new high-level modeling constructs that are automatically reformulated.
set P;
param a {j in P};
param b;
param c {j in P};
param u {j in P};
var X {j in P};
maximize Total_Profit: sum {j in P} c[j] * X[j];
subject to Time: sum {j in P} (1/a[j]) * X[j] <= b;
subject to Limit {j in P}: 0 <= X[j] <= u[j];