CPLEX IDE 菜单栏语言设置( 中文 英文 韩文 等多国语言 设置)

本文介绍了如何更改CPLEX Optimization Studio IDE的界面语言。默认情况下,IDE将使用操作系统所用的语言,如果操作系统语言不受支持,则使用英语。要更改语言,需在快捷方式中添加命令行选项。目前支持包括中文在内的多种语言,但部分错误消息可能仍显示为英文。

http://www-01.ibm.com/support/docview.wss?uid=swg21573032

 

Technote (FAQ)


Question

How to change the interface language of CPLEX Optimization Studio IDE?

Answer

By default, CPLEX Optimization Studio IDE will use the language used by your operation system, if the language is supported. If the operating system uses an unsupported language, CPLEX Optimization Studio IDE will use English as the interface language. The choice of IDE interface language is not related to the installer interface language.

To change the interface language of CPLEX Optimization Studio IDE, you need to find the shortcut to the IDE on Start Manu, right click on shortcut, click on properties and add command line option -nl <language_code>. If the path to the target executable file are in quote marks, please add the option out of the quote marks.

 

On Windows 8/8.1, please right click the icon of CPLEX Studio IDE and select "Open file location". A folder with a shortcut to CPLEX Studio IDE will be opened. Then the shortcut can be edited by right clicking it, selecting properties and adding option -nl <language_code> or -Duser.language=<language_code>.

 

Now CPLEX Optimization Studio support the following languages:

 

LanguageLanguage Code
Chinese, Simplifiedzh_CN
Englishen or en_US
Frenchfr
Germande
Japaneseja
Koreanko
Polish (*)pl
Portuguese, Brazilian (*)pt_BR
Russian (*)ru
Spanishes
Turkish (*)tr

Languages marked with * are newly supported since CPLEX Optimization Studio version 12.5.

 

The following screenshot shows how to configure the shortcut to CPLEX Optimization Studio IDE to start in Simplified Chinese:


 

Note: If the target has quotation marks ("), please add the option -nl <language_code> outside the quotation marks. Otherwise, you might get an error reported by Windows indicating the target is not valid.

Note2: Some error messages have not yet been localized. Even if you change the interface language, some error messages will still be displayed in English.

转载于:https://www.cnblogs.com/sheshouyanhun/p/4871773.html

<think>嗯,用户想知道如何在CPLEX的OPL语言中定义一个只能取1和2的变量。首先,我得回忆一下OPL中的变量类型。常规的整数变量用dvar int,但这里需要限制值只能是1和2,也就是特定的两个整数。可能需要更精确的类型定义。 根据引用[4],里面提到使用dvar boolean定义布尔变量,但布尔只能是0或1,不符合用户的需求。这时候应该考虑整数变量,并设置上下限。不过普通的dvar int+可能默认下界是0,上界无穷大,这样不行。所以需要显式指定范围。 比如dvar int var in 1..2; 这样应该可以定义只能取1或2的变量。或者可能需要在变量声明时直接指定范围。另外,OPL的语法是否正确?比如是否有正确的区间定义方式,比如使用大括号或者to关键字。比如,1..2可能表示范围从1到2的整数,所以这个变量var可以取1或2。 再检查引用[4]中的例子,他们用了dvar boolean和dvar float+,但用户需要的是整数变量。所以正确的做法应该是用dvar int加上具体的范围限制。例如: dvar int var in {1,2}; 或者可能OPL中的范围是使用..来表示连续整数,而{1,2}是显式列举。需要确认OPL的语法是否允许这两种方式。根据经验,通常使用..来定义连续范围,而如果要非连续的,可能需要使用集合。不过在这里,用户只需要1和2,是连续的两个整数,所以1..2应该可行。 所以正确的定义应该是: dvar int var in 1..2; 这样变量var就会被限制为整数,并且取值只能是1或2。同时,如果用户需要定义多个这样的变量,可以用数组形式: dvar int x[范围] in 1..2; 总结一下,答案应该是使用dvar int并指定in 1..2来限制变量的取值范围。同时,可能还需要提到变量的类型是整数,并且上下界的设置方法。</think>在CPLEX的OPL语言中,要定义仅限取值为1和2的决策变量,可以通过以下两种方式实现: ### 方法1:显式定义整数变量范围 使用`dvar int`声明整数变量,并通过`in`关键字限定取值范围: ```opl dvar int myVar in 1..2; ``` 这会创建一个名为`myVar`的变量,其取值范围为闭合区间$[1,2]$,即仅允许取整数值1或2[^4]。 ### 方法2:通过集合约束 若变量需要与特定集合关联,可结合集合定义: ```opl range ValidValues = 1..2; dvar int myVar in ValidValues; ``` 此方式通过预定义集合`ValidValues`实现更清晰的约束表达。 ### 补充说明 - 若变量为数组类型: ```opl dvar int x[1..5] in 1..2; ``` 表示创建5个变量$x_1$到$x_5$,每个变量都只能取1或2 - 若需二进制变量,可使用`dvar boolean`,但其仅支持0和1取值
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值