import xpress as xp
p = xp.problem()
p.setControl({'miprelstop': 1e-5, 'feastol': 1e-4})
p.setControl('miprelstop', 1e-5)
print(p.getControl('miprelstop') ) # print the current value of miprelstop
print(p.getControl('maxtime', 'feastol')) # print a dictionary with the current
# value of miprelstop and feastol
print(p.getControl(['presolve', 'miplog'])) # Same output
print(p.getControl()) # print a dictionary with ALL control
# Initialize a dictionary with two controls and their value. Then
# change their value conditionally and set their new (possibly
# changed) value.
myctrl = p.getControl(['miprelstop', 'feastol'])
if (myctrl['miprelstop'] <= 1e-4):
myctrl['miprelstop'] = 1e-3
myctrl['feastol'] = 1e-3
else:
myctrl['feastol'] = 1e-4
p.setControl(myctrl)