This work is a part of Google Summer of Code 2024 under the Python Software Organisation. The aim of this project is to create Python bindings for the Seldon framework. The Seldon framework is a C++ Engine for Opinion Dynamics. The bindings and the complete project as a python package will allow users to use the Seldon framework in Python and carry out Simulations.
The DeGroot model is a model of social influence. It describes how agents in a network can reach a consensus by updating their opinions based on the opinions of their neighbors. The DeGroot model is a simple model of social influence that has been studied extensively in the literature. It is used to model a wide range of social phenomena, such as the spread of information, the formation of opinions, and the emergence of social norms.
And here is the example of reaching consensus in a network using the DeGroot model. We will create a network of 20 agents with random opinions and random connections between them. We will then conduct the simulation. As can be seen in this file here.
Initial opinions of the agents in the network in the range of [0,1] are shown below:
Final opinions of the agents in the network after the simulation are shown below:
And we can conclude that the agents have reached a consensus after the simulation.
- DeGroot, M. H. (1974). Reaching a Consensus. Journal of the American Statistical Association, 69(345), 118–121. https://doi.org/10.2307/2285509
visualisations generated with the help of cytoscape
some of the visualisations normalisation code can be found here
Create a new micromamba
environment and activate it:
micromamba create -f environment.yml
micromamba activate pyseldonenv
Look at the installation documentation here
Set up the build directory with meson
:
meson setup build
Use pip
to install the package:
pip install .
Use pytest
to run the tests:
pytest tests/
or
pytest -s tests/
to see the output of the tests without capturing the std output