公共接口IloModel 扩展IloAddable
IloModel可提取对象是一组多个建模对象,如约束条件或目标。 Objects of type IloAddable can be added to and removed from an instance of IloModel. 模型中的建模对象可以通过方法 "iterator返回的迭代器进行查询。
重要的一点是,"IloCP或 "IloCplex等优化器通过其扩展名 "IloModeler来实现 "IloModel接口。 与优化器相关的模型是优化器在调用其方法 "solve时要解决的模型。
| 修饰符和类型 | 方法和说明 |
|---|---|
IloAddable |
add(IloAddable object)该方法将可提取对象添加到调用模型中。
|
IloAddable[] |
add(IloAddable[] objects)该方法将可提取对象数组添加到调用模型中。
|
IloAddable[] |
add(IloAddable[] objects,
int start,
int num)该方法将建模对象添加到调用的 "
IloModel中。 |
java.util.Iterator |
iterator()该方法返回一个遍历模型中所有对象的迭代器。
|
IloAddable |
remove(IloAddable object)该方法从调用模型中删除可提取对象。
|
IloAddable[] |
remove(IloAddable[] objects)该方法将从调用模型中删除可提取对象的数组。
|
IloAddable[] |
remove(IloAddable[] objects,
int start,
int num)该方法将从调用的 "
IloModel实例中删除建模对象。 |
getName, setNameIloAddableaddIloAddable对象) 抛出IloException
IloExceptionobject--要添加到调用的 "IloModel中的建模对象。IloAddable[] add(IloAddable[] objects) 抛出IloException
IloExceptionobjects-要添加到调用的 "IloModel中的建模对象数组。IloAddable[] add(IloAddable[] objects、 int start, int num) 抛出IloException
IloModel中。 所有执行 "IloAddable接口 "objects[start]...objects[start+num-1]的对象都会被添加到调用的 "IloModel对象中。IloExceptionobjects-要添加到调用的 "IloModel中的建模对象数组。start-第一个要添加到调用 "IloModel中的建模对象。num--要添加到调用的 "IloModel中的建模对象的数量。IloAddableremoveIloAddable对象) 抛出IloException
如果建模对象被多次添加,则只会从模型中删除一个实例。
IloExceptionobject--要从调用的 "IloModel中移除的建模对象。IloAddable[] remove(IloAddable[] objects) 抛出IloException
IloExceptionobjects--要从调用 "IloModel中移除的建模对象数组。IloAddable[] remove(IloAddable[] objects、 int start, int num) 抛出IloException
IloModel实例中删除建模对象。建模对象,或者更确切地说,实现IloAddable接口 "objects[start]...objects[start+num-1]的对象会从调用 "IloModel的实例中移除。 如果建模对象被多次添加,则只会从模型中删除一个实例。
IloExceptionobjects--要从调用 "IloModel中移除的建模对象数组。start--从调用的 "IloModel中移除的第一个建模对象。num--调用 "IloModel时要删除的建模对象的数量。java.util.Iteratoriterator()
add, remove or the method delete is called on the invoking IloModel.