Initializing help system before first use

Modules

The distribution of Mosel contains several modules that add extra functionality to the language.

A full list of the functionality of a module can be obtained by using Mosel's exam command, for instance

mosel exam mmsystem

In this manual, we always use Xpress Optimizer as solver. Access to the corresponding optimization functions is provided by the module mmxprs.

In the mmxprs module are the following useful functions.

  • Optimize: minimize, maximize
  • MIP directives: setmipdir, clearmipdir
  • Handling bases: savebasis,
  • loadbasis, delbasis
  • Force problem loading: loadprob
  • Accessing problem status: getprobstat
  • Deal with bounds: setlb, setub, getlb,
  • getub
  • Model cut functions: setmodcut, clearmodcut

For example, here is a nice habit to get into when solving a problem with Xpress Optimizer.

declarations
  status:array({XPRS_OPT,XPRS_UNF,XPRS_INF,XPRS_UNB,XPRS_OTH}) of string
end-declarations

status::([XPRS_OPT,XPRS_UNF,XPRS_INF,XPRS_UNB,XPRS_OTH])[
          "Optimum found","Unfinished","Infeasible","Unbounded","Failed"]
...
minimize(Obj)
writeln(status(getprobstat))

In the mmsystem module are various useful functions provided by the underlying operating system and a few programming utilities :

  • Delete a file/directory: fdelete, removedir
  • Copy/move a file: fcopy, fmove
  • Make a directory: makedir
  • Current working directory: getcwd
  • Get/set an environment variable's value: getenv, setenv
  • File and system status: getfstat, getsysstat
  • General system call: system
  • Time and date: gettime, getdate, getweekday, getasnumber, ...
  • Handling the type text: copytext, cuttext, deltext, readtextline, ...
  • Sort an array of any type with 'order' property: qsort

Other modules mentioned in this manual are mmodbc, mmsheet, mmetc, and mmjobs.

See the module documentation in the Mosel Language Reference Manual or in the individual module reference manuals for full details.