mmxprs
Topics covered in this chapter:
- New functionality for the Mosel language
- Control parameters
- Procedures and functions
- Cut Pool Manager
The mmxprs module provides access to FICO® Xpress Optimizer from within a Mosel model and as such it requires the Xpress Optimizer library (XPRS) to be installed on the system. To use this module, the following line must be included in the header of the Mosel model file:
uses 'mmxprs'
A large number of optimization-related routines are provided, ranging from those for finding a solution to the problem, to those for setting callbacks and cut manager functions. Whilst a description of their usage is provided in this manual, further details relating to the usage of these may be found by consulting the Xpress Optimizer Reference Manual.
New functionality for the Mosel language
The problem type mpproblem.xprs
This module exposes its functionality through an extension to the mpproblem problem type. As a consequence, all routines presented here are executed in the context of the current problem. In particular, the setting of a control parameter is applied only to the current problem and each problem has its own set of settings and solution information. However, when a new problem instance is created, the value of the control parameters XPRS_colorder, XPRS_enummaxsol, XPRS_enumduplpol, XPRS_enumsols, XPRS_loadnames, XPRS_usechecktime and XPRS_verbose are initialised with the settings of the main problem.
The type basis
The module mmxprs defines the type basis to represent solution basis in the Mosel Language. This new type is used to store a basis computed by the optimizer during its solution process (savebasis). A basis can then be loaded again into the optimiser with loadbasis, inspected (by getting the basis status of each variable/constraint it includes with getbstat) or modified (by changing this basis status using setbstat). The type basis supports assignment and test of equality. This comparison only checks whether two basis contain the same information, it does not indicate whether the basis are equivalent.
The type mpsol
The type mpsol characterises a solution of an MP problem by associating a value to each decision variable (type mpvar) of the problem. Initialising such an object can be achieved by saving the current solution found by the optimiser (savesol or savemipsol) or by building it one variable at a time (setsol). Various routines requiring solution information support the solution object. For instance getsol may be used to evaluate an expression on a specific solution; loadmipsol and addmipsol accept this object as input. A solution might be saved into a file using writesol and the resulting file can be loaded into the optimiser with readsol. The type mpsol supports assignment and test of equality.
The type boolvar
An entity of type boolvar is a pseudo boolean decision variable. This type supports operators and, or and not for building logical expressions and can be combined with ordinary Boolean variables. A logical constraint is specified either by associating a pseudo boolean variable to a logical expression using the following syntax:
boolvar = logical_expression
or by forcing the truth value (i.e. true or false) of an expression as follows:
logical_expression = boolean
When a logical expression is used on its own as a statement it is implicitly turned into a constraint (forced to true) and added to the constraint store.
Each boolvar is represented in the MIP problem by two binary variables (mpvar): one for the value itself and another one for its negation. These decision variables can be accessed from the model using the function getvar such that they can be used in linear constraints. The solution value of a boolvar is of type boolean and can be obtained using getsol.
The type logctr
The type logctr represents either a logical expression over pseudo boolean decision variables (boolvar) or an indicator constraint (see indicator). Logical expressions can be built using standard operators (and, or, not). These logical constructs are handled like linear constraints: they are associated to the current problem, can be (re)defined via assignments and hidden using sethidden. Note however that logical constructs are not shown by exportprob although the mmxprs routine writeprob will report them.
The type objconfig
The type objconfig represents an objective configuration for use in multi-objective optimization.
An objconfig can be constructed from a priority (integer, objectives with higher priorities are solved before objectives with lower priorities), a weight (real, the weight of the objective when blending it with other objectives with the same priority), an absolute tolerance (real, the absolute tolerance used when fixing the objective to its optimal value) and a relative tolerance (real, the relative tolerance used when fixing the objective to its optimal value). It is possible to provide only a priority and a weight, for instance the following code sample creates objective configurations for a lexicographic solve; weights are used to set the sense of each objective:
objconfs := [objconfig(3, 1), objconfig(2, -1), objconfig(1, 1)]]]
Alternatively an entity of this type can be constructed by specifying one of the above attributes by its name (i.e. "priority", "weight", "abstol" or "reltol") and its associated value. Using the statement below will create objective configurations for a blended solve (only weights are defined):
objconfs := [objconfig("weight", 0.3), objconfig("weight", 0.2), objconfig("weight", 0.5)]]]
Properties of a configuration can be changed using setpriority, setweight, setabstol and setreltol.
See the Xpress Optimizer Reference Manual for more information about multi-objective optimization.
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.