A production problem
Uses again the model production.mod.
Consider again the production planning problem first presented in the section Tuples. The
model, production.mod, and the instance data, production.dat are
shown again in the following examples.
A
Production planning problem (production.mod)
{string} Products = ...;
{string} Resources = ...;
float Consumption[Products][Resources] = ...;
float Capacity[Resources] = ...;
float Demand[Products] = ...;
float InsideCost[Products] = ...;
float OutsideCost[Products] = ...;
dvar float+ Inside[Products];
dvar float+ Outside[Products];
minimize
sum( p in Products )
( InsideCost[p] * Inside[p] + OutsideCost[p] * Outside[p] );
subject to {
forall( r in Resources )
ctCapacity:
sum( p in Products )
Consumption[p][r] * Inside[p] <= Capacity[r];
forall(p in Products)
ctDemand:
Inside[p] + Outside[p] >= Demand[p];
}
Instance
data for the production-planning problem (production.dat)
Products = { "kluski", "capellini", "fettuccine" };
Resources = { "flour", "eggs" };
Consumption = [ [0.5, 0.2], [0.4, 0.4], [0.3, 0.6] ];
Capacity = [ 20, 40 ];
Demand = [ 100, 200, 300 ];
InsideCost = [ 0.6, 0.8, 0.3 ];
OutsideCost = [ 0.8, 0.9, 0.4 ];
The model aims at minimizing the production cost for a number of products while satisfying customer demand. Each product can be produced either inside the company or outside, at a higher cost. The inside production is constrained by the company's resources, while outside production is considered unlimited. The model first declares the products and the resources. The data consists of the description of the products, i.e., the demand, the inside and outside costs, and the resource consumption, and the capacity of the various resources. The variables for this problem are the inside and outside production for each product.
A solution to production.mod
For these statements, OPL returns the optimal solution
Final Solution with objective 372.0000:
inside = [40.0000 0.0000 0.0000];
outside = [60.0000 200.0000 300.0000];