Source code for simulations presented in "The impact of hypocrisy on opinion formation: a dynamic model"
- Install GCC (Linux/Windows) or XCode (Mac).
- Install the GNU Scientific Library, see https://www.gnu.org/software/gsl/.
- In a terminal, run these commands.
git clone https://github.com/mgastner/impact-of-hypocrisy.git
cd impact-of-hypocrisy/
make
This will build two executables: bvm
for the Basic Voter Model and cvm
for the Concealed Voter Model.
./bvm n_run rc n nr_init (seed)
where
n_run
: number of runsrc
: rate of copying a neighbourn
: number of agentsnr_init
: initial number of red agentsseed
: seed of the random number generator, automatically chosen as system time if left empty
./cvm n_run rc re ri n nr_ext_init nr_int_init nrr_init (seed)
where
n_run
: number of runsrc
: rate of copying a neighbourre
: rate of externalizationri
: rate of internalizationn
: number of agentsnr_ext_init
: initial number of agents whose external opinion is rednr_int_init
: initial number of agents whose internal opinion is rednrr_init
: initial number of agents whose opinion is red, both externally and internally.
- observed fraction F of runs in which the red opinion won
- predicted fraction m of runs in which the red opinion won
- observed mean consensus time with 95% confidence interval
- predicted mean consensus time
- During the first run, the fraction of red agents as a function of time is printed to the file
dynamics.dat
.