# A Two-Dimensional Self-coordination Mechanism of Agents in a Minority Game

Sanaz Hasanzadeh Fard, Hadi Tabatabaee Malazi

► To cite this version:

Sanaz Hasanzadeh Fard, Hadi Tabatabaee Malazi. A Two-Dimensional Self-coordination Mechanism of Agents in a Minority Game. 8th International Conference on Fundamentals of Software Engineering (FSEN), May 2019, Tehran, Iran. pp.20-36, 10.1007/978-3-030-31517-7_2. hal-03769115

HAL Id: hal-03769115

https://inria.hal.science/hal-03769115v1

Submitted on 5 Sep 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# A two-dimensional self-coordination mechanism of agents in a minority game

Sanaz Hasanzadehfard and Hadi Tabatabaee Malazi *

Faculty of Computer Science and Engineering, Shahid Beheshti University. GC, Tehran, Iran, s.hasanzadehfard@gmail.com, h_tabatabaee@sbu.ac.ir

**Abstract.** Coordination of several agents in accessing a limited resource is a common problem among various systems. In the absence of a central coordinator, the primary challenge of the problem is to bring equilibrium among agents in accessing a limited shared resource. The *El Farol Bar Problem* is the generic description of this problem. In this paper, we devised a new two-dimensional approach called Social Coordination (*SoCo*). In the first dimension, we define a new function, called *Effect*(), that plays a determinative role in choosing the strategy for the current action. In the second dimension, we define a new social coordination constraint that boosts the system to achieve the entire equilibrium, in which near optimum status in social and individual utilities are reached without any starvation cases. *SoCo* not only attempts to improve the social utility but also considers the individual utility and starvation as the optimization goals. The simulation results show that *SoCo* improves social utility by 57.61% compared to similar approaches. The simulations demonstrate that the maximum starvation length of agents in *SoCo* is 7.93 times less than similar methods.

**Keywords:** Distributed Systems · Self-Coordination · El Farol Bar Problem · Social Utility · Individual Utility · Resource Starvation.

## 1 Introduction

One of the common problems in distributed systems is to establish a kind of dis- tributed coordination among competing players in accessing a limited resource [1, 2]. In absence of a central coordinator, different players have to establish a coordination mechanism to optimize resource usage by avoiding excessive ac- cesses or leaving the resource underused. In systems with unknown players or in cases where the players do not know each other, the coordination problem has to be addressed without communication among the participants. That is, the players are not able to communicate with each other to share their previous history of accessing the resource or their intentions. The El Farol Bar [3] and minority games [4] (which are inspired by El Farol Bar Problem) are the games that try to address the problem of coordinating a set of selfish players to regulate cooperation in accessing a resource in the absence of communications. The lack of a suitable coordination mechanism may result in congestion, starvation, or degradation in social and individual utilities of the players.
The classic El Farol Bar Problem [3] happens in Santa Fe city, where every Thursday one hundred citizens (agents) have to decide whether to attend the city bar or not. The bar has a limited capacity (60 seats). If the attendees are more than the capacity, no one will have a pleasant time. Therefore, each agent thinks of the bar situation before making a decision. He will go to the bar if he thinks that the bar is not crowded. Otherwise, he would prefer to stay at home. The individual utility of an agent for each iteration (week) is the result of his decision. If he stays at home, the value of his individual utility is equal to zero. If he decides to go to the bar and the bar was over-crowded, he will receive -1. Otherwise, he will get +1 for his individual utility in that iteration. The social utility of the city for an iteration is the sum of the individual utilities of all agents. The challenging issue is that agents cannot communicate before making their decisions. In other words, no one is aware of the bar's condition before going to the bar. Moreover, there is no central coordination controller.

The main objective of any candidate solution is to converge the number of attendees to the bar capacity. Consequently, the system will achieve the highest social utility. An alternative goal is to decrease the convergence time, which yields the maximization of the total social utility (sum of social utilities for all of the iterations). Another important factor is to increase individual utility, which implies that all agents benefit from the resource fairly. Finally, the starvation of agents is the last evaluation metric that illustrates the fairness level in smaller time units for the resource distribution among agents. For instance, it is possible to have a high individual utility for most agents, but a minority of them do not have any access to the resource for a long period of time. To analyze the metric, the maximum starvation length of agents has to be monitored.

Some research concentrates on providing solutions for the generic El Farol problem. They can be classified into several categories [5]. One category of researches is named predictor based [3, 6, 7]. These solutions have a top-down view, and the decision-making process is performed by predicting the aggregated system behavior. In another category of the solutions [8, 9, 10, 11], the agent's individual information is in the center of attention. These solutions have a bottom-up view of the problem. The analyses reveal several drawbacks. Firstly, the level of being over-crowded does not have a significant effect on the decision-making process. For instance, in iteration *x*, twenty persons above the bar capacity wanted to attend, and in iteration *y* only one extra attendee intended to join the bar. The level of being over-crowded in iteration *x* is different from iteration *y*, but both cases are treated the same. Secondly, studies such as [3] are that the optimization of individual utility is not considered as the objectives. Similarly, minimizing the starvation length is not addressed in [3, 6, 7, 8, 9]. Finally, in some of the methods such as [10, 11], the scalability in terms of the number of agents is an issue.

In this paper, we devise a new approach, called Social Coordination (*SoCo*) that uses a bottom-up view. To differentiate the impact of the previous iterations in terms of the level of being over-crowded, it uses a second dimension and defines a new function called *Effect(t)*. The function returns the coefficient (impact)
of iteration *t* that discriminates the over-crowded situations from each other as well as the under-crowded ones. We also define a new coordination factor that defines the optimum limit of attendance for an agent according to the bar's condition and its capacity. The factor is called *C*<sub>*a*</sub> and defines the social coordination among agents to maintain the optimum number of attendance and it is calculated according to the history of agent's experiences. It leads to the distribution of resource among agents in a balanced manner. Finally, in *SoCo*, the decision strategies are designed in a way that hinders the starvation.

The rest of the paper is organized as follows: In Section 2, we review some of the outstanding work. Section 3 is dedicated to the problem definition. Then, the details of SoCo are explained, and the performance is analyzed in sections 4 and 5, respectively. Finally, Section 6 concludes the paper.

## 2 Related Work

Several researchers studied the El Farol Bar Problem due to its capabilities in modeling real-world applications. Some of the studies concentrated on addressing the classic problem, while others employ it in applications. This section briefly reviews some of the distinguished researches.

The El Farol Bar Problem was introduced by Arthur et. al in [3] for the first time. In his paper, the behavior of agents is considered in a complex system with limited decision-making information. It is explained that deductive reasoning is not sufficient, and inductive reasoning can be used in such an environment. The decision-making is performed using predictors such as "same as last week" and "an average of four recent weeks". Then, the system uses the predictors for inductive reasoning and estimates the number of agents, which go to the bar. The goal is to converge the number of attendees to the bar capacity. The shortcomings of the solution are that it does not consider minimizing agent starvation and maximizing individual utility.

The agent starvation is investigated in the *Adaptive Parasitized* approach [9]. The idea is to add *behaviosit* to alter the behavior of the agent. The main objective of the *behaviosit* is to decrease the attending period of an agent, which intends to go to the bar in the far future. That is if the attending period of an agent is above a predefined threshold, the *behaviosit* is added, and consequently, the attending period starts to decrease. This leads to the mitigation of the star-vation problem in accessing the bar. Similar to the Adaptive method [8], the *Adaptive Parasitized* does not exploit complex predictors.

The researchers in [7] applied cognitive modeling to equip agents with human-inspired ability. The authors used the cognitive emotion theory [12, 13], which is relied on *belief* and *desire* concepts. The *belief* shows the level of confidence to the reliability of the strategy, and the *desire* represents the agent's tendency for maintaining and operating the current strategy. In the beginning, each agent chooses a strategy randomly among the same set of strategies. The agent predicts the system situation according to the selected strategy and performs the specified action. If the action is correct, the *belief* will increase accordingly, and
the agent keeps repeating the current strategy. Otherwise, it will decrease. If the decreased belief falls below the threshold, the agent will decide to change the current strategy. One of the interesting features of the approach is supporting the heterogeneity of agents. The authors in their next work in [14] analyze the effect of extending the memory size and did not find any clue for improvement of system performance.

Szilagyi in [15] solved the El Farol Bar Problem as a special case of the N-person battle of sexes. He modeled agents as stochastic learning cellular automata. The interacting environment of the agents is described with cellular automata, and stochastic learning rules are used for the agents' behavior. In the described model a range of different personality profiles can be used, such as Pavlovian, stochastically predictable (angry, benevolent, and unpredictable), accountant, conformist, and greedy.

Shu-Heng et al. in [10] defined a *good society* equilibrium with economic efficiency and economic equality characteristics. The authors propose the probability of achieving this equilibrium by a suitable topological network and agents with social preferences. The network of agents is established using the Von Neumann Network. Additionally, agents have extrinsic or intrinsic preferences. In the first one, agents are described by the minimum attendance threshold, while in the second one the awareness of inequity is formed through interactions with neighbors by averaging the attendance frequencies of the neighbors. That is, the original El Farol Bar Problem model is changed to the bi-dimensional one, which will boost the emergence of the good society. The authors performed a sensitivity analysis of the approach in [11], and study the effects of size-related parameters such as network size (number of agents), number of each agent's neighbors, and agent's memory size on the equilibrium. The main drawback is that, for large networks, the chance of reaching equilibrium is low compared to small networks. For very large networks, this chance is almost zero. Moreover, the other size related parameters do not have a considerable effect on achieving the equilibrium.

Overall, the main objective in most of the studies is the optimization of resource efficiency, while the individual utility and starvation are not in the center of attention.

### 3 Problem Definition

In the original El Farol Bar Problem [3], a set of $n$ agents is considered. Let $A$ denote the set of agents and $a_i$ be a sample one. Each agent ($a_i$) may tend to go to the bar every Thursday. Each week is defined by an iteration ($E^t$), where $1 \le t \le T$, and $T$ is the total number iterations. Each agent has a memory that remembers his last $h$ iterations (history). The decision of agent $i$ at iteration $t$ is denoted as $d_i^t$. If the agent decides to attend the bar, the value of $d_i^t$ is 1, otherwise, the value is 0. The bar has a limited capacity ($C$), and if the number of attendees at the iteration $t$ ($att^t$) exceeds more than $C$, the bar will be overcrowded ($att^t = \sum_{i=1}^n(d_i^t) > C$). Hence, all the attending agents will have an
unpleasant time and will receive a negative utility. On the other hand, when the bar is under-crowded ($att^t = \sum_{i=1}^n (d_i^t) \le C$), the visiting agent will have a pleasant time.

**Definition 1:** The individual utility of an agent ($a_i$) at iteration $t$ is denoted by $r_i^t$ and is calculated according to Eq.1.

$$r_i^t = \begin{cases} +1 & att^t \le C, d_i^t = 1 \\ 0 & d_i^t = 0 \\ -1 & att^t > C, d_i^t = 1 \end{cases} \qquad (1)$$

**Definition 2:** The total individual utility ($tiu$) of an agent $a_i$ is the sum of his individual utilities in every iteration (Eq.2).

$$tiu_i = \sum_{t=1}^{T} r_i^t \qquad (2)$$

**Definition 3:** The social utility ($su^t$) of the system at iteration $t$ is the sum of all agents' individual utility at that iteration (Eq.3). The upper bound of $su^t$ is $C$ and the lower bound is $-n$ ($-n \le su^t \le C$).

$$su^t = \sum_{i=1}^{n} r_i^t \qquad (3)$$

**Definition 4:** The total social utility ($tsu$) is defined as the summation of the social utilities in all iterations (Eq.4).

$$tsu = \sum_{t=1}^{T} su^t \qquad (4)$$

**Definition 5:** The starvation length of an agent $a_i$ is the maximum number of iterations in which the agent does not get any positive individual utility, and it is denoted by $x_i$ (Eq.5). This definition is more rigorous compared to the definition provided in [9].

$$\forall p, q: p \le t \le q, r_i^t \le 0; \exists m, n: m \le t \le n, r_i^t \le 0; \mid n-m \ge q-p \Rightarrow x_i = n-m \qquad (5)$$

The maximum starvation length ($X$) of the system is the maximum of $x_i$ for all agents.

$$X = Max_{i=1}^{n}(x_i) \qquad (6)$$

The main constraint of the problem is that agents do not know what the other agents' actions are for the current iteration, and the situation of the bar is not revealed before attending. Furthermore, the system does not have any central coordinating entity.

The main goal of a candidate solution is to establish a self-coordination mechanism that:
1. Leads the system to converge the number of attendees ($att^t$) to the bar capacity ($C$): Fast convergence toward the bar capacity results in a higher total social utility.

2. Maximizes the total individual utility: It is expected that the total individual utility of an agent $a_i$ reaches a floor threshold (a specific portion of the bar capacity). This objective is to ensure that each agent gets a fair share of the bar. The ideal value of the threshold is $\frac{tsu}{n}$. But, practically the total individual utility is bounded by $\frac{tsu}{n} \pm \varepsilon$ (Eq.7). A fair approach has an $\varepsilon$ value close to zero.

$$ \frac{tsu}{n} - \varepsilon \leq tiu_i \leq \frac{tsu}{n} + \varepsilon \qquad (7) $$

3. Minimizes the maximum starvation length of agents: It is worth pointing out that a low starvation length will not necessarily lead to a high total individual utility. On the other hand, an agent may not attend the bar in half of the consecutive iterations but joins the bar for all the iterations of the second half. Therefore, the maximum starvation length is $x_i = T/2$, but the total individual utility may reach above the floor threshold.

# 4 The Devised Social Coordination Method

We devised a two-dimensional method that uses agents' previous experiences to make a decision about the next action. The objective of the first dimension is to differentiate the over-crowded situations from each other along with the under-crowded ones. We define the *Effect()* function that considers the number of attendees for each iteration. The second dimension examines the experiences of an agent independently from other agents. We define a new parameter called *social coordination constraint* ($C_a$), which is the optimum times that an agent attends the bar in his last *h* iterations. In the rest of this section, the *Effect()* function is introduced, then the social coordination constraint is described. Finally, the decision-making process is explained in detail.

## 4.1 The *Effect()* Function

The effect of iteration *t* is defined as the subtraction of the number of attendees ($att^t$) from the bar capacity ($Effect(t) = C - att^t$). The function is used for the last *h* iteration to calculate the impact of previous experiences of the agent. The *Effect()* value can be positive, zero, or negative for each iteration according to the following situations:

- Under-crowded case ($att^t < C \Rightarrow Effect(t) > 0$): The positive value indicates that the previous decision was right, and the agent tends to continue this trend. The value also indicates the number of free seats in the bar. The closer the value is to the zero, the closer the system is to the equilibrium.
- **The same number of attendees as the bar capacity ($att^t = C \Rightarrow Effect(t) = 0$):** The value of the function at iteration $t$ is equal to zero. That is, the number of attending agents is the same as the bar capacity. This is the ideal case where the participating agents made the right decision, as they get positive individual utilities. Moreover, agents who choose to stay at home have also made a correct decision, since the bar was not under-crowded, and in case they decided to participate, the bar would be over-crowded. The value of the *Effect()* function for both types of agents must be equally the same for their right decision.

- **Over-crowded case ($att^t > C \Rightarrow Effect(t) < 0$):** In the last case, the negative value implies the over-crowded situation of the bar, and shows the incorrect decision. The value presents the number of extra attendees that made the bar crowded. Hence, the agent is willing to change the decision in future iterations.

The effect value of the agent who did not attend the bar is considered zero, regardless of the status of the bar. The main reason is to preserve the condition that an agent that stayed at home should not have any information about the over-crowded or under-crowded situation of the bar.

To show how the *Effect()* function discriminates over-crowded cases as well as under-crowded ones, consider an agent $a_i$'s experiences in two different iterations of $t_1$ and $t_2$. The *Effect*($t_1$) and *Effect*($t_2$) have the same sign. If they both are positive ($0 < Effect(t_1) < Effect(t_2)$), the one with lower value ($t_1$) will be close to equilibrium. The value of the *Effect()* function illustrates the number of needed agents to complete the bar capacity. Besides, the social utility of $t_1$ is higher, since the number of free seats is less. In the second case, if they both are negative ($Effect(t_2) < Effect(t_1) < 0$), the one with higher value ($t_1$) is favored. The reason is that the *Effect()* function represents the number of extra attendance. To conclude, the distance of the value from zero shows how far the system is to the equilibrium.

## 4.2 The Social Coordination Constraint

Potentially, the *Effect()* function can be used to lead the system to equilibrium, but it does not inhibit the starvation problem. Assuming a case in which a group of agents always attend the bar and the rest of them do not try it at all is a good example. To cope with this issue, a new constraint is defined, which is called *social coordination ($C_a$)*. Agents that reach $C_a$ accesses to the bar, will abstain themselves for new access attempts to prevent possible congestions. It defines an optimum limit and a fair quota for an agent in attending the bar without facing any congestion.

The $C_a$ is computed according to the bar capacity ($C$), the population of agents ($n$), and the history length ($h$). In Eq.9, $C_a$ is the total bar capacity during the $h$ iterations (Eq.8) divided by the number of agents.

$$C_h = h \times C \qquad (8)$$
$$C_a = \frac{C_h}{n} = \frac{h \times C}{n} \qquad (9)$$

## 4.3 Decision-making Process

In the devised method, the decision process of an agent has a two-dimensional approach. The first dimension is the effect of each iteration. The second dimension is the history of an agent during the past $h$ iterations. To combine these factors, we define a pre-decision parameter $pd_i^t$ that denotes the pre-decision of agent $a_i$ at iteration $t$. It is computed according to Eq.10. It is worth mentioning that if an agent does not attend the bar in an iteration ($d_i^t = 0$), it will not have any effect on the pre-decision parameter.

$$pd_i^t = \sum_{\tau=t-h}^{t-1} (Effect(\tau) \times d_i^\tau) \qquad (10)$$

In the first $h$ iterations, agents randomly choose to join the bar or stay at home. After these setup iterations, agents select a proper strategy according to their pre-decision value. In the following, these cases are introduced.

**The Negative Value of Pre-decision:** The negative value of $pd_i^t$ indicates that the overcrowded experiences dominate the pleasant ones. Thus, $a_i$ decides to stay at home to prevent the continuity of this situation (Eq.11).

$$\textbf{Strategy 1:} \quad pd_i^t < 0 \Rightarrow d_i^t = 0 \qquad (11)$$

**The Zero Value of Pre-decision:** There are two cases in which the zero value for the pre-decision parameter can be obtained. In the first case, the summation of the positive effects and the negative ones is zero. The case implies that neither the positive effects are encouraging enough to attend the bar, nor the negative effects are strong enough to stay at home. Therefore, $a_i$ will decide to stay at home (Eq.12).

$$\textbf{Strategy 2:} \quad (pd_i^t = 0) \quad \text{and} \quad (\exists \tau : t-h \le \tau < t, Effect(\tau) < 0) \Rightarrow d_i^t = 0 \qquad (12)$$

In the second case, all the $Effect(\tau)$ values of the past $h$ iterations are zero. This is due to the prevention of the agent from going to the bar, or the equilibrium state of the bar is reached. Therefore, the agent considers the number of times that he/she attends the bar, and compares it with the social coordination constraint. If the value is below the $C_a$ threshold, it has not benefited enough from the bar. So, he will decide to go to the bar (Eq.13). On the other hand, if he attends more than the $C_a$ threshold, he will decide to stay at home to prevent further congestion (Eq.14). In this case, $C_a$ constraint plays a social coordination role among agents.
$$ \textbf{Strategy 3:} \quad (pd_i^t = 0) \quad \text{and} \quad (\forall \tau : t-h \le \tau < t, \text{Effect}(\tau) = 0) \\ \text{and} \quad \left( \sum_{\tau=t-h}^{t} d_i^\tau \ge C_a \right) \Rightarrow d_i^t = 0 \quad (13) $$

$$ \textbf{Strategy 4:} \quad (pd_i^t = 0) \quad \text{and} \quad (\forall \tau : t-h \le \tau < t, \text{Effect}(\tau) = 0) \\ \text{and} \quad \left( \sum_{\tau=t-h}^{t} d_i^\tau < C_a \right) \Rightarrow d_i^t = 1 \quad (14) $$

**The Positive Value of Pre-decision** In the last case, the value of $pd_i^t$ is positive. It indicates that the overall effects of the previous experiences are positive and the agent is encouraged to continue this trend. The main obstacle is the starvation of the other agents. To avoid the problem, the agent counts the number of times he attended the bar. If the number is below the $C_a$, he will attend the bar (Eq.15), otherwise, he will choose to stay at home (Eq.16).

$$ \textbf{Strategy 5:} \quad (pd_i^t > 0) \quad \text{and} \quad \left( \sum_{\tau=t-h}^{t} d_i^\tau \ge C_a \right) \Rightarrow d_i^t = 0 \quad (15) $$

$$ \textbf{Strategy 6:} \quad (pd_i^t > 0) \quad \text{and} \quad \left( \sum_{\tau=t-h}^{t} d_i^\tau < C_a \right) \Rightarrow d_i^t = 1 \quad (16) $$

## 4.4 Discussion on the Convergence Stability

The stability of El Farol after reaching equilibrium is analyzed with an example. Table 1 exhibits five consecutive sample iterations that the system converges to an equilibrium, where each row of the table presents ten agents. Let the bar capacity be sixty, and the number of agents is one hundred, where each agent remembers his last five iterations. The number of attendees in each iteration is sixty. The optimum number of participation for each agent in five iterations is three (according to Eq.9). It is expected for each agent to go to the bar three times during every five consecutive iterations in an equilibrium state (Eq.17).

$$ \frac{h \times C}{n} = \frac{5 \times 60}{100} = 3 \quad (17) $$

Considering that the system is in the optimum state, we analyze the situation of agents in iteration $E^{t^6}$. To make a decision for the next iteration ($E^{t^6}$), each agent checks its last four iterations ($E^{t^2}$ to $E^{t^5}$). If he went to the bar three times during the last four iterations, he would not attend the bar for the current one to protect his individual utility as well as the social utility. Consequently, there will be no congestion. According to Table 1, sixty agents attend the bar in the first iteration. These are agents that join the bar only two times from $E^{t^2}$
<table><caption>**Table 1.** The bar condition in a five sample consecutive iterations</caption><thead><tr><th>Agents</th><th>E<sup>t1</sup></th><th>E<sup>t2</sup></th><th>E<sup>t3</sup></th><th>E<sup>t4</sup></th><th>E<sup>t5</sup></th><th>E<sup>t6</sup></th><th>E<sup>t7</sup></th></tr></thead><tbody><tr><td>a<sub>i:i=1,2,...,10</sub></td><td>×</td><td></td><td>×</td><td></td><td>×</td><td></td><td></td></tr><tr><td>a<sub>i:i=11,12,...,20</sub></td><td></td><td>×</td><td>×</td><td></td><td>×</td><td></td><td></td></tr><tr><td>a<sub>i:i=21,22,...,30</sub></td><td>×</td><td>×</td><td></td><td></td><td>×</td><td></td><td></td></tr><tr><td>a<sub>i:i=31,32,...,40</sub></td><td>×</td><td>×</td><td></td><td></td><td>×</td><td></td><td></td></tr><tr><td>a<sub>i:i=41,42,...,50</sub></td><td></td><td>×</td><td></td><td>×</td><td>×</td><td></td><td></td></tr><tr><td>a<sub>i:i=51,52,...,60</sub></td><td>×</td><td></td><td>×</td><td>×</td><td></td><td></td><td></td></tr><tr><td>a<sub>i:i=61,62,...,70</sub></td><td></td><td>×</td><td>×</td><td>×</td><td></td><td></td><td></td></tr><tr><td>a<sub>i:i=71,72,...,80</sub></td><td>×</td><td></td><td></td><td>×</td><td>×</td><td></td><td></td></tr><tr><td>a<sub>i:i=81,82,...,90</sub></td><td>×</td><td></td><td>×</td><td>×</td><td></td><td></td><td></td></tr><tr><td>a<sub>i:i=91,92,...,100</sub></td><td></td><td>×</td><td>×</td><td>×</td><td></td><td></td><td></td></tr></tbody></table>

to $E^{t5}$, and will decide to go to the bar again. On the other hand, the rest of agents that do not join the bar in the first iteration, have already gone to the bar for three times from $E^{t2}$ to $E^{t5}$, and will decide to stay at home.

It has to be mentioned that we used five setup iterations with an equilibrium status, but in the real world, these iterations happen randomly. That is the reason for the distinction between this example and our simulations in the next section.

# 5 Evaluation and Discussion

Before analyzing the performance of SoCo, we first present the simulation environment and its configuration. Then, the evaluation parameters and the comparing approaches are introduced. Finally, we present the simulation scenarios and discuss the results.

## 5.1 The Simulation Environment

We use Matlab R2012b to simulate the El Farol Bar Problem environment. It is a discrete time simulator that fits well with the problem. The main reason is its capabilities in modeling the problem as a set of matrices, and its speed in running thousands of iterations. Similar to the original definition of the El Farol Bar Problem [3], the number of agents is set to one hundred. But to analyze the scalability, we also use 200, 300, and 400 agents as well. The initial value of the bar capacity is sixty, and for the scalability scenarios, we apply 120, 180, and 240 seats. The applied values for agents' memory size (history) are 3, 5, 7, 9, 11, 13, and 15. Finally, the total number of iterations for each experiment is 2000 to reflect the behavior of the methods during the time. To reduce the effect of randomness, we repeated each experiment one hundred times, and present the mean values.

The evaluation parameters are social utility (which is the average over all iterations) (Eq.4), total individual utility (Eq.2), maximum starvation length
<table><caption>**Table 2.** The simulation configuration</caption><thead><tr><td>Parameter</td><td>Value(s)</td></tr></thead><tbody><tr><td>Number of agents (n)</td><td>100, 200, 300, 400</td></tr><tr><td>Bar capacity (C)</td><td>60,120,180,240</td></tr><tr><td>Total number of iterations (T)</td><td>2000</td></tr><tr><td>History size (h)</td><td>3,5,7,9,11,13,15</td></tr></tbody></table>

(Eq.6), and the scalability in the number of agents. We compare the performance of our approach with the researches presented in [9] and [10]. The study presented in [10] is one of the latest work on the El Farol Bar Problem that studied the effect of network topology (Von Neumann network) in social networks. Also, the work [9] is selected due to its emphasis on the starvation issue.

## 5.2 The Effect of History Size

Table 3 demonstrates the effect of history size on the individual and social utilities as well as the maximum starvation length in seven different history sizes. We repeated the simulations for one hundred times for each case and averaged the results. The results show that larger history sizes lead to longer starvation. The history length of five performs the best individual and social utilities. Besides, it has a comparatively low starvation length. Due to this, we used $h = 5$ in the rest of the simulations.

## 5.3 The Analysis of Social Utility

The main objective of the El Farol Bar Problem is to maximize social utility. Figures 1, 2, and 3 demonstrate the overall performance of the methods according to this metric. The X axis shows the iterations (weeks), and the Y axis is the social utility of the iterations. The social utility of agents in each iteration for

<table><caption>**Table 3.** The effect of history size</caption><thead><tr><td>History Size</td><td>Total Individual Utility (mean)</td><td>Social Utility (mean)</td><td>Max Starvation Length (mean)</td></tr></thead><tbody><tr><td>3</td><td>481.93</td><td>24.10</td><td>2.94</td></tr><tr><td>5</td><td>873.72</td><td>43.69</td><td>2.66</td></tr><tr><td>7</td><td>824.48</td><td>41.22</td><td>3.5463</td></tr><tr><td>9</td><td>864.08</td><td>43.20</td><td>4.01</td></tr><tr><td>11</td><td>778.24</td><td>38.91</td><td>6.79</td></tr><tr><td>13</td><td>833.30</td><td>41.67</td><td>6.50</td></tr><tr><td>15</td><td>331.17</td><td>16.56</td><td>18.19</td></tr></tbody></table>
*Adaptive Parasitized* method is presented in Figure 1. The figure shows that it is relatively low in the starting iterations and slowly rises until it reaches near the optimum point. The main reason for the low social utility at early iterations is the randomly chosen parameters of *C*ᵢ (frequency of attendance for agent *a*ᵢ) and *P*ᵢ (time step until the next attendance of agent *a*ᵢ). The average social utility of the system during the 2000 iteration is 19.09. Its minimum number is 5.24, and the maximum is 49.12.

Figure 2 demonstrates the social utility of the *Good Society* method for each iteration. The utility fluctuates between positive and negative values. The main reason is that the numbers of attendees oscillate around the bar capacity. Although in some iterations the number of attendees is near the optimum, in some others the over-crowded case happens. Therefore, all agents get negative points, and it results in the poor social utility of the system. The average social utility of the method is -5.74, and the values are bounded to -28.54 and 48.40.

Figure 3 shows the results for *SoCo*, which is closer to the optimum point compared to the other two methods. The social coordination mechanism (*C*<sub>a</sub>) suppresses the participants that cause congestion. Besides, the *Effect* function

<figure><img src="image_3.png" /><figcaption>**Fig. 1.** The social utility of *Adaptive Parasitized* sitized [9].

**Fig. 2.** The social utility of *Good Society*

[10].</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig. 3. The social utility of SoCo.</figcaption></figure>
persuades agents to attend the bar based on the previous iterations. The mean social utility of the system in this method is 46.56. The minimum and maximum values of the gained social utility are 42.71 and 50.11.

## 5.4 The Analysis of Total Individual Utility

In this simulation, we analyze the performance of the methods from the total individual utility point of view. Figures 4, 5, and 6 depict the achieved results for *Adaptive Parasitized*, *Good Society*, and *SoCo* methods in 2000 iterations (weeks), respectively. The horizontal axis shows agents, and the vertical one is the gained total individual utility of agents. Due to small fluctuations of *SoCo* method in Figure 6, we heightened the chart in Figure 7.

According to the achieved results, the individual utilities of agents in *Adaptive Parasitized* are bounded to 334.30 and 452.62 with the average value of 381.83. The *Good Society* method does not provide promising results. The best value gained by an agent is -93.23, and worst value is -136.73. Considering that the

<figure><img src="image_5.png" /><figcaption>Fig. 4. The total individual utility of agents in *Adaptive Parasitized* [9].</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 5. The total individual utility of agents *Good Society* [10].</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. The total individual utility of agents in *SoCo*.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Fig. 7. The total individual utility of agents in *SoCo* (magnified).</figcaption></figure>
bar has sixty seats, in the best case, each agent may receive total individual utility of 1200 in 2000 iterations. In the proposed method, the total individual utilities of agents are between 906.74 and 986.40 with the mean value of 931.29. The distance between the highest and the lowest achieved values are 30.07% in *Adaptive Parasitized* and 8.41% in *SoCo*.

## 5.5 The Maximum Starvation Length

One of the secondary goals of the devised method is to minimize the starvation length of agents in accessing the bar. Figures 8, 9, and 10 present the results for *Adaptive Parasitized* [9], *Good Society* [10], and *SoCo*, respectively. The horizontal axis represents agents, and the vertical one shows the maximum starvation length of the agent during the 2000 iterations.

In the *Adaptive Parasitized* method, a less rigorous definition of maximum starvation length is provided, which indicates the maximum consecutive times that an agent does not intend to join the bar. The definition does not consider

<figure><img src="image_9.png" /><figcaption>**Fig. 8.** The maximum starvation length of agents in *Adaptive Parasitized* [9].</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>**Fig. 9.** The maximum starvation length of agents in *Good Society* [10].</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>**Fig. 10.** The maximum starvation length of agents in *SoCo*.</figcaption></figure>
the cases in which an agent attends the over-crowded bar. The maximum star-
vation length of the method, according to the above definition, is equal to the
threshold, which is set to 15 to achieve the best social utility. We rigorously rede-
fine the maximum starvation length. Based on the new definition, the maximum
starvation length of agents in *Adaptive Parasitized* method is bounded to 19.87
and 22.52 with the mean value of 21.10. Figure 8 reveals the results.

Figure 9 depicts the outcome of the *Good Society* method. The mean value of maximum starvation of agents is 31.23. The highest value is 37.82, and the lower one is 26.26.

The *SoCo* achieves the best results. They are bounded to 2.36 and 2.88 with an average of 2.63. It is almost eight times less than *Adaptive Parasitized* method, and about eleven times less than *Good Society* method. Moreover, *Adaptive Parasitized* method needs to divide the agents into casual and regular classes, whereas *SoCo* method does not require any classification of agents. The winning point of our devised approach is the social coordination factor (*C*<sub>a</sub>), which brings equilibrium in accessing the bar.

5.6 Scalability

The last evaluation scenario is the scalability of the devised method. Figures 11, 12, 13, and 14 show the results for 100, 200, 300, and 400 agents, respectively. We used the total individual utility metric to compare these cases since its range does not change with the number of agents. In Figure 11, one hundred agents are competing for seats of the bar. The total individual utility of agents are in the range of 866.60 and 1000.30. Figure 12 shows a similar experiment for 200 agents in which their gained total individual utility is between 999.20 and 1000.5. The results for 300 and 400 agents are similar to the previous ones. The simulation outcome demonstrates that the devised approach is scalable in terms of the number of participating agents. This is in contrast to *good society* method, where the performance degrades by surging the number of agents.

<figure><img src="image_12.png" /><figcaption>**Fig. 11.** The individual utility of agents for n=100.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>**Fig. 12.** The individual utility of agents for n=200.</figcaption></figure>
<figure><img src="image_14.png" /><figcaption>**Fig. 13.** The individual utility of agents for $n=300$.</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>**Fig. 14.** The individual utility of agents for $n=400$.</figcaption></figure>

# 6 Conclusion

In the lack of a central coordinator, the establishment of a self-coordination mechanism for accessing a limited resource is a common problem that a variety of systems are facing. The classic El Farol Bar Problem models the situation, where a number of citizens may decide to go to the bar with a limited capacity. According to the number of attendees, they may receive a negative utility if the bar is over-crowded, positive utility if it is not over-crowded, or zero utility if they do not attend the bar. Agents’ decision is only based on their previous experiments. In this paper, we introduced a new method that applied a two-dimensional approach. The main idea was to use some details of each iteration as well as the agents’ past experiences. For the first case, we defined a new function called *Effect()* that discriminates over-crowded cases from each other, as well as under-crowded ones. For the second case, we introduced a new *social coordination* parameter that hindered agents from overusing the resource. The simulation results showed the performance of the devised approach in terms of convergence speed, social utility, total individual utility, starvation length.

As future work, we are going to apply this method to various applications such as energy consumption in smart homes, public transportation, and network traffic.
Bibliography

[1] H.Franks, N.Griffiths, and A.Jhumka. Manipulating convention emergence using influencer agents. *Autonomous Agents and Multi-Agent Systems*, 26(3):315-353, 2013.

[2] K.Tuyls, PJT.Hoen, and B.Vanschoenwinkel. An evolutionary dynamical analysis of multi-agent learning in iterated games. *Autonomous Agents and Multi-Agent Systems*, 12(1):115-153, 2006.

[3] W.B.Arthur. Inductive reasoning and bounded rationality. *The American economic review*, 84(2):406-411, 1994.

[4] D.Challet and YC.Zhang. On the minority game: Analytical and numerical studies. *Physica A: Statistical Mechanics and its Applications*, 256(3):514-532, 1998.

[5] K.Tumer and S.Proper. Coordinating actions in congestion games: impact of top-down and bottom-up utilities. *Autonomous Agents and Multi-Agent Systems*, 27(3):419-443, 2013.

[6] D.D.Baccan and L.Macedo. Are markets more efficient when cognitive agents act rationally? evidence from the El Farol. In *16th Portuguese Conf. on Artificial Intelligence*, pages 438-449, 2013.

[7] DDA.Baccan and L.Macedo. Revisiting the El Farol problem: a cognitive modeling approach. In *Intl. Workshop on Multi-Agent Systems and Agent-Based Simulation*, pages 56-68. Springer, 2012.

[8] AN.Bell and WA.Sethares. The El Farol problem and the internet: Con- gestion and coordination failure. In *Fifth Intl. Conf. of the Society for Computational Economics*, Boston, MA, 1999.

[9] F.Sheikhha, H.Tabatabaee Malazi, and R.Amjadifard. Adaptive parasitized El Farol bar problem. In *Computer Science and Information Engineering, WRI World Cong. on*, volume 7, pages 422-426. IEEE, 2009.

[10] SH.Chen and U.Gostoli. Coordination in the El Farol bar problem: The role of social preferences and social networks. *Journal of Economic Interaction and Coordination*, 12(1):59-93, 2017.

[11] SH.Chen and U.Gostoli. On the complexity of the El Farol bar game: a sensitivity analysis. *Evolutionary Intelligence*, 9(4):113-123, 2016.

[12] RS. Lazarus. *Emotion and adaptation*. Oxford University Press on Demand, 1991.

[13] R.Reisenzein. Emotions as meta representational states of mind: Natu-ralizing the belief-desire theory of emotion. *Cognitive Systems Research*, 10(1):6-20, 2009.

[14] D.Baccan, L.Macedo, and E.Sbruzzi. Is the El Farol more efficient when cognitive rational agents have a larger memory size? In *2014 IEEE Intl Conf. on Systems, Man, and Cybernetics*, pages 39-44. IEEE, 2014.

[15] MN.Szilagyi. The El Farol bar problem as an iterated n-person game. *Complex Systems*, 21(2):153, 2012.