I am defining one LP and the details are as follows:
from docplex.mp.model import Model
import numpy as np
import sys
#-------------------------------------#
## Parameters Details
tech_coeff=np.array([[1, 1, 1, 1, 1],[0.4, 0.4, 0.4, -0.6, -0.6],[0.5, 0.5, -0.5, 0, 0],[0.06, 0.03, -0.01, 0.01, -0.02]])
rhs_coeff=np.array([12, 0, 0, 0])
cost_coeff=np.array([0.026, 0.0509, 0.0864, 0.06875, 0.078])
## Creating Model
mod1=Model(name='my first model')
## Defining variables
x={i:mod1.continuous_var(name='x_{}'.format(i+1)) for i in range(5)}
x_vars_scope=[]
for i in x:
x_vars_scope.append(x[i])
x_vars=np.array(x_vars_scope)
## Adding constraints
for i in range(len(tech_coeff)):
mod1.add_constraint(tech_coeff[i].dot(x_vars.transpose())<= rhs_coeff[i],ctname='constraint_number_{}'.format(i+1))
## Objective function
objective=cost_coeff.dot(x_vars.transpose())
mod1.maximize(objective)
## Solving the model
mod1.solve()
mod1.print_solution()
I want to get the RHS (numeric value) of each constraint.
I request to the community please help me in this regard.
Thanks,
Samiullah