seldon-code / seldon

A code for opinion dynamics simulations.
GNU General Public License v3.0
7 stars 2 forks source link

Seldon - A code for opinion dynamics simulations

Logo

About

Seldon is a performant code for performing various types of opinion dynamics simulations (under development), written primarily in C++.

Installation

If you want to use micromamba as the package manager, create and activate the environment.

micromamba create -f environment.yml
micromamba activate seldonenv

Compilation and Installation

We use meson to compile and build Seldon.

meson setup build
meson compile -C build

To install seldon to your conda environment, run the following:

meson setup build --prefix $CONDA_PREFIX
meson install -C build

Quick Start

Run the executable, and provide the input configuration TOML file (as the first positional argument), and an optional output directory location. If the output location is not specified, it is set to the parent directory in which the config file is present

cd build
./seldon /path/to/config -o /path/to/output/dir

If you've installed it, you can simply run seldon anywhere.

seldon /path/to/config -o /path/to/output/dir

Output files

The file network.txt contains information about the network. First column is the index of the agent, then the next column is the number of incoming agent connections including the agent itself. Subsequent columns are the neighbouring incoming agent indices and weights. In addition, every iteration produces a double opinion value for each agent. These are outputted to files named opinions_i.txt.

Running Tests

To run the tests, go into the build directory and run the following:

meson test

Contributing

All contributions are welcome!!

License

GNU GPL v3 or later.