本文整理汇总了Python中pyscipopt.Model.setIntParam方法的典型用法代码示例。如果您正苦于以下问题:Python Model.setIntParam方法的具体用法?Python Model.setIntParam怎么用?Python Model.setIntParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyscipopt.Model
的用法示例。
在下文中一共展示了Model.setIntParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: model
# 需要导入模块: from pyscipopt import Model [as 别名]
# 或者: from pyscipopt.Model import setIntParam [as 别名]
def model():
# create solver instance
s = Model()
# include separator
sepa = GMI()
s.includeSepa(sepa, "python_gmi", "generates gomory mixed integer cuts", priority = 1000, freq = 1)
# turn off presolve
s.setPresolve(SCIP_PARAMSETTING.OFF)
# turn off heuristics
s.setHeuristics(SCIP_PARAMSETTING.OFF)
# turn off propagation
s.setIntParam("propagating/maxrounds", 0)
s.setIntParam("propagating/maxroundsroot", 0)
# turn off some cuts
s.setIntParam("separating/strongcg/freq", -1)
s.setIntParam("separating/gomory/freq", -1)
s.setIntParam("separating/aggregation/freq", -1)
s.setIntParam("separating/mcf/freq", -1)
s.setIntParam("separating/closecuts/freq", -1)
s.setIntParam("separating/clique/freq", -1)
s.setIntParam("separating/zerohalf/freq", -1)
# only two rounds of cuts
s.setIntParam("separating/maxroundsroot", 2)
return s
示例2: Model
# 需要导入模块: from pyscipopt import Model [as 别名]
# 或者: from pyscipopt.Model import setIntParam [as 别名]
if self.count == 1:
down, eq, up = self.model.branchVarVal(self.cont, 1.3)
self.model.chgVarLbNode(down, self.cont, -1.5)
self.model.chgVarUbNode(up, self.cont, 3.0)
self.was_called_val = True
down2, eq2, up2 = self.model.branchVar(self.integral)
self.was_called_int = True
self.model.createChild(6, 7)
return {"result": SCIP_RESULT.BRANCHED}
m = Model()
m.setIntParam("presolving/maxrounds", 0)
#m.setLongintParam("lp/rootiterlim", 3)
m.setRealParam("limits/time", 60)
x0 = m.addVar(lb=-2, ub=4)
r1 = m.addVar()
r2 = m.addVar()
y0 = m.addVar(lb=3)
t = m.addVar(lb=None)
l = m.addVar(vtype="I", lb=-9, ub=18)
u = m.addVar(vtype="I", lb=-3, ub=99)
more_vars = []
for i in range(1000):
more_vars.append(m.addVar(vtype="I", lb= -12, ub=40))
m.addCons(quicksum(v for v in more_vars) <= (40 - i) * quicksum(v for v in more_vars[::2]))