38#ifndef __SOCIAL_NETWORK_GRAPH__
39#define __SOCIAL_NETWORK_GRAPH__
44#include <boost/random/mersenne_twister.hpp>
45#include <boost/random/discrete_distribution.hpp>
47template <
class TopoDiscoveryStrategy_t >
52 std::set<size_t>
execute(
size_t numMasters,
size_t dimensions,
size_t id,
67 boost::random::mt19937
gen_;
80 int64_t south =
myID_ - m;
83 size_t east =
myID_ + 1;
84 if((
myID_ + 1) % m == 0)
86 size_t west =
myID_ - 1;
121 int x_from = from / m;
122 int y_from = from % m;
126 return abs(x_from - x_to) +
abs(y_from - y_to);
133 std::vector<double> probabilities(
numMasters_, 0.0);
137 if(i ==
myID_)
continue;
143 if(i ==
myID_)
continue;
149 boost::random::discrete_distribution<>
150 dist(probabilities.begin(), probabilities.end());
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
Tps< T > sqrt(const Tps< T > &x)
Square root.
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
void setNetworkNeighbors()
void chooseRandomNeighbor()
double manhattenDistance(size_t from, size_t to)
std::set< size_t > realNetworkNeighborPIDs_
boost::random::mt19937 gen_
std::set< size_t > execute(size_t numMasters, size_t dimensions, size_t id, int)