38 #ifndef __SOCIAL_NETWORK_GRAPH__
39 #define __SOCIAL_NETWORK_GRAPH__
44 #include <boost/random/mersenne_twister.hpp>
45 #include <boost/random/discrete_distribution.hpp>
47 template <
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());
std::set< size_t > execute(size_t numMasters, size_t dimensions, size_t id, int)
boost::random::mt19937 gen_
Tps< T > sqrt(const Tps< T > &x)
Square root.
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
void setNetworkNeighbors()
double manhattenDistance(size_t from, size_t to)
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
std::set< size_t > realNetworkNeighborPIDs_
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details IMPORTANT which obligates you to give appropriate credit!If you write a scientific paper describing research that made substantive use of this it is your obligation as a scientist to(a) mention the fashion in which this software was used in the Methods section
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
void chooseRandomNeighbor()