Dash Optimization - Leading Optimization Software

AMPL2MOS 0.0.5 readme

Most declarations are translated except: Compound sets are not fully supported (in particular those of which the contents is computed). Indexed sets are not supported. Most function names are not translated: if a function does not exist in Mosel, a correspondence has to be provided by the user (for instance replace 'tan' by 'sin/cos'). Default values are ignored (keyword 'default'). Ordered sets have no counterpart in Mosel (except if the set is a range).

Note also that:

There is no attempt to preserve spacing and structure of the original source although most comments are copied. A successful translation does not guarantee a valid and correctly working Mosel model. The translator performs a syntactic conversion and modeling techniques suitable for AMPL may be inappropriate for Mosel. As a consequence, the generated model may require reformulation to offer the same efficiency as the original model. The generated model does not contain any reference to the solver or matrix exportation call: these commands have to be added afterwards. (The sense of the optimization for objective functions is indicated in a comment).


ampl2mos [ampl_source [ampl_data]]
Note that the data (either included in the model file or provided as a separate file) are required to produce the corresponding 'initialisations' sections in the generated model. The result is saved in a model file and its data file.If no filename is provided, the program uses its standard input as the source to be translated and sends the result to its standard output stream. A result file is produced even if errors are detected during the parsing. Statements or expressions that have caused error messages will usually not appear at all in the translated model.Known problems in the translation and ways of solving them:


Composite conditions, such as a x b.

How to solve:

Break them down in two (or more) conditions, appropriately.


Variables declared without an explicit type in the AMPL model may be declared with an incorrect type in the generated model.

How to solve:

Declare explicitly the type.

param T 0;

Mosel generated code:
T: real;

If T must be an integer, one should use:

param T 0 integer;

Mosel generated code:
T: integer;


Boolean variables in AMPL are coded as 0-1 values and can be used in numerical expressions. Mosel provided a proper Boolean type that cannot be used as a numerical value.

How to solve:

One has to redefine them (either in the AMPL or the generated Mosel code) as integer and adapt the code appropriately when using them in logical statements.

[Home] [Contact] [Client Area] [Search] [Sitemap] [Links] [Printer Friendly]
© 2004 Dash Optimization

[Client Area]
Welcome Yuji Tsuchiya
Your account expires on
30th Oct 2007
How do I renew access?
Related Topics
Xpress-Optimizer beta downloads
Xpress-Mosel beta downloads
Xpress-BCL beta downloads
Xpress-IVE beta downloads
Xpress-SLP beta downloads
Xpress-SP beta downloads
Xpress-CP beta downloads

About us Products Services Users Client Area Site What is optimization? Xpress Suite Overview Xpress-Optimizer (LP/MIP/QP solver) Xpress-Mosel (modeling environment) Xpress-BCL (model building library) Xpress-IVE (development environment) Xpress-SLP (non-linear solver) Xpress-SP (stochastic programming) Xpress-Kalis (constraint programming) Xpress-Application Developer (GUI creation) Evaluation Ordering/Quote Supported Platforms Interfaces/APIs Development Examples Repository

SSL GMOグローバルサインのサイトシール