非负转换
(类来自 pyomo.core.plugins.transform.nonnegative_transform)
- class pyomo.core.plugins.transform.nonnegative_transform.NonNegativeTransformation(**kwds)[source]
-
通过引入辅助变量,强制所有变量位于非负象限,创建一个新的等效模型。
方法
__init__(**kwds)apply(model, **kwds)已弃用。
apply_to(model, **kwds)将转换应用于给定的模型。
boundsConstraintRule(lb, ub, attr, vars, model)生成 'lb < x^+ - x^- < ub' 样式的约束。
create_using(model, **kwds)使用此转换创建一个新模型
delayedExprMapRule(ruleMap, model[, ndx])规则旨在从查找表中返回表达式。
exprMapRule(ruleMap, model[, ndx])规则旨在从查找表中返回表达式
noConstraint(*args)sumRule(attr, vars, model)返回一个求和表达式。
成员文档
- apply(model, **kwds)
已弃用。
自版本4.3.11323起已弃用:Transformation.apply() 已被弃用。请使用 Transformation.apply_to() 进行原地转换,或使用 Transformation.create_using() 创建新的独立转换模型实例。
- apply_to(model, **kwds)
将转换应用于给定的模型。
- static boundsConstraintRule(lb, ub, attr, vars, model)[source]
生成‘lb < x^+ - x^- < ub’样式的约束。设计为通过functools.partial在lb、ub、attr和vars之间进行更紧密的封装。vars是一个{varname: coefficient}字典。attr是基础变量名;也就是说,X[1]将通过
model.__getattribute__(‘X’)[1]
因此 attr='X',并且 1 是 vars 的一个键。
- create_using(model, **kwds)
使用此转换创建一个新模型