Question: from scipy.optimize import linprog # Coefficients of the objective function for each goal ( negated because linprog minimizes ) c = [ 1 , 2
from scipy.optimize import linprog
# Coefficients of the objective function for each goal negated because linprog minimizes
c # Priorities for the three goals
# Coefficients of the constraints
# Labor hours constraint
Aeq # Coefficients of T R U
beq # Righthand side of the constraint
# Material supply constraints
Aub # Coefficients of T R U for plastic
# Coefficients of T R U for rubber
# Coefficients of T R U for metal
bub # Righthand side of the constraints
# Budget constraint
cbudget # Cost of producing one tank, truck, and turtle respectively
Abudget cbudget
bbudget
# Labor hour utilization constraint
Alabor # Coefficients of T R U
blabor # Total available labor hours
# Bounds for each variable
bounds None None None # Nonnegative constraints for T R U
# Solve the linear program
result linprogc AeqAeq beqbeq AubAub bubbub boundsbounds, method'highs'
# Print the results
printOptimal number of tanks to produce:", roundresultx
printOptimal number of trucks to produce:", roundresultx
printOptimal number of turtles to produce:", roundresultx
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
