# ABS-SOCI: An Agent-Based Simulator of Student Sociograms
## 3 Abs-Soci
### Internal Functioning of the ABS
#### 3.4.3 Simulation Evolution Rules  
In each iteration, ABS-SOCI considers the following aspects to update the relationship of selection/rejection between each pair of students \(i1\) and \(i2\):  
* _Affinity of the type of \(i1\) with the type of \(i2\) in the particular size level_. This is represented within the student agent implementation with the Suitable and Unsuitable matrices. * _The trend of the relationship_. For instance, if the value of a relationship was increasing, it is more likely that it continues increasing, and similarly for decreasing trends. * _The duration of the relationship_. The long-term relationships between students are less probable to change their trend than short-term relationships. * _The possibility of being a reciprocal relationship_. Most relationships are reciprocal. In other words, when an individual \(i1\) selects \(i2\) as a friend, \(i2\) usually selects back \(i1\) as a friend. The simulation of sociogram evolutions use the following additional data structures:
* _\"Trend\" matrix_: This matrix is defined for determining the trends of the relationships for every pair of individuals. The values of this matrix are restricted to the \([-1,1]\) interval. For instance, matrix \(+1\) indicates that the value of the adjacency matrix of the corresponding pair of individuals is increasing, while \(-1\) indicates the opposite. Zero indicates that the value of the adjacency matrix remains with the same value. * _\"Change\" matrix:_ This matrix determines the probabilities of changing trends between student types. In particular, each value of this matrix represents the probability that two individuals of the corresponding student types change their trend in an iteration. The relationships between individuals are updated in each iteration in two phases: (1) updating the trends; (2) updating the relationships according to the trends. The algorithm for updating the trends is represented with the dataflow diagram of Figure 6. This diagram uses \"less than\" comparisons. This diagram mainly receives input from the current student agent and another one. It also uses the matrices and constants previously defined. In this dataflow, the previous trend of the relationship is considered. If any of the first two conditional bifurcations goes to the negative branch, then the trend is not changed, and consequently the relationship continues with the same trend (either decreasing, neutral or increasing). More concretely, the first bifurcation considers the probability of changing the trend of the corresponding agent types. The second bifurcation is included to reduce the probability that long-term relationships change in comparison to short-term relationships. For this purpose, ABS-SOCI uses the relative position of the iteration in the simulation, represented with the 'iteration\" variable that goes from one to the total number of iterations. The probability of changing the relation trend is determined with Equation (1). The probability is lower in later iterations, since it uses an inverse function of the iteration variable:  
Figure 6: Dataflow diagram for updating the trend. \[p=min(1,CST\_TREND*\frac{1}{iteration}). \tag{1}\]  
The \(CST\_TREND\) constant is applied to properly weight the effect of distinguishing different relation durations. This constant determines from which iteration the probability starts decreasing. The min function makes the outputted probability be one when the iteration position is lower than this constant. For example, assuming a common value of this constant like ten, for the first ten iterations, the probability of changing the trend according to relation duration will be the same (i.e., one). From this iteration forward, the change probability decreases. Several alternatives were compared before choosing Equation (1) for considering the duration of relations.