Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Functions | Variables
Utopia::Models::Opinionet::Revision Namespace Reference

Classes

struct  TestNetworkD
 
struct  TestNetworkU
 

Functions

template<typename NWType , typename VertexDescType >
void update_opinion_HK (const VertexDescType v, NWType &nw, const double susceptibility, const double tolerance, const Opinion_space_type opinion_space)
 Hegselmann-Krause opinion update function. More...
 
template<typename NWType , typename RNGType , typename VertexDescType >
void update_opinion_Deffuant (const VertexDescType v, NWType &nw, const double susceptibility, const double tolerance, const Opinion_space_type opinion_space, std::uniform_real_distribution< double > &prob_distr, RNGType &rng)
 Deffuant opinion update function. More...
 
template<typename NWType , typename RNGType >
void rewire_random_edge (NWType &nw, const double tolerance, const double weighting, RNGType &rng)
 
template<typename NWType , typename RNGType >
void revision (NWType &nw, const double susceptibility, const double tolerance, const double weighting, const Interaction_type interaction, const Opinion_space_type opinion_space, const Rewiring rewire, std::uniform_real_distribution< double > &prob_distr, RNGType &rng)
 Performs an opinion update and edge rewiring (if enabled). More...
 
 BOOST_FIXTURE_TEST_CASE (test_opinion_update_HK_u, TestNetworkU)
 
 BOOST_FIXTURE_TEST_CASE (test_opinion_update_HK_d, TestNetworkD, *boost::unit_test::tolerance(0.0001))
 
 BOOST_FIXTURE_TEST_CASE (test_rewiring_u, TestNetworkU)
 
 BOOST_FIXTURE_TEST_CASE (test_rewiring_d, TestNetworkD)
 
 BOOST_FIXTURE_TEST_CASE (test_opinion_update_D_c, TestNetworkD, *boost::unit_test::tolerance(0.05))
 
 BOOST_FIXTURE_TEST_CASE (test_opinion_update_D_d, TestNetworkU, *boost::unit_test::tolerance(0.05))
 

Variables

std::mt19937 rng {}
 – Type definitions ----------------------------------------------------— More...
 
std::uniform_real_distribution< double > prob_distr
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/6]

Utopia::Models::Opinionet::Revision::BOOST_FIXTURE_TEST_CASE ( test_opinion_update_D_c  ,
TestNetworkD  ,
boost::unit_test::tolerance0.05 
)

◆ BOOST_FIXTURE_TEST_CASE() [2/6]

Utopia::Models::Opinionet::Revision::BOOST_FIXTURE_TEST_CASE ( test_opinion_update_D_d  ,
TestNetworkU  ,
boost::unit_test::tolerance0.05 
)

◆ BOOST_FIXTURE_TEST_CASE() [3/6]

Utopia::Models::Opinionet::Revision::BOOST_FIXTURE_TEST_CASE ( test_opinion_update_HK_d  ,
TestNetworkD  ,
boost::unit_test::tolerance0.0001 
)

◆ BOOST_FIXTURE_TEST_CASE() [4/6]

Utopia::Models::Opinionet::Revision::BOOST_FIXTURE_TEST_CASE ( test_opinion_update_HK_u  ,
TestNetworkU   
)

◆ BOOST_FIXTURE_TEST_CASE() [5/6]

Utopia::Models::Opinionet::Revision::BOOST_FIXTURE_TEST_CASE ( test_rewiring_d  ,
TestNetworkD   
)

◆ BOOST_FIXTURE_TEST_CASE() [6/6]

Utopia::Models::Opinionet::Revision::BOOST_FIXTURE_TEST_CASE ( test_rewiring_u  ,
TestNetworkU   
)

◆ revision()

template<typename NWType , typename RNGType >
void Utopia::Models::Opinionet::Revision::revision ( NWType &  nw,
const double  susceptibility,
const double  tolerance,
const double  weighting,
const Interaction_type  interaction,
const Opinion_space_type  opinion_space,
const Rewiring  rewire,
std::uniform_real_distribution< double > &  prob_distr,
RNGType &  rng 
)

Performs an opinion update and edge rewiring (if enabled).

◆ rewire_random_edge()

template<typename NWType , typename RNGType >
void Utopia::Models::Opinionet::Revision::rewire_random_edge ( NWType &  nw,
const double  tolerance,
const double  weighting,
RNGType &  rng 
)

Selects a random edge. If the opinion distance of the source and target exceeds the tolerance, the edge is rewired to a random target.

◆ update_opinion_Deffuant()

template<typename NWType , typename RNGType , typename VertexDescType >
void Utopia::Models::Opinionet::Revision::update_opinion_Deffuant ( const VertexDescType  v,
NWType &  nw,
const double  susceptibility,
const double  tolerance,
const Opinion_space_type  opinion_space,
std::uniform_real_distribution< double > &  prob_distr,
RNGType &  rng 
)

Deffuant opinion update function.

◆ update_opinion_HK()

template<typename NWType , typename VertexDescType >
void Utopia::Models::Opinionet::Revision::update_opinion_HK ( const VertexDescType  v,
NWType &  nw,
const double  susceptibility,
const double  tolerance,
const Opinion_space_type  opinion_space 
)

Hegselmann-Krause opinion update function.

Variable Documentation

◆ prob_distr

std::uniform_real_distribution<double> Utopia::Models::Opinionet::Revision::prob_distr

◆ rng

std::mt19937 Utopia::Models::Opinionet::Revision::rng {}

– Type definitions ----------------------------------------------------—