GAMS 与 AMPL 代数建模语言的比较

发布于 2024-08-18 21:42:09 字数 41 浏览 6 评论 0原文

我有兴趣了解 GAMS 和 AMPL 用户对这些语言的优缺点的意见。

I'd be interested in getting the opinion from users of GAMS and AMPL on what the strength and weaknesses of each these languages are.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鹿童谣 2024-08-25 21:42:09

就功能而言,它们几乎相同,可以表达大多数类型的优化问题。就我个人而言,我更喜欢 AMPL,因为它具有直观且富有表现力的语法,并且在书中有很好的记录< /a>. AMPL 的另一个重要优点是,尽管它是商业性的,但您可以避免供应商锁定,因为有一个开源替代方案 - GNU MathProg。另一方面,GAMS 过去拥有比 AMPL 更先进的 IDE,尽管它随着新的 AMPL IDE

您可以在 George Dantzig 的 Wikipedia 文章中找到使用 AMPL 和 GAMS 表述的相同交通问题的示例: AMPL< /a> 和GAMS

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.

但可醉心 2024-08-25 21:42:09

此博客有以下内容:

这两个系统都非常擅长它们正在做的事情并且被广泛使用,所以你不能
任何一个选择都会出错。我可能会建议添加额外的积分
用于您的同事和合作者使用的建模系统。那
使交换模型和数据更容易,并且在讨论时也更容易
问题、技巧、问题等

Bob Fourer (AMPL) 回答:

很难找到一个人能够对两个相互竞争的问题提供同样专业的建议
系统,因为一旦你熟悉了其中一个你通常不熟悉的系统
继续了解对方的动力很大。但这里有一些评论
从我几乎不公正的观点来看。

AMPL 的设计理念是更接近数学符号
一般来说,使用起来比 GAMS 更自然,而且它在这方面更胜一筹
分数。 GAMS 模型通常依赖于更特殊的约定和
比其 AMPL 对应物进行了重新配制;一个典型的例子是经常广泛
使用 GAMS $ 运算符来施加各种条件。另外,IDE
尽管如此,GAMS 从根本上来说更像是一个批处理系统,而 AMPL
提供了更灵活的交互式探索模型和结果的选项。
最后,虽然在某些领域 GAMS 是通过长期使用而建立的,但我仍然看到
这些领域的建模者选择 AMPL,特别是当他们正在进行
不依赖于现有 GAMS 模型的新项目。

我认为 AMPL 和 GAMS 在实践中比这里建议的更接近(例如
在 GAMS 中使用 $ 的地方,在 AMPL 中会使用 : )。我其实稍微更喜欢
在实际工作中使用 GAMS 语法,因为它更加紧凑,而且
求和结束的地方很明显(在 AMPL 中,这是基于运算符优先级的,
在 GAMS 中,总和在视觉上用括号括起来)。

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).

百变从容 2024-08-25 21:42:09

在我看来,所有语法考虑实际上都是品味问题; AMPL 和 GAMS 语言都很容易学习,并且在可以考虑的模型类型方面提供了相同的范围。

在撰写本文时,GAMS 提供了更多数量的求解器。话虽如此,AMPL 的求解器列表并不是 GAMS 求解器列表的子集。对于特定应用,我建议在购买 AMPL 或 GAMS 之前对求解器进行基准测试(例如,通过 NEOS 服务器进行优化)。

就我个人而言,我更喜欢 AMPL 的语法,因为它更接近数学符号。然而,我更喜欢将 GAMS 用于工业应用,主要是因为求解器的可用性以及它已在许多行业中嵌入/经过验证。这通常会简化与已经使用 GAMS 的工业合作伙伴/客户的对话。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文