热启动AMPL API

时间:2018-04-22 15:13:37

标签: optimization ampl

我在MATLAB中使用AMPL API并尝试设置变量的初始值。

set BUS := {1 2};
set Tiem := { 1 2 3};
var Pcharge  {BUS , Time};

我想知道在AMPL API中如何给出像Z这样的矩阵作为求解器的初始求解点

Z = [ 1 2 3 ; 4 5 6];

在magn api文档中,据说我可以这样做

ampl.eval('var x;');
x = ampl.getVariable('x');
x.setValue(4);

所以当我这样做时,我得到了这个错误:

Error using VariableBase/setValue (line 296)
No method 'setValue' with matching signature found for class 'com.ampl.Variable'.

Error in Entity/subsref (line 73)
                builtin('subsref',self,key);

有人能告诉我如何解决这个问题吗?

感谢。

0 个答案:

没有答案
相关问题