Cplex Studio不支持dvar float [英] Cplex Studio Does not support dvar float

查看:257
本文介绍了Cplex Studio不支持dvar float的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用变量来记录对象的本地时间。由于找不到在Cplex中定义变量的任何方法,因此尝试使用 dvar float来定义变量。但是,Cplex说该算法不支持 dvar float。我尝试简单地将变量定义为float Z [i] [r] [k],还尝试使用CP,但均不能解决问题。请给我一些帮助或指导吗?

I am trying to use a variable to record the local timings of an object. As I could not find any way to define a variable in the Cplex, I tried using "dvar float" to define the variable. But, Cplex says that the algorithm does not support "dvar float". I tried simply define the variable as float Z[i][r][k] and also tried using CP, both did not solve the issue. May I have some help or guidance please?

i = 0..3;
r = 0..1;
j = 0..3;
s = 0..1;
k = 1; 
float U[1..3][1..1] = ...;
float T[i][r][j][s] = ...;
float M[1..3][1..1] = ...; 
dvar boolean X[i][r][j][s][k];
dvar boolean Y[1..N][1..H][k];
dvar float Z[i][r][k];

forall(ci in i:ci!=0, cr in r:cr!=0, cj in j, cs in s: (ci!=cj)||(cr!=cs), ck in k)
  TimeRecord1: 
    Z[cj][cs][ck] == X[ci][cr][cj][cs][ck] * (T[ci][cr][cj][cs] + (U[ci][cr] + (M[ci][cr] - Z[ci][cr][ck])) * Y[ci][cr][ck]);


推荐答案

使用CP时,不允许使用float决策变量。
您可以做的是使用变量更改为十进制决策变量建模。
您有一个示例

with CP, float decision variables are not allowed. What you can do is use a variable change to model decimal decision variables. You have an example in


CPLEX_Studio1210\opl\examples\opl\floatexpr

CPLEX_Studio1210\opl\examples\opl\floatexpr

另请参见

See also CPLEX OPL using decision variable as float in constraint programming algorithm

stackoverflow内

within stackoverflow

这篇关于Cplex Studio不支持dvar float的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆