本文整理汇总了C++中reservable_priority_queue类的典型用法代码示例。如果您正苦于以下问题:C++ reservable_priority_queue类的具体用法?C++ reservable_priority_queue怎么用?C++ reservable_priority_queue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了reservable_priority_queue类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Push
/**
* Add node to search queue
*
* @param n Destination node to add
* @param pn Previous node
* @param e Edge distance (previous to this)
*/
void Push(const Node &node, const Node &parent,
const AStarPriorityValue &edge_value) {
// Try to find the given node n in the node_value_map
node_value_iterator it = node_values.find(node);
if (it == node_values.end()) {
// first entry
// If the node wasn't found
// -> Insert a new node into the node_value_map
it = node_values.insert(std::make_pair(node, edge_value)).first;
// Remember the parent node
SetPredecessor(node, parent);
} else if (it->second > edge_value) {
// If the node was found and the new value is smaller
// -> Replace the value with the new one
it->second = edge_value;
// replace, it's bigger
// Remember the new parent node
SetPredecessor(node, parent);
} else
// If the node was found but the value is higher or equal
// -> Don't use this new leg
return;
q.push(NodeValue(edge_value, it));
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:34,代码来源:AStar.hpp
示例2: Clear
/**
* Clears the queues
*/
void Clear() {
// Clear the search queue
q.clear();
// Clear EdgeMap
edges.clear();
current_value = 0;
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:12,代码来源:Dijkstra.hpp
示例3: Clear
/** Clears the queues */
void Clear() {
// Clear the search queue
q.clear();
// Clear the node_parent_map
node_parents.clear();
// Clear the node_value_map
node_values.clear();
}
开发者ID:badbadc0ffee,项目名称:XCSoar,代码行数:10,代码来源:AStar.hpp
示例4: push
/**
* Add node to search queue
*
* @param n Destination node to add
* @param pn Previous node
* @param e Edge distance (previous to this)
*/
void push(const Node &node, const Node &parent, unsigned edge_value = 0) {
// Try to find the given node n in the edge_map
edge_iterator it = edges.find(node);
if (it == edges.end())
// first entry
// If the node wasn't found
// -> Insert a new node
it = edges.insert(std::make_pair(node, Edge(parent, edge_value))).first;
else if (it->second.value > edge_value)
// If the node was found and the new value is smaller
// -> Replace the value with the new one
it->second = Edge(parent, edge_value);
else
// If the node was found but the new value is higher or equal
// -> Don't use this new leg
return;
q.push(Value(edge_value, it));
}
开发者ID:,项目名称:,代码行数:26,代码来源:
示例5: reserve
/**
* Reserve queue size (if available)
*/
void reserve(unsigned size) {
q.reserve(size);
}
开发者ID:,项目名称:,代码行数:6,代码来源:
示例6: queue_size
/**
* Return size of queue
*
* @return Queue size in elements
*/
gcc_pure
unsigned queue_size() const {
return q.size();
}
开发者ID:,项目名称:,代码行数:9,代码来源:
示例7: empty
/**
* Test whether queue is empty
*
* @return True if no more nodes to search
*/
gcc_pure
bool empty() const {
return q.empty();
}
开发者ID:,项目名称:,代码行数:9,代码来源:
示例8: GetQueueSize
/**
* Return size of queue
*
* @return Queue size in elements
*/
gcc_pure
unsigned GetQueueSize() const {
return q.size();
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:9,代码来源:Dijkstra.hpp
注:本文中的reservable_priority_queue类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论