Controls
Use problem.setControl to set the value of one or more controls. Its synopsis is as follows:
setControl(ctrl, value) setControl({ctrl1: value1, ctrl2: value2, ..., ctrlk: valuek})
The first form is for setting the value of the control ctrl to value. The second form is for setting ctrl1 to value1, ctrl2 to value2, ..., and ctrlk to valuek.
A list of all controls can be found on the Xpress Optimizer's reference manual. The control parameters to be passed in setControl are lower-case strings:
p.setControl('miprelstop', 1e-9) p.setControl({'miprelstop': 1e-3, 'feastol': 1e-6})
Use the method getControl to retrieve the value of one or more controls. Its synopsis is one of the following:
getControl(ctrl) getControl([ctrl1, ctrl2, ..., ctrlk]) getControl(ctrl1, ctrl2, ..., ctrlk) getControl()
The first form is for obtaining the value of the control ctrl. The output will be the value of the control. The second and third forms are for retrieving ctrl1 , ctrl2 , ..., and ctrlk. Whether the controls are declared in a list or a tuple does not matter. The result will be a dictionary coupling each control with its value. The last form is to obtain all controls; the result is a dictionary coupling all controls with their respective value.
The control parameters to be passed in getControl are lower-case strings. For a problem p the call will be as follows:
mrs = p.getControl('miprelstop') someattr = p.getControl('miprelstop', 'feastol')