void make_random_neighbourhood(POverlay po, size_t degree)
{
size_t n = po->num_peers();
for (size_t i = 0; i < n; i++) {
size_t k = 0;
while (k < degree){
size_t j = (size_t)floor(uniform (0, n, &gSeed));
if (i != j) {
k++;
if (po->find_link (i, j) == NULL){
po->add_link (i, j);
po->add_link (j, i);
}
}
}
}
}
the errors in debugging are:
No symbol "j" in current context.
No symbol "n" in current context.
but actually these two functions below are called and I found n=1000
when stepping into floor(uniform (0, n, &gSeed)), which means that
n has been assigned a correct value
1 2
size_t n = po->num_peers();
size_t j = (size_t)floor(uniform (0, n, &gSeed))
when step to the statement po->add_link (i, j);
the fatal error arise:
No source available for "std::_Rb_tree_decrement() "
no, in fact, the program was successful before I modify other classes, which I believe has no association with these related function.
I don't know why in the debugging there are such errors as below:
1 2
No symbol "j" in current context.
No symbol "n" in current context.