The C++ code "croyances.cc" implements the belief model proposed in the paper \Title{A model for the formation of beliefs and social norms based on the satisfaction problem (SAT)} This code was designed for research purposes and for the development of the ideas presented in this paper. Therefore, it may not be straightformard to read and modifiy. In particular, to change the behavior, it is sometimes necessary to comment out some instructions, or uncomment them. In what follows, we assume that the reader is familiar with C++. Below we sketch a few important points to understand how to use this code. It requires C++ version 17 or later. On linux systems it is compiled with > g++ croyance.cc and executed with > ./a.out Parameters are defined in the code and compilation is required after each change. A first important parameter is the scenario number. Here scenarios refer to those defined in the paper. Actually, scenario 1,2 and 3 have the same instructions flow and vary only by the value of some parameters. Scenario 4 is a bit different as the interaction results in copying the cognifive matrix of the winner of the debate. So, a slightly different instructions flow is used. By specifying the global variable scenario as const int scenario=4; at the beginning of the file, the proper instructions flow is selected at compilation. For the other scenarios, any value different from 4 is fine. We often use 0 to indicate scenario 1,2 or 3. The other parameters that a user may want to change are defined at the begining of the main(). They are auto nProposition=int{15}; // number of propositions auto popSize=int{50}; // population size auto interactionThreshold=15; // interaction range r_int (15 or 4 in the paper) auto n_monte_carlo=400; // number of time steps auto T=double{0.1*nProposition*nProposition}; // agent temperature (same for all) auto p=double{1}; // fraction of G relations copied by each agent (1 and .8 in the paper) auto q=double{0.}; // fraction of relations from G modified randomly (0 in the paper) auto relationDensity=double{0.3}; // Density of equations in G In the paper, scenario 1 is characterized by interactionThreshold=nProposition=15 and p=1. Scenario 2 is characterized by interactionThreshold=4, p=1. Scenario 3 is characterized by interactionThreshold=15, p=0.8. Scenario 4 is characterized by interactionThreshold=15 or 4, p=1. and global variable scenario=4. The management of randomness requires some explanations. One can work with a specified random seed to reproduce desired situations or use a "free" seed. In the first case, a value of the variable seed is manually given. For instance seed=123456; // generator=mt19937{seed}; // use this instruction when seed is imposed But to generate new sequences at each run, use instead the lines seed=0; // seed=0 is conventional to say that seed is rnd_device() generator=mt19937{rnd_device()}; The next step that need care is the generation of the cognitive matrix G. It is done through myGraph, an instance of the C++ class LogicalGraph. We then have three options: (1) Create a new myGraph G based on the selected sequence of random numbers, and save this matrix for possible further use auto myGraph=LogicalGraph(nProposition); myGraph.setLogicalConnector(relationDensity*nProposition*nProposition, seed, "save"); In this case, G is saved in file named for instance "logicalGraph-15-0.dat" for 15 propositions and no imposed seed. Or "logicalGraph-15-123456.dat" for 15 propositions and imposed seed 123456. (2) Create a cognitive matrix G from the random sequence, but without saving it auto myGraph=LogicalGraph(nProposition); myGraph.setLogicalConnector(relationDensity*nProposition*nProposition, seed, "no-save"); (3) Read a previously stored cognitive matrix G from the corresponding file. For instance auto myGraph=LogicalGraph(nProposition, "logicalGraph-15-123456.dat"); This last choice is interesting when one wants to keep the same G but generate different initial populations of agents, each being created with a random belief system. In such a case, one has to combine a "free" initialization of the random numbers with the reading of G in the file. Then, in all scenarios, the population is created as auto myPopulation=Population(myGraph.adjacencyMatrix, popSize, T, p, q); There are some variants to create the initial population, commented in the code, and not further discussed here, for the sake of simplicity. At this stage, the code computes and prints several data related to the problem. Matrix G, characterization of each agent in the population, average energy, some statistics, etc. The number of clusters is also given once the population has been initialized. Note that, by default, the agents are subject to 10 steps of the RWSAT algorithm to improve their internal coherence. This can be modified by searching and modifying the instruction people.back().rwsat(10); A probably infrequent practice used in this code is to write data in files using home made PostScript instructions in order to have data saved in a text format together with the possibility to make any complex graphical representations. So, you may be surprised by some syntax used when writing data files. Several measurements presented in the paper (evolution of the number of clusters, entropy, trajectory of agents in belief space, etc) are generated in this way. The main time loop (search for characters "main time loop") iterates the interaction process and performs measurements during the selected number of monte-carlo steps. It looks like for(int iter=0; iter