简体   繁体   English

优化后评估pyscipopt Expr

[英]Evaluating pyscipopt Expr after optimization

I have a question regarding PySCIPOpt: Is it possible to evaluate expressions (pyscipopt.scip.Expr) after optimization? 我对PySCIPOpt有一个疑问:优化后是否可以评估表达式(pyscipopt.scip.Expr)? Similar to calling getVal() for arguments of type pyscipopt.scip.Variable. 与为pyscipopt.scip.Variable类型的参数调用getVal()相似。

It is not (yet) possible to query the activity of a general constraint. 目前尚无法查询一般约束的活动。 This is only possible for linear and quadratic constraints, see http://scip-interfaces.github.io/PySCIPOpt/docs/html/classpyscipopt_1_1scip_1_1Model.html#a1e79bf20f168f7c55aa3fdf00491c898 这仅适用于线性和二次约束,请参见http://scip-interfaces.github.io/PySCIPOpt/docs/html/classpyscipopt_1_1scip_1_1Model.html#a1e79bf20f168f7c55aa3fdf00491c898

You could turn your expression into an equation and check the value of the new slack variable: 您可以将表达式转换为方程式,然后检查新的松弛变量的值:

c(x) >= b

turns into 变成

c(x) - s == 0
s >= b

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM