本文整理汇总了C++中Network::config方法的典型用法代码示例。如果您正苦于以下问题:C++ Network::config方法的具体用法?C++ Network::config怎么用?C++ Network::config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
int run(Network& input, HierarchicalNetwork& output)
{
try
{
runInfomap(input.config(), input, output);
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
return 1;
}
return 0;
}
示例2: operator
bool operator()(const ServerConfigPtr c1, const ServerConfigPtr c2) {
assert(c1->network == c2->network);
assert(c1->network == n_->config());
int prio1 = c1->priority + n_->serverUndesirability(c1);
int prio2 = c2->priority + n_->serverUndesirability(c2);
if(prio1 != prio2) {
return prio1 < prio2;
}
// Assign random values to ServerConfigs having the same
// corrected prio's. These need to be stored because a
// comparator must be consistent and transitive, so
// subsequent calls to the operator()() function must agree
// with the return value of this call.
if(!contains(randomValues, c1)) {
randomValues[c1] = rand();
}
if(!contains(randomValues, c2)) {
randomValues[c2] = rand();
}
return randomValues[c1] < randomValues[c2];
}