-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deffuant model #33
Merged
Deffuant model #33
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The ConfigParser sets variables and checks them, so defaults should not live inside the class Co-authored-by: Moritz Sallermann <[email protected]>
Now you can use the draw_k_from_n function without repitition while optionally including or excluding a particular index from 0 to N Co-authored-by: Moritz Sallermann <[email protected]>
This compiles but segfaults when you run the example. Some silly prints inside simulation for ad-hoc debugging. Co-authored-by: Moritz Sallermann <[email protected]>
Co-authored-by: Amrita Goswami <[email protected]>
More clarity. The public interface of a class should be the most visible Co-authored-by: Amrita Goswami <[email protected]>
Implemented a simple unit test with two agents for the basic deffuant model. Also initialize the agents uniformly on the interval [0,1] in the constructor (like we do in the DeGroot model). Co-authored-by: Amrita Goswami <[email protected]>
This function sorts the adjacency list by neighbour idx and removes doubly counted edges by summing up their weight. Co-authored-by: Amrita Goswami <[email protected]>
Also fixed the clear() function and removed some prints in test_network
Generates a neighbour list such that agents are on a square lattice, and each agent has 4 neighbours. PBCs are implemented. TODO: perhaps move from size_t to int? Co-authored-by: Moritz Sallermann <[email protected]>
To reduce unnecessary commits with minor formatting changes, we have pinned clang-format to 18.1.1. Different versions of clang-format apparently produce different outputs. Co-authored-by: Moritz Sallermann <[email protected]>
Implemented the Deffuant model with a square lattice neighbour list. TODO: Actually parse these options. Co-authored-by: Moritz Sallermann <[email protected]>
We now support an implementation of the Deffuant model on a square lattice. TODO: unit test!
We use a 16x16 lattice and observe the formation of two stable clusters. Co-authored-by: Amrita Goswami <[email protected]>
Utility function that parses a string that is in teh format of a comma separated list and executes a callback function for each entry in the list. Also added a unit test for it.
Started to implement the Deffuant model with vectors. To minimize code duplication we refactored the `ModelDeffuant` class in the following way: - We introduced `DeffuantModelAbstract<AgentT>` which is a template class and implement the behaviour that is common to both the basic Deffuant model and the vector deffuant model - The basic deffuant model is now a specialization of `DeffuantModelAbstract<SimpleAgent>`, where all the behaviour specific to the basic Deffuant model is implemented via template specialization and explicit instantiation in a separate .cpp source code file - The same was done with the vector Deffuant model, but it is not fully implemented yet. To simplify the notation they are availabe to the rest of the code via: `using DeffuantModel = DeffuantModelAbstract<SimpleAgent>;` `using DeffuantModelVector = DeffuantModelAbstract<DiscreteVectorAgent>;` Co-authored-by: Amrita Goswami <[email protected]>
Implemented the Hamming distance, needed for the vector Deffuant model. Co-authored-by: Amrita Goswami <[email protected]>
Also hacked in the generation of the initial agents by hardcoding the dimensionality <--- TODO Co-authored-by: Amrita Goswami <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented the basic Deffuant model. See the first model in https://www.worldscientific.com/doi/abs/10.1142/s0219525900000078.