Utopia  2
Framework for studying models of complex & adaptive systems.
Namespaces | Functions
utils.hh File Reference
#include <cmath>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_traits.hpp>
Include dependency graph for utils.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Utopia
 
 Utopia::Models
 
 Utopia::Models::Opinionet
 
 Utopia::Models::Opinionet::Utils
 

Functions

template<typename RT , typename T , typename RNGType >
RT Utopia::Models::Opinionet::Utils::get_rand (std::pair< T, T > range, RNGType &rng)
 Generate a random number within the given range. More...
 
template<typename NWType >
constexpr bool Utopia::Models::Opinionet::Utils::is_directed ()
 Check whether the network type allows for directed edges. More...
 
template<typename NWType , typename VertexDescType , typename RNGType >
auto Utopia::Models::Opinionet::Utils::get_rand_neighbor (const VertexDescType v, NWType &nw, RNGType &rng)
 
template<typename NWType , typename RNGType , typename VertexDescType >
VertexDescType Utopia::Models::Opinionet::Utils::select_neighbor (const VertexDescType v, NWType &nw, std::uniform_real_distribution< double > &prob_distr, RNGType &rng)
 
template<typename NWType , typename VertexDescType >
double Utopia::Models::Opinionet::Utils::opinion_difference (VertexDescType v, VertexDescType w, NWType &nw)
 Calculate the absolute opinion difference of two vertices. More...
 
template<typename NWType , typename VertexDescType >
void Utopia::Models::Opinionet::Utils::set_and_normalize_weights (const VertexDescType v, NWType &nw, const double weighting)
 Set and normalize weights according to opinion difference. More...