CPLEX中的此forall语句有什么问题? [英] What is wrong with this forall -statement in CPLEX?

查看:576
本文介绍了CPLEX中的此forall语句有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在此处回答,但会出错:

   forall(t in 0..4){
    a[t]<=z[t];
    -a[t]<=z[t];
    x[t+1]==x[t]+v[t];
    v[t+1]==v[t]+a[t];
   }           

解决方案

递归方程进入未初始化的区间,因此从exeption索引之外.您可以通过以下调整来避免该错误:初始化不需要的评估并将其分配为零.<​​/p>

这样会增加一些开销,但会简化逻辑,无法考虑任何更简单的方法.

I am trying to answer here but err:

   forall(t in 0..4){
    a[t]<=z[t];
    -a[t]<=z[t];
    x[t+1]==x[t]+v[t];
    v[t+1]==v[t]+a[t];
   }           

解决方案

The recursive equation enters into un-initialized interval hence index out of exeption. You can avoid this bug by tweaking: initialize not-needed valuations and assign them to zero.

This creates some overhead but simplifies the logic, cannot think about any simpler way to do this.

这篇关于CPLEX中的此forall语句有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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