【发布时间】:2021-03-01 14:06:00
【问题描述】:
-
我想做什么:
我想观察scip提供的每个节点的分支规则(即strang branch和relpscost)的过程数据,包括LPSolution、分支深度、分支分数、下界等。因此,我需要收集由 scip 提供的规则创建的分支数据。
-
我做了什么并尝试过:
我想我可以使用How to add branching rules中描述的方法,我已经阅读了这个页面并尝试使用c++进行编码,过程见下文。当我调试这个程序时,我发现我可以找到 relpscost 规则,并且在实现函数
branchexeclp(scip, relpscostRule, true, result);后打印的错误显示Exception: EXC_BAD_ACCESS (code=1, address=0x28)
static
SCIP_DECL_BRANCHEXECLP(collectBranchProcessData)
{
SCIP_BRANCHRULE* relpscostRule = SCIPfindBranchrule(scip, "relpscost");
SCIP_RETCODE (*branchexeclp)(SCIP* scip, SCIP_BRANCHRULE* branchrule, SCIP_Bool allowaddcons, SCIP_RESULT* result);
branchexeclp(scip, relpscostRule, true, result);
// TODO: get the data that I want to observe by calling the SCIP APIs.
*result = SCIP_BRANCHED;
return SCIP_OKAY;
}
- 如何收集我想观察的数据?
【问题讨论】:
标签: scip