# Simulating the Cost of Cooperation: A Recipe for Collaborative Problem-Solving
## 2 The Model: Settings and Simulations  
Modern sociophysics and cognitive modeling frequently merge their approaches and languages, developing hybrid methods and models' architectures [58]. Such a trend allowed sociocognitive sciences to go beyond the limitations characterizing the \"classic\" approach based on game theory (e.g., public goods games), sometimes capturing the minimal complexity required to \"understand\" the dynamics of human social systems [59]. The complexity of our approach actually refers mainly to the way we implemented the collective dynamics of the agents. Despite such complexity, the computational model describing the cognitive dynamics of the agents is very simple and represents a standard in the \"computational modeling of cognition\" [60; 61]. From the other side, the \"toy sociophysical model\" we propose is devoted to bridging the agents' dynamics with the study of the collective competition between groups. Such a model has been already validated in a previous publication and represents the first attempt to capture the concurrent interplay between group competition and agent cooperation within the groups [62]. Moreover, in order to mimic the \"indirect reciprocity\" effect [33], we introduced an explicit representation of the \"group knowledge\", defined as the result of the amount of past altruistic behaviours of its agents. In this way, the \"basic\" tendency to free-ride the others at the level of the agent is dynamically moderated by the evolutionary selection of the agents based even on its \"groups knowledge\". Finally, such an interplay, merging cognitive and psychosocial modeling, has been implemented as follows. We divided a population of \(N\) players into \(n\) groups with the same size \(S\), so that \(S=\frac{N}{n}\). We took \(N=64\), and seven values of \(S=1,2,4,8,16,32,64\) (\(N=64\) remained fixed). The algorithm assigned a value of \(p_{i}\) (chosen uniformly between 0 and 1) to each player \(i\) in each group. The value \(p_{i}\) was characterized for each player, which remained the same over time, and measured the player's tendency to collaborate with other group members when solving a certain task (i.e., the propensity to work collectively as opposed to individually). More precisely, a small value of \(p_{i}\) (close to 0) indicated a tendency towards individualism, while large values (close to 1) indicated a propensity towards collaboration. We stress the fact that such \(p_{i}\) are in all respects the strategies of player \(i\): therefore, it must be considered as an innate feature of each individual and independent from other quantities. As usual in most game-theoretic models, see for example [63], by means of the evolution rule individuals with higher fitness will be more likely to reproduce, so that their strategies will survive to the detriment of the other ones. Indeed, our goal is to understand what are the best strategies depending on the values of the model parameters. In a subsequent phase, a task was assigned to a group. The task was represented by the value \(R\), which indicated the simplicity of the task and it was chosen randomly from six values (\(R=0.01,0.1,0.3,0.5,0.7,0.9\)). Values of \(R\) close to 0 indicated a hard task, while values close to 1 indicated easy tasks. Each of \(n\) groups worked in parallel to solve a task with the same simplicity \(R\). For size group \(S\) and for task simplicity \(R\) value, we ran a sequence of games. Each iteration of the game was divided into three steps: (1) first, we determined if a player in a group was a collectivist or an individualist. Each player \(i\) had a probability \(p_{i}\) of being a collectivist, so the player collaborated with other collectivists in the group to solve the problem; if not, the player was an individualist, who still benefited from the group but tried to solve the task alone.