Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
IBM/ILOG OPL 言語に文字列連結構文/機能があるかどうか疑問に思っていましたか? +私はOPLモデルで次のように使用しました:
+
{names[i] + "_" | i in I}
しかし、エラーが発生しました。
CPLEX studio 12.6 を使用していますが、ヘルプを調べたところ、そのような機能が見つかりませんでした。グーグルで調べてみると、int配列にはappendがありますが、Stringにはあまりありません。モデル自体で文字列連結を行う方法のポインタ。
do do do string concat スクリプトを使用できます。
range r=1..3; string names[i in r]="item"; execute { for(var i in r) names[i]+=i; writeln(names); }
["item1" "item2" "item3"] を与える
よろしく