本文整理汇总了C++中VNode::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ VNode::parent方法的具体用法?C++ VNode::parent怎么用?C++ VNode::parent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VNode
的用法示例。
在下文中一共展示了VNode::parent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WEU
// Can pass root as an argument, but will not affect performance much
double DESPOT::WEU(VNode* vnode, double xi) {
VNode* root = vnode;
while (root->parent() != NULL) {
root = root->parent()->parent();
}
return Gap(vnode) - xi * vnode->Weight() * Gap(root);
}
示例2: FindBlocker
VNode* DESPOT::FindBlocker(VNode* vnode) {
VNode* cur = vnode;
int count = 1;
while (cur != NULL) {
if (cur->utility_upper_bound - count * Globals::config.pruning_constant
<= cur->default_move().value) {
break;
}
count++;
if (cur->parent() == NULL) {
cur = NULL;
} else {
cur = cur->parent()->parent();
}
}
return cur;
}
示例3: ExploitBlockers
void DESPOT::ExploitBlockers(VNode* vnode) {
if (Globals::config.pruning_constant <= 0) {
return;
}
VNode* cur = vnode;
while (cur != NULL) {
VNode* blocker = FindBlocker(cur);
if (blocker != NULL) {
if (cur->parent() == NULL || blocker == cur) {
double value = cur->default_move().value;
cur->lower_bound(value);
cur->upper_bound(value);
cur->utility_upper_bound = value;
} else {
const map<OBS_TYPE, VNode*>& siblings =
cur->parent()->children();
for (map<OBS_TYPE, VNode*>::const_iterator it = siblings.begin();
it != siblings.end(); it++) {
VNode* node = it->second;
double value = node->default_move().value;
node->lower_bound(value);
node->upper_bound(value);
node->utility_upper_bound = value;
}
}
Backup(cur);
if (cur->parent() == NULL) {
cur = NULL;
} else {
cur = cur->parent()->parent();
}
} else {
break;
}
}
}