gams-math - 是否可以直接在 GAMS 中求解双目标模型?
问题描述
有没有可以直接解决多目标模型的命令?我的意思是,不使用加权和或 epsilon 约束方法,我们可以解决游戏中的多目标模型吗?
非常感谢!
解决方案
这是 GAMS 中的 epsilon 约束模型,适用于求解双目标优化问题和寻找帕累托最优前沿。
$title Pareto optimal front determination
$onText
For more details please refer to Chapter 2 (Gcode2.16), of the following book:
Soroudi, Alireza. Power System Optimization Modeling in GAMS. Springer, 2017.
--------------------------------------------------------------------------------
Model type: NLP
--------------------------------------------------------------------------------
Contributed by
Dr. Alireza Soroudi
IEEE Senior Member
email: alireza.soroudi@gmail.com
We do request that publications derived from the use of the developed GAMS code
explicitly acknowledge that fact by citing
Soroudi, Alireza. Power System Optimization Modeling in GAMS. Springer, 2017.
DOI: doi.org/10.1007/978-3-319-62350-4
$offText
Variable of1, of2, x1, x2;
Equation eq1, eq2, eq3, eq4;
eq1.. 4*x1 - 0.5*sqr(x2) =e= of1;
eq2.. -sqr(x1) + 5*x2 =e= of2;
eq3.. 2*x1 + 3*x2 =l= 10;
eq4.. 2*x1 - x2 =g= 0;
x1.lo = 1; x1.up = 2;
x2.lo = 1; x2.up = 3;
Model pareto1 / all /;
Set counter / c1*c21 /;
Scalar E;
Parameter report(counter,*), ranges(*);
solve pareto1 using nlp maximizing of1;
ranges('OF1max') = of1.l;
ranges('OF2min') = of2.l;
solve pareto1 using nlp maximizing of2;
ranges('OF2max') = of2.l;
ranges('OF1min') = of1.l;
loop(counter,
E = (ranges('OF2max') - ranges('OF2min'))*(ord(counter) - 1)/(card(counter) - 1) + ranges('OF2min');
of2.lo = E;
solve pareto1 using nlp maximizing of1;
report(counter,'OF1') = of1.l;
report(counter,'OF2') = of2.l;
report(counter,'E') = E;
);
display report;
推荐阅读
- azure - Microsoft Graph API 获取来宾帐户查询错误
- python - 来自不同长度列表的数据框
- java - 如何使用 Java 使用 csv 文件导出大量数据(近 100 万条数据)
- android - 我可以从远程服务器运行“离子电容器运行 android”命令吗?
- dax - PowerBI - 使用 DAX 根据日期和时间维度计算每小时移动平均值
- swiftui - 为什么 .navigationTitle 接缝在设备上调试时抛出 UIViewAlertForUnsatisfiableConstraints 警告?
- python - 如何在python pyqt5上添加图像
- r - 从数据框列中提取数据框并将其放置在 R 中的父级之外
- azure-devops - Web 表单项目中的 Azure 管道构建错误
- python-3.x - 如何在不和谐中检查机器人的赞助订阅?