OPL CPLEX语法问题与元组数组
这是.mod(模型文件)
tuple TDayPair{
string day1;
string day2;
}
{TDayPair} DAYS={<"Mon","Tue">,<"Thurs","Fri">};
int a[DAYS]= ...;
execute {
writeln(a[<"Mon","Tue">]); //<--it gives syntax error here
}
这是.dat(数据文件)
a = #[
<"Mon","Tue">:1,
<"Thurs","Fri">:2,
]#;
,它在writeln(a [&lt;“ mon”,“ tue”,“ tue”&gt;]);
>>> >>这里有什么问题?
This is .mod (model file)
tuple TDayPair{
string day1;
string day2;
}
{TDayPair} DAYS={<"Mon","Tue">,<"Thurs","Fri">};
int a[DAYS]= ...;
execute {
writeln(a[<"Mon","Tue">]); //<--it gives syntax error here
}
This is .dat (data file)
a = #[
<"Mon","Tue">:1,
<"Thurs","Fri">:2,
]#;
It gives syntax error at the model file at writeln(a[<"Mon","Tue">]);
what's the issue here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您写的话,
您将获得
OPL建模语言与 OPL JavaScript语言有助于预处理,后处理和流控制。
If you write
You will get
OPL Modeling language is not the same as the OPL Javascript language that helps with preprocessing, postprocessing and flow control.