Comparison of GAMS versus AMPL Algebraic Modelling Languages

杀马特。学长 韩版系。学妹 提交于 2019-12-03 11:03:16

In terms of functionality they are pretty much the same allowing to express most types of optimization problems. Personally, I prefer AMPL because it has intuitive and expressive syntax and it is very well documented in the book. Another important advantage of AMPL is that despite the fact that it is commercial you can avoid the vendor lock-in because there is an open source alternative - GNU MathProg. GAMS on the other hand used to have a more advanced IDE than those that existed for AMPL although it changed with the introduction of the new AMPL IDE.

You can find an example of the same transportation problem from George Dantzig formulated in AMPL and GAMS in their Wikipedia articles: AMPL and GAMS.

Vladimir

This blog has the following to say:

Both systems are very good in what they are doing and widely used, so you cannot really go wrong with either choice. I would probably suggest to add extra points for the modeling system that is used by your colleagues and collaborators. That makes exchanging models and data easier and also is easier when discussing problems, tricks, issues etc.

Bob Fourer (AMPL) answered:

It's hard to find someone who can give equally expert advice on two competing systems, as once you become familiar with one of them you don't usually have much incentive to keep learning about the other. But here are a few comments from my hardly unbiased view.

AMPL was designed with the idea of being much closer to mathematical notation and generally much more natural to use than GAMS, and it's superior on that score. A GAMS model typically relies on more special conventions and reformulations than its AMPL counterpart; a case in point is the often extensive use of the GAMS $ operator to impose various conditions. Also, the IDE notwithstanding, GAMS is fundamentally more of a batch system whereas AMPL offers a more flexible option of interactively exploring models and results. Finally while in certain areas GAMS is established through long use, still I see modelers in these areas choosing AMPL, particularly when they are undertaking new projects that do not depend on existing GAMS models.

In my opinion AMPL and GAMS are closer in practice than suggested here (e.g. where you use $ in GAMS, one would use : in AMPL). I actually slightly prefer the GAMS syntax when doing real work, as it is a little bit more compact and it is obvious where a summation ends (in AMPL this is based on operator priority, in GAMS a sum is visually bracketed by parentheses).

In my opinion, all syntax considerations are really a matter of taste; both AMPL and GAMS languages are easy to learn and offer arguably the same scope in terms of the types of models that can be considered.

At the moment of writing this post, GAMS offers a larger number of solvers. That being said, AMPL's list of solvers is not a subset of the list of GAMS solvers. For a specific application, I suggest benchmarking solvers before buying either AMPL or GAMS (for example, via the NEOS server for optimization).

Personally, I prefer the syntax of AMPL since it is closer to mathematical notation. However, I prefer GAMS for industrial applications mainly because of solver availability and because it is embedded/proven in many industries. This often simplifies dialogue with an industrial partner/client who already uses GAMS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!