ClothCo is capable of manufacturing three types of clothing: shirts, shorts, and pants. Each type of clothing requires that ClothCo have the appropriate type of machine available. The machines can be rented at a fixed weekly cost. The manufacture of each type of clothing also requires some amount of cloth and labor, and returns some profit, indicated below. Each week, 150 hours of labor and 160 sq yd of cloth are available. How should ClothCo tune its production to maximize profits? Note: If we don't produce a particular item, we can save on the rental cost!
|Clothing item||Labor per item||Cloth per item||Profit per item||Machine rental|
using JuMP, Cbc m = Model(solver = CbcSolver()) @variable(m, x[1:3] >= 0) @variable(m, z[1:3], Bin) @constraint(m, 3x + 2x + 6x <= 150) # labor budget @constraint(m, 4x + 3x + 4x <= 160) # cloth budget @constraint(m, x .<= 50*z) # if x>0 then z=1 @objective(m, Max, 6x + 4x + 7x - 200z - 150z - 100z) solve(m) xopt = getvalue(x) println(xopt, " shirts") println(xopt, " shorts") println(xopt, " pants" ) println() println("\$", getobjectivevalue(m), " of net profit")
0.0 shirts 0.0 shorts 25.0 pants $75.0 of net profit