https://doi.org/10.31449/inf.v42i4.1282 Informatica 42 (2018) 563–576 563 A Category-theoretic Approach to Organization-based Modeling of Multi Agent Systems on the Basis of Collective Phenomena and Organizations in Human Societies Abderrahim Siam ICOSI Lab University, Abbes Laghrour khenchela BP 1252 El Houria 40004 Khenchela, Algeria E-mail: siamabderrahim@gmail.com Ramdane Maamri Lab Lire University Mahri Abdelhamid Contantina, Algeria E-mail: rmaamri @yahoo.fr Keywords: multi-agent systems, organization, category theory Received: June 30, 2016 This paper presents an idea of using category theory for developing organizational multi-agent systems by taking inspiration from collective phenomena and organizations in human societies. Category theory is used for studying and formalizing organizations and collective phenomena in human societies with the aim of capturing their logics into categorical models. Afterward, the captured models are mapped categor- ically to categorical MAS organizational models. This way of thinking allows studying properties of result MAS organizational models as well as properties of organizations in human societies such as stability and adaptation before taking them as landmarks for developing MAS organizational models. Povzetek: Predstavljeno je modeliranje multiagentnih sistemov na osnovi kolektivnega delovanja ˇ cloveških združb. 1 Introduction Several characteristics have emerged as essential in nowa- days computer applications seeing that the widespread of software use in the various fields and the pervasiveness of information processing tools in all equipments around us and which are embedded with more and more means of communication. Applications must be increasingly dis- tributed, open, adaptable and robust. Moreover, a great complexity characterizes software and their development processes. Multi-agent systems often abbreviated MASs and orga- nizational MASs approaches, in which MASs are analyzed and designed as computational organizations using social concepts, present privileged solutions to develop applica- tions outlined above. This is due to their interesting fea- tures such as the proposed abstractions for structuring the software as combinations of entities in interactions; the in- troducing of concepts with very high levels of abstraction as agents, plans, roles and organizations; and the flexi- ble coupling that MASs offer through indirect interaction modes and the late binding between agents in such a way that the determination of the action to execute and the en- tity responsible for its execution can be postponed as late as possible. The most interesting features of agent-based approaches include the possibility to combine agents and MASs with other development paradigms and technologies in order to strengthen agents and MASs with other interesting fea- tures. In several works, the agent based development paradigm is combined with the component based devel- opment [1]. Although agents and MASs are real techno- logical advances if compared to software components, the component based development has reached a stage of ma- turity and preserves some assets such as good structuring of applications with variable granularities, reuse of com- ponents as well as possibilities of dynamic adaptation of component based applications by adding, removing, substi- tuting components or reassembling and reconfiguring com- ponent assemblies. Agents and components are combined in various forms in several works. In [2],[3],[4], and [5] as well as in numerous other works, agents via their ca- pacities of negotiation are used to assist component based development. For example, this assistance takes forms of classification, research and rapid selection of reusable com- ponents, matching between components and assisting ef- fective assemblies of components. In another alternative, the maturity of components in structuring and deploying software as well as possibilities of automatic assemblies of components encouraged the use of components as building units to construct agents. This form of combination ap- pears is several works such as [6],[7] and [8]. Other forms of combination of agents and components may be found in the literature. Among the works where the components are used to build agents, we are particularly interested in the works of Siam et al [8] where software components are 564 Informatica 42 (2018) 563–576 S. Abderrahim et al. used to build self-adaptable agents that form an organiza- tion in which agents are grouped into coalition groups. The consideration of a social or organizational stand- point as framework for analysis and design presents an im- portant key to develop MASs, notably open and adaptive ones. The organization is concerned with defining, manag- ing and changing the relationships between agents. It cor- responds to the concept linking the description of a society of agents and that of control and coordination activities. The concept of organization was the subject of numerous works giving birth to an even greater number of MAS or- ganizational models. These works are often inspired from sociology, social psychology, economics, ethology or cog- nitive science. However, inspirations processes from these disciplines were not driven with formal approaches that al- low for reasoning about inspired solutions as well as inspi- ration processes. In this paper, we are interested in looking for solu- tions for the organization of MASs by taking inspiration from collective phenomena and organizations in human so- cieties. First, we use the category theory CT concepts [9][10] to capture the logics of some collective phenomena and organizations in human societies. After that, the cap- tured logics serve as the basis for modeling categorically adaptive organizations of MASs in which agents are built based on software components. Category theory presents a sophisticated mathematical toolbox. It provides instru- ments that facilitate the modeling of complex situations and which involves structured objects. Concepts in category theory are typically formalized in terms of the relationships that each object exhibits to the other objects in the universe of discourse. Particularly, agents based methods as well as component based development methods; typically model the universe as a society of interacting elements. Also, col- lective phenomena in human societies may be described via interactions between individuals. Category theory proves a great power of expression. This power is the result of the composition of very natural and comprehensible construc- tions. Although category theory is not based on complex concepts, it is extremely powerful and it derives its power from the idea of composition. Category definition itself contains composition. In addition, it is possible to build categories of categories. Categories are to be composed in order to generate more abstract structures. With the ideas of compositional thinking and the possibilities of diagram- matical representation, categories can be very useful in ad- dressing a large range of problems and consequently that addressed in this paper. We present an approach for modeling organizations of MASs and verifying their proprieties. In this approach, we propose constructing models of organizations of MASs us- ing category theory on the basis of categorical models of social processes and organizations in human societies. The constructed models permit checking the organization pro- prieties such as stability. The stability of an organization of a multi agent system includes three important aspects. The first one concerns the degree to which social structures, es- tablished by the organization, resist disturbance. The sec- ond aspect concerns the convergence of a MAS to a valid organization when organizing, i.e., when a MAS decides to change the current organization for different reasons, does the process of organizing converges always to a valid orga- nization? The third aspect of organization stability depends on the frequency of changing organization; if the changes are less frequent, the organization is more stable. The paper is structured as follows: the second section presents important concepts related to multi-agent systems and organizations; the third section is devoted to present collective phenomena and organizations in human soci- eties; the fourth one provides a view on the category theory and its important concepts; in the fifth section, we show how category theory can assist in the articulation and the modeling of collective phenomena and organizations in hu- man societies primarily and how the logics of collective phenomena and organizations in human societies captured categorically serve as basis for modeling organizations of MAS; in the last section, we conclude the paper and define directions for future work. 2 Multi-agent systems and organization Multi-agent systems present an important and very use- ful development paradigm through an armada of tools and methodologies for constructing complex, open, distributed systems that can autonomously adapt to their environ- ments. The goal of research in multi-agent systems is to fig- ure out how a society of autonomous entities called agents can organize themselves in order to solve problems and produce global phenomena that each agent cannot solve or/and produce individually. MASs use social metaphor of the so-called social insects when agents are reactive or of human organizations when agents are cognitive. The organization of MASs is concerned with defining, managing and the change of relationship between agents. It presents a powerful technique to constrain autonomous agents to behave in such a way to meet overall goals. It corresponds to a concept linking the description of a soci- ety of agents and that of the control and coordination ac- tivities. The definition of the organization of MASs is not a subject of consensus. However, two significations may present extremities of the interval of organization defini- tions. In [11], an organization is defined as a collective entity with its own identity which is represented by a group of agents exhibiting highly formalized social structures. In [12], an organization is a scheme or a stable structure of joint activity that can constrain or affect the actions and interactions of agents for a specific goal. The MAS de- sign guided by the organization makes later implementa- tion questions and introduces concepts of very high level of abstraction such as roles and groups. MASs designed according to an organizational view may be equipped with mechanisms of reorganization or self-organization allow- A Category-theoretic Approach to Organization-based Modeling of. . . Informatica 42 (2018) 563–576 565 ing them to change their organizations by passing from one organization to another one in order to respond to environ- ments’ dynamics. When the organization is treated accord- ing to a self-organizational point of view, the organization is seen as a process where the degree of order increases with time, from less to more organized. Several organizational models of MAS have been devel- oped. Many of these models are inspired from organiza- tions in human societies. A survey of such models can be found in [13]. The organization of multi-agent systems may be seen from an angle of emergent phenomena in complex systems [14]. Indeed, the design of such systems focuses mainly on agents that compose the system. Accordingly, agents are the engines of the organization; organizations exist only as emergent and observable phenomena. According to this agent-centered view [15], emphasis is put on the agents by specifying and designing local behaviors and peer interac- tions. The global functionality of the system is the result of complex and dynamic interactions in the agent’s society. However, such design approaches often introduce unpre- dictable phenomena which cannot be checked in advance. The overall behavior is more than a simple juxtaposition of agents’ behaviors. Several studies on emergent phenomena in multi agent systems and multi agent simulations such as [16],[17] and [18] may be found in literature. In the opposite direction of the agent-centered point of view, organizations exist as explicit entities of system. Thus, the observer of the system can obtain a description of the organization. A pattern of cooperation is determined by the designer to define or constrain the behavior of agents. Works that are included into this direction may be catego- rized into two classes: approaches where the organization is specified and formalized but agents do not know about it and cannot reason on this subject. Examples of such ap- proaches are agent-oriented methods focusing on organiza- tional models as in INGENIAS [19] and MaSE [20]. The second class includes approaches where organizations are manipulated by both designer and agents. Agents have a representation of the organization and can perform organi- zational acts and potentially change the organization. AGR [21], ISLENDER [22] and the model proposed in [8] are examples of this class. It is remarkable that most of existing organizations of MAS are focused on the concept of role. A role presents an important organizational concept. It permits an organi- zational structuring of MASs. The concept of role has vari- ous meanings depending on the MAS organizational model and the context of its use. We will see later that the con- cept of role is an important concept also for organizations in human societies. 3 Human societies and organizations, landmarks and inspirations Collective phenomena and organizations in human soci- eties present a great source of inspiration for artificial orga- nizations and especially for MASs. Human societies have always produced collective behaviors patterns, allowing them to overcome the most of encountered problems and difficulties. Capturing logics of collective phenomena and organizations in human societies for the sake of reproduc- ing them requires thorough observation and in-depth stud- ies of human societies. Nevertheless, these observations and studies are the core of sociology. Sociological studies and the studies produced by psychologists, economists and AI searchers offer tremendous beneficial potential for ex- ploration and exploitation to bring out landmarks suscep- tible to serve as basis for developing organization based multi-agent systems. We can distinguish two main ele- ments in human societies, whose study would allow the discovery of several models that could be operationalized and reproduced for developing more effective and efficient MASs. The first element is social processes, and the sec- ond, organizations. 3.1 Social processes A social process may be defined as the observable and repetitive patterns of social interaction that have a consis- tent direction or quality [23]. It may be seen as a way in which individuals and groups interact and establish rela- tionships and models of behaviors. These relationships and models are permanently adjusted and modified through so- cial interactions. This concept refers to some of the general and persistent forms that social interaction may assume, i.e., forms of social interactions or mutual activities that occur repeatedly [23]. We use a large-scale process, drawn from classical so- cial theory to illustrate how category theory can assist, at first, in the articulation and the capturing of logics of com- plex social phenomena. In a second time, captured log- ics formalized in terms of categorical concepts serve as metaphors and starting points for categorical MASs mod- eling. The used process which is presented below is the circulation of elites [24]. In sociological literature, several social processes may be found along with various works aimed at using formal models to describe them. For ex- amples, in [25] and [26] as well as in several other works, investigations have explored the possible applicability of mathematical chaos theory [27] to the social sciences. In [28], Attractor models have been used in the formulations of some social processes. In the circulation of elite process, sociologist and economist Vilfredo Pareto divided social classes into mass class and elite class [24]. According to him, the elite dis- tinguishes itself by its eminent qualities, its natural and 566 Informatica 42 (2018) 563–576 S. Abderrahim et al. psychological superiority. It is made up of all those who exhibit exceptional qualities and eminent aptitudes within their sphere of activity. It contains both governmental and non-governmental elites. Elite individuals perpetually rise from the mass; the ruling elite have the choice to fight emerging non ruling elite or integrate it, until the ruling one is finally defeated or replaced. Pareto observes elite re- newal and replacement, or, on the contrary, its closure. The formation of counter-elite at the moment of the appearance of degeneration symptoms of the ruling class appeared to him as the dynamic constituent of history. This social process may be abstracted as the interaction of three elements. The first one is the gradual degradation of the ruling elite; the second consists of the inherent will- ingness of the most talented members of the non-elite to up- grade; the third element is the degree of facility for rising to a higher social position permitted by prevailing social structure imposed by the ruling elite. Facility for rising to a higher social or economic position is known in sociology as "upward mobility". Depending on whether this mobility is relatively open or closed, the elite is continually reconsti- tuted by incorporating new talented members and eliminat- ing unworthy ones; or, talented and aggressive non-ruling elites accumulate within the non-ruling elite causing insta- bility. 3.2 Organization An organization is a social entity in which the members thereof perform predefined functions. In human societies, the organization allows the coordination of complex behav- iors. The changes in human societies, as the emergence of large organizations such as the army and the administra- tion instead of artisan corporations, large families and other forms of organizations, demonstrates that human societies change its trends of thinking about social life. The replace- ment of the behaviors based on common values or social norms by behaviors directed by a more systematic search for efficiency is an instrumental logic which subordinates any action to objectives, purposes. Organizational theory [29] tries to query this instrumental rationality and its con- crete expression in the organization in several directions such as: analysis of rationality and decision making, anal- ysis of relationships of dependence and power and analysis of the dynamics of change. The study of organizations in the human societies en- ables for the identification of several different organizations which can be classified and cataloged according to various points of view and criteria. For examples, the following kinds of organization may be identified in human societies: the single person organization which is the simplest orga- nization, bureaucracy structure organizations [29], matrix structure organizations [29] and team structure organiza- tions [29]. The organization refers at the same time to the process of organizing and the result of this process. The study of an organization (existing or a new one to define) consists in: analyzing how it works, identifying its main features, accentuating the pertinent characteristics of the members, pointing out the roles adopted by members and the member relationships, identifying norms and rules that oversee the organization as well as the chain of command, specifying how tasks are subdivided into independent and formalized subtasks, identifying which of subtasks have dependencies, defining how and by what means tasks may be grouped and pointing out where/when decisions have to be made. We can notice that the issues discussed above present the same concerns to be addressed by a designer in the anal- ysis and the design of an organization based multi-agent system added to the defining of environment proprieties to be considered such as openness and dynamicity as well as constraints related to the operationalization of organization computing. In this paper, we present team and group structure as ex- amples of organizations for the purpose of illustrating how category theory can help in capturing of functioning logics of these organizations and which are subsequently mapped to organization based multi-MASs. Group and team are not the same. We use the term crew to cover both groups and teams. A crew structure is an organic organization. Contrary to mechanical organizations where tasks are pre- cisely defined and broken down into separated and special- ized parts, in organic organizations, tasks are adjusted and redefined by means of collaborative work in crews. In a crew based organization, an organization consists of a set of crews. Crews represent a system with several actors that share the common goal of accomplishing the crew’s global task. The global task of a crew is fractionalized into sub- tasks which are assigned to members of the crew vis-à-vis members’ degrees of qualifications. 3.2.1 Group structure organizations In human societies, a group may be defined as two or more individuals, interacting and interdependent, who have come together to achieve particular objectives [29]. Groups may be formal or informal. A formal group is defined by the organization’s structure, with designated work assign- ments establishing tasks. In formal groups, the behaviors group members should engage in are stipulated by and di- rected toward organizational goals [29]. An informal group is a group that is neither formally structured nor organiza- tionally determined; such a group appears in response to the need for social contact [29]. One of the key concepts behind the concept of group in human societies is what is called social identity. It is perspective that considers when and why individuals con- sider themselves members of groups [29]. It helps peo- ple reduce uncertainty about who they are and what they should do [29]. Several characteristics make a social iden- tity important to a person. Mainly, similarity and distinc- tiveness; people who have the same values or character- istics as other members of their organization have higher levels of group identification; people are more likely to no- A Category-theoretic Approach to Organization-based Modeling of. . . Informatica 42 (2018) 563–576 567 tice identities that show how they are different from other groups [29]. According to [29], Groups generally pass through a sequence of five stages in their evolution. The first stage (forming stage) is characterized by uncertainty about the group’s purpose, structure, and leadership. Mem- bers try to determine what types of behaviors are accept- able. This stage is completed when members have begun to think of themselves as part of a group. In the second stage called storming stage , members accept the existence of the group but resist the constraints it imposes on individ- uality. There is conflict over who will control the group. In the third stage, the group demonstrates cohesiveness with a strong sense of group identity. This stage is called norm- ing stage, it is complete when the group structure solidifies and the group has assimilated a common set of expectations of what defines correct member behavior. For temporary groups, the stage four (performing stage) is for wrapping up activities and preparing to disband. Some group mem- bers are upbeat, basking in the group’s accomplishments. In the last stage called adjourning stage, the structure is fully functional. Group energy has moved from getting to know and understand each other to performing the task at hand. For permanent work groups, this stage is the last one in development. Groups have properties that format members’ behavior and allow the explaining of individual behavior within the group besides the performance of the group. These proprieties include [29] roles, norms, status, size, cohesiveness, and diversity. According to [29], a role may be defined as a set of par- ticular behavior patterns attributed to an actor occupying a given position in a social unit. Norms are acceptable stan- dards of behavior shared by members of a group. Norms express what members ought and ought not to do under cer- tain circumstances. When become a member of a group7, its norms influence members’ behavior with a minimum of external controls. Members are susceptible to conform- ing to the group’s norms. This conformity means the ad- justment of one’s behavior to align with the norms of the group. Different groups, communities, and societies have different norms, but they all have them. Status is a socially defined position given to groups or group members by oth- ers. Status can help to differentiate members in group and may be an important motivator when individuals perceive a disparity between what they believe their status is and what others perceive it to be. Status tends to derive from one of three sources: the power a person wields over others; the person’s ability to contribute to a group’s goals and the in- dividual’s personal characteristics. Each group is charac- terized by a size. It has influence on its overall behavior in the sense that individuals perform better in smaller groups which are faster at completing tasks than larger ones. Con- versely, large groups consistently get better results than their smaller ones. It seems that individuals have tendency to expend less effort when working collectively than alone. The Cohesiveness of a group expresses the degree to which members are attracted to each other and motivated to stay in this one. Cohesiveness has influence on group’s produc- tivity. Finally, the diversity in a group expresses the degree to which its members are similar to, or different from, one another. This propriety appears to increase group conflict. One of the most important points when studying a group is the group decision making. Group decisions compared to those made by an individual alone have advantages in the sense that groups generate more complete information and knowledge; groups take more input and heterogeneity into the decision process as well as they offer a wider range of points of view. This allows obtaining more approaches and alternatives. However, Group decisions are time con- suming; discussions in the group can be dominated by a few members; and group decisions suffer from ambiguous responsibility. 3.2.2 Team structure organizations Work teams are different from work groups. In groups, members interact primarily to share information and make decisions to help each member perform within his area of responsibility [29]. The group performance is simply the sum of contributions of the group members. The group is not able to reach the advanced level of collaboration and cooperation that would create an overall level of perfor- mance superior than the sum of the inputs. Work teams are characterized by positive synergy that means cooperation of two or more substances, or to produce a combined ef- fect greater than the sum of their separate effects. When an organization is oriented work teams rather than groups, it creates the potential for to generate more outputs without increasing inputs. In teams, skills are complementary, un- like groups where skills are random and varied. Teams are crews as well as groups; according to [29], effective teams have characteristics related to their key components orga- nized into three general categories summarized in Table 1. The most common types of teams in an organization are: problem-solving teams, self managed work teams, cross-functional teams, and virtual teams [29]. In problem- solving teams, members discuss ways of improving quality, efficiency, and the work environment. Generally, problem- solving teams have not authority to implement any of their suggestions, i.e., problem-solving teams make recommen- dations only. Self managed work teams make recommen- dations, propose solutions and implement them. Members of such teams perform: planning and scheduling work, as- signing tasks to members, making operating decisions, tak- ing action on problems, and working with suppliers and customers. Cross-functional teams are constituted of em- ployees from the same hierarchical level but different work areas, who are regrouped together to accomplish a task. Virtual teams are teams that use computer technology to link together physically detached members in considera- tion of achieving a common goal. 568 Informatica 42 (2018) 563–576 S. Abderrahim et al. Context. Composition. Process. Adequate resources Abilities of members Common purpose Leadership Personality Specific goals Structure Allocating roles Team efficacy Climate of trust Diversity Conflict levels Performance Size of teams Social loafing Evaluation Member flexibility reward systems Member preferences Table 1: Effective teams characteristics. 4 Category theory, key concepts, applicability and applications The effective way of dealing with complexity in order to represent and reasoning about required information to build computer systems is via formal methods. Among the most effective methods and which is adequately capable of ad- dressing structures is the category theory [9],[10]. Category theory is a sophisticated mathematical tool- box. It provides instruments that make easier the model- ing of complex situations and that involve structured ob- jects. Concepts in category theory are typically formalized in terms of the relationships that each object exhibits to the other objects in the universe of discourse. This way of thinking is totally different from set theory in which con- cepts are formalized extensionally in the sense that a set is defined by its elements. The focus on social aspect of objects lives is the reason of applying CT to software en- gineering as well as for synthesizing social theory. Partic- ularly, agents based methods as well as component based development methods; typically model the universe as a society of interacting elements. Likewise, human societies are subject to the same vision. Our objective is to develop organization based MASs by taking inspiration from social processes and organiza- tions that have proven their success and effectiveness in human societies. For the reasons outlined in the intro- duction, agents that constitute such MASs are self adap- tive component-based agents in accordance with the agent model presented in [8]. MASs development methods, com- ponent based development methods and the social theory present three different areas. In these areas, and partic- ularly in the social theory, the perspective of represent- ing collective phenomena and social processes at multi- ple scales and with any level of details is highly probable to produce complex and interlaced models. The lack of mathematical formalization can make the results of apply- ing these models hard to validate and render them difficult to reproduce. One solution to managing the conceptual and computational complexity of social models is to move them toward a higher level of abstraction. The CT may be involved to formalize these models and exploring their potential interaction. In one hand, category theory is able to integrate diverse areas and provides a com- mon language which can be applied to deal with the di- versity of social theories in the synthesis of social theory, as well as dealing with agents, MAS organizational con- cepts and software components with the same terms. Cat- egory theory not only allows these areas to be expressed in the same categorical terms, it also provides a basis for their possible integration. In the other hand, category the- ory supplements firm equality with weakened definitions of equivalence relations and/or classes. This propriety makes important contribution in studying areas in which concepts involve proximity assessments which is the case of social analysis as well as organizations in MASs. The potential is to address qualitative concepts with greater precision. Cat- egory theory can assist in the articulation of complex social phenomena and organizations in human societies; it helps to capture logics of validated phenomena from the domain of human societies and move them to the domain of organi- zations of MASs, categorically. The coherence of such cat- egorical transformations makes a direct and important con- tribution to the process of validating MAS organizational models. 4.1 Some category theory concepts and notations A categoryC consists of objects and morphisms with com- position, identity, associativity and unit. Objects a;b;c; . . . etc are denoted ob(C). Morphisms f;g;h; . . . etc de- notedhom(C)where, for each morphismg there are given objects: dom(g) and cod(g) called the domain and the codomain of g. The notation g : a! b indicates that a = dom(g) and b = cod(g). Given the objects a;b;c andd ofC and morphismsf : a! b andg : b! c, withcod(f) = dom(g), there is a given morphism: gof : a! c, called the composite offandg. For each objecta there is a given morphimida :a! a, called the identity morphism ofa. A categoryC is characterized by the associativity which means that for the morphisms f : a! b;g : b! c andh : c! d;ho(gof) = (hog)of. The unit propriety means that foida = f = idbof, for all f : a ! b. A discrete category is a category where the morphisms are only identity morphisms. An initial object in a cate- gory C is an object for which every other object of C is a codomain of a unique morphism with the initial object A Category-theoretic Approach to Organization-based Modeling of. . . Informatica 42 (2018) 563–576 569 as a domain. A terminal object has every object of C as the domain of a unique morphism where the terminal ob- ject is a codomain. Formally, in a categoryC an object is called initial objecto if for any other objecta inC, there is a unique morphismo! a. An object is called termi- nal objectt if for any other objecta inC, there is unique morphism a! t. In the case where objects of a cate- gory are categories, morphisms are called functor. A func- torF :C! D between categoriesC andD is a structure preserving mapping of objects to objects and morphisms to morphisms with: F (f : A! B) = F (f) : F (A)! F (B);F (gof) =F (g)oF (f); andF (idA) =idF (A). This section offers a very brief overview of some cate- gory theory concepts. To obtain a broad or complete view on the concepts of this theory, works [9] or [10] can serve as references. 5 Categorical modeling of organizations of MASs on the basis of capturing logics of some collective phenomena in human societies We use two examples to explain the ideas of looking for organizational solutions by studying collective phenom- ena and organizations in human societies when modeling a multi agent system for a given problem. For the first example, we assume that it is a question of proposing an organization for a multi-agent system comprising a num- ber of heterogeneous agents. Each agent has abilities and skills that differ from other agents. The best agents in terms of abilities and skills decide the overall strategy of the sys- tem. For example, in the case of a multi-agent system for information retrieval [30], the agents best equipped with planning and researcher capabilities decide how or which information retrieval algorithm will be applied. Given that agents are self-adaptive and can acquire skills and quali- ties as the system progresses in its functioning, the set of agents that decide changes over time. The second example presents a case of MASs where agents must be structured into crews in which agents plays roles while respecting cer- tain norms. For example, a distributed auction system in which three roles are played. The role Auctioneer played by agents that want to sell items; the role Seller played by agents that sell items on behalf of Auctioneers; and the role Bidder played by agents that make a bid on an item being auctioned [8]. After having explored the collective phenomena or the organizations which have proved their effectiveness and which seem to have a certain similarity with the problem to be solved, it is necessary to target a phenomenon or an or- ganization to be the basis for the organization of the multi- agent system to be modeled. Once a phenomenon or an organization is targeted, we proceed to its categorical mod- eling. Such a modeling allows the study of the properties considered as important such as the stability presented in the introduction. A categorical modeling is to construct categories for which it is possible to find functors allowing the construction of categories that model a MAS. These functors are schematized in the figure 1 by the different connections between the concepts of the category theory and social concepts on the one hand, and the concepts of the domains agent, MAS and the component based devel- opment on the other. This path of reflection can be summa- rized as follows: – Analysis of the problem for which we are seeking an organizational solution; – Explore collective phenomena or the organizations which have proved their effectiveness and which seem to have a certain similarity with the problem; – Modeling with categories the selected phenomenon or organization; – The study of the properties of the categorical model (If the properties of the chosen model are not satisfactory, it is necessary to return to step 2); – Use the correspondences schematized in the figure 1 between categorical and social concepts and agent and MASs concepts to obtain a categorical organizational model of MAS; – The study of the properties of the categorical MAS model (If the properties of the chosen model are not satisfactory, it is necessary to return to step 5 or 2); – Refine the categorical model of the organization of the MAS by introducing more details where objects of a category are modeled as new categories. For exam- ple an agent that is an object in a MAS category can be modeled as a category whose objects are software components; – Make implementation choices. When modeling a social process or a collective phe- nomenon in human societies categorically, it is possible to take social object as objects of categories, then, According to the behavior to be modeled, adapted sorts of morphisms can be identified. Social objects include several kinds of objects. Among these objects, social actors and Social ag- gregates are identified [31]. A Social actor may be defined as an active social entity that is considered at any scale, such as, individuals, Alliances, groups, teams... etc. Social actors make decisions and try actively to arouse coordina- tion with internal and external actors. Social aggregates are passive collections of social actors such as populations, generation and aggregations. A social aggregate is deter- mined by exogenous structures, events and process. It is changed through proximate adaptation and evolution. After modeling a social process or a collective phe- nomenon, we use the same set of social mappings to 570 Informatica 42 (2018) 563–576 S. Abderrahim et al. metaphorize the process of organizing multi agent systems. This categorical way of thinking is immensely important for how we understand organizations both in human soci- eties and multi agent systems. Thereby, a MAS can be seen as a category which objects are agents and morphisms are interactions between agents. We can also build a category of MASs which objects are MASs and morphisms present reorganization processes. An agent can be seen as a cat- egory also. Its objects are different components that con- stitute the agent and morphisms are interactions between components or compositions. A functor between two cat- egories agent A and agent B may present an adaptation of the agent A to become similar to B, as well as it may present all sorts of interactions between the agents A and B. These same principles are valid for components develop- ment concepts as depicted in figure 1 that illustrates map- pings from Categories to social concepts, MAS and agents’ concepts and components development concepts. For ex- ample, component based architecture can be seen as a cat- egory in which components present objects and interac- tions present morphisms. Concerning architectural styles, the choice of a specific category can be seen to reflect the choice of a specific architectural style. It is clear that there is a sort of universality in the way that social theory, MAS, organizations, and component based development can be approached through categories. This universality supports the integration of different ap- proaches. 5.1 Organizing a MAS on the basis of the circulation of elite process Assuming that we want to propose a multi-agent organization-oriented solution for the problem presented earlier as a first example. In this class of problems, a sub- set of agents that show good capacities decide about the global strategy of the system. For example, in the case of a multi-agent system for information retrieval [30], the de- cision to choose the information retrieval strategy is taken by the most qualified agents. An organizational solution for this class of problems can be inspired from the process of circulation of elites. According to the process of circula- tion of elites presented above, a society may be represented by the set of all individuals noted . At the timei, the so- ciety is given as the triplet (A i ;B i ;C i ) which is a partition of the set where: A i is the set of the mass individuals at the timei; B i is the set of the non ruling elite individuals at the timei;C i the set of the ruling elite individuals at the timei. Thus, = A i [B i [C i . At times i(i = 1; 2;:::;n), a so- ciety may be described with the stats M 1 (A 1 ;B 1 ;C 1 );M 2 (A 2 ;B 2 ;C 2 );:::;M n (A n ;B n ;C n ). The transition of the society from a stateM j to another one M k means that: (i) an element from the non ruling elite is integrated in the ruling elite; (ii) an element form the ruling elite is excluded from this one; or (iii) an element from the mass is integrated in the elite. If we consider two successive statesM i andM i+1 , D i is the transformation passing the society fromM i toM i+1 . For two non-successive stats M j and M k , there is a se- quence of transformations D : M j ! M k . If His a transformation formM k toM k+1 , the compositionH D : M j ! M k+1 , changes the society from the stat M j to M k+1 . We are in front of a category of social transforma- tions. Each stat M i may be described categori- cally. Let be the set E defined as: E = f(x;X i )=x2X i ;X i =A i _B i _C i g. Let be the discrete categoryCatE which objects are the elements ofE and morphisms are identity morphisms. We define categories CatE m by recurrence. The objects of a category CatE n are the elements of the setE n defined below. Morphisms ofCatE n are identities. E n =f(x;X n i )=x2X n i ;X n i =A n _B n _C n g. With A 0 =A;B 0 =B;C 0 =C and A n =A (n 1) D (n 1) ; B n = (B (n 1) F (n 1) )[G (n 1) ; C n =C (n 1) G (n 1) Where setsD i ,F i andG i are defined as follows: D i =fx2A i ^T 1(x) =Cte 1 g F i =fx2B i ^T 2(x) =Cte 2 g G i =fx2C i ^T 3(x) =Cte 3 g T 1, T 2 and T 3 are functions expressing different situ- ations allowing an individual x from to pass from one class to another at the timei as depicted in figure 2. The arrows to the symbol express the disappearance of an individual. We define now a category CAT of the categories CatE m which objects are categories CatE 1 , CatE 2 ,. . . , CatE m and morphisms (functors) are inclusion maps (canonical injections)= defined as: = : (x;X i )! (x;X j );X i X j The formalization presented above stipulates that the tran- sition of the society to the state n from the state n 1 means that: some elements from the mass class have be- come members of the class of non-governing elite (A n = A ( n 1) D ( n 1)) ; some elements from the non ruling elite class have become members of the class of the gov- erning elite and vice-versa (B n = (B ( n 1) F ( n 1))[ G ( n 1)) ; or some elements from the ruling elite class have become members of the class of the non ruling elite (C n =C ( n 1) G ( n 1)). A Category-theoretic Approach to Organization-based Modeling of. . . Informatica 42 (2018) 563–576 571 Figure 1: Correspondences between categorical concepts and social, MAS and component based development concepts. 572 Informatica 42 (2018) 563–576 S. Abderrahim et al. Figure 2: A schematic of passages of individuals between classes according to the circulation of elite process. Once the categorical model is established, the study of all properties becomes possible. For example, the study of the stability of the circulation of elites process can be achieved through monitoring cardinalities of the setsA i ,B i and C i . With the progressive changes in a society, if the cardinality of one of the three sets becomes lower com- pared to a minimum limit or upper compared to a max- imum limit, the instability is the result. At the time i, the number of elements of the population is N i . Ele- ments of are divided into the three subsetsA i ,B i andC i which cardinalities are respectivelyni 1 ,ni 2 andni 3 with N i = ni 1 +ni 2 +ni 3 . For example, One of the factors of system stability is the comply with the condition formu- lated as: j nij Ni j ;8j = (1::3) The functionsT 1,T 2 andT 3 and the valuesCte1,Cte2 andCte3 express conditions allowing an individualx from to pass from one class to another. T 1, T 2 and T 3 ex- pressions may be determined in several ways. For exam- ple, for the defining of the functions T 1, T 2 and T 3 that produce the probability that a member of a class moved to another class or disappear at the timei, it is possible to take inspiration from the Maxwell-Boltzmann law used in sta- tistical physics to determine the distribution of particles be- tween different energy levels [32]. At the basis of Maxwell- Boltzmann law and according to the case of one of its vari- ants relative to bosons (Bose-Einstein) or fermions (Fermi- Dirac) taking into account the parameters giving the char- acteristic of elements. It is possible to correspond the level 0 to the elements that disappear; to the elements that remain in their class the level 1 and those who pass to another class the level 2. The number of elements in a given level takes a similar form to that presented in the previous paragraph by considering as parameters some characteristics of the elements and the characteristic of each pre-defined level. The circulation of elite process categorically modeled can be the basis of modeling multi-agent systems. This so- cial process may be reproduced in the modeling of a MAS for information retrieval as well as for a great class of sim- ilar problems. Agents of such system are partitioned into steering agents and executor ones. Steering agents produce plans and decide about strategies of information retrieval that executor agents execute. The Steering agents are the best agents in terms of planning capacities. The same cate- gorical modeling may be used in such a way steering agents are the ruling elite, executor agents form the mass class. The agents are self adaptive and can acquire new skills. As the system progresses in its execution, agents acquire new skills. The best executor agents in terms of capaci- ties, progress to join the steering agents passing by an in- termediary status of a non-ruling elite (non ruling steering agents). The stability of such organization of MAS may be studied in the same way in which the stability of societies is treated i.e. via cardinalities of the groups of ruling steering agents, non ruling elite agents and executor agents. For such system we use the model of agent presented in [8]. In this model, agents are composed of software components assembled automatically and dynamically by an assembly engine. The different capabilities of an agent are implemented based on software components. The ar- chitecture of the agent includes a control module. Among the tasks for which the control module is responsible is the decision to make changes in the internal composition of the agent. These changes consist in perform assemblies or re- assemblies of components. By achieving changes in the composition of an agent, it acquires new skills. Agents are to present categorically in order to study their capacities. Each agent may be modeled as a category which objects are software components and morphisms are interactions between components. Agent’s capacities may be studied as proprieties determined using the capacities fuzzy mea- sure proposed by Siam et al [8]. The figure 3 offers a gen- eral view of such modeling in which the different status of the agents society constitutes a category in which objects are status and morphisms are the transitions of the society from one status to another one. A transition expresses the fact that an agent has changed class. A status which is an object of the category described above is also a category. Its objects are agents and morphims are interactions between agents. Agents in their turns are categories where objects are software components and morphisms are interactions and compositions of components. 5.2 Organization of a MAS based on organizations in human societies It is possible to describe with category theory concepts, organizations in human societies and their organizational concepts. All concepts presented in the section 3 such as organizations, groups, roles, teams, norms...etc may be rep- resented using categorical concepts. The figure 1 illustrates correspondences between categorical concepts and organi- zational ones. To propose an organizational modeling of a MAS allow- ing the implementation of the distributed auction system A Category-theoretic Approach to Organization-based Modeling of. . . Informatica 42 (2018) 563–576 573 Figure 3: A categorical modeling on the basis of the circu- lation of elite process. described above, all organizations in human societies in which a society is structured into groups or teams of mem- bers who play roles can serve as a source of inspiration. For example, it is possible to define a category ROL of roles. The objects of this category are triplets (R i ;S i ;P i ) whereR i is a set of roles;S i are protocols that connect the rolesR i ,P i denote pair of roles connected by each proto- col. Morphisms of ROL are relations between triplets (R i ;S i ;P i ). A relation between two triplets (R 1 ;S 1 ;P 1 ) and (R 2 ;S 2 ;P 2 ) may be defined as a functionf = (; ) with : R 1 ! R 2 and : S1 ! S2such that 8s2S1;P (s) = (r1;r2) =) (s) = ( (r1); (r2)). We can verify that the objects (R i ;S i ;P i ) with the re- lations are a category by checking the different propri- eties of a category. Objects of the category are (R i ;S i ;P i ) and its morphisms are relations . The identity morphism is id = (id R ;id S ) such that id R and id S are identity functions;id R maps each role to itself andid S maps each protocol to itself. To verify the composition propriety, Let M 1 ;M 2 ;M 3 be three objects and f 1 = ( 1 ; 1 );f 2 = ( 2 ; 2 ) be two relations such that f 1 : M 1 ! M 2 and f 2 : M 2 ! M 3 . The composition is defined as: f 2 f 1 = ( 2 1; 2 1). Regarding the associativ- ity propriety, the relations between triplet objects consist of functions between sets. Thence, the assiociativity is de- rived from the associativity of functions between sets. In the same way, all organizational and social concepts such as norms, groups . . . etc, may be modeled categori- cally. After modeling all concepts of an organization with categories C i , the organization categorical model may be obtained by building a new category from the categories C i . Several ways are available to build a new category from existing ones. For examples, by compositions, by adding structures, using sub categories, using product of categories. . . etc. After modeling an organization with categories, it be- comes possible to study formally its properties such as stability and adaptation by using advanced categorical concepts and notions such as natural transformations, Pushout...etc. By using correspondences between categorical concepts and organizational ones and correspondences between cat- egorical concepts and multi-agent organizational ones il- lustrated in figure1, the categorical model of an organi- zation in a human society may be moved in a categorical model of an organization of MAS. The resulting model may be extended categorically in the same way with that presented in the first example. Once the organizational cat- egorical model of MAS produced, studying organization proprieties becomes possible. Finally, an implementation of the MAS is to realize. Several ways to implement MASs are available; the use of MAS platforms [33] is one of the most effective. 574 Informatica 42 (2018) 563–576 S. Abderrahim et al. 6 Conclusion The important property of category theory is that it allows studying structures and their proprieties in one domain and moving them to another one together with the capacities to deal with all concepts of all domains with the same cate- gorical terms. In this paper, we presented an idea of study- ing and formalizing organizations and collective phenom- ena in human societies with category theory with the aim of capturing their logics into categorical models. After- ward, the captured models are mapped categorically to cat- egorical MAS organizational models. This way of think- ing allows taking inspiration from efficient organizations in human societies in order to develop efficient organiza- tional models for MAS. Categories are compositional; in a categorical MAS organizational model, agents are often presented as the objects of certain categories. Such model may be refined and extended by considering each agent as a category which objects are software components and mor- phisms are interactions between components. So, agent’s proprieties may also be studied. With this way of thinking, it becomes possible to study the properties of organizations in human societies such as stability and adaptation before taking them as landmarks for developing MAS organiza- tional models. The inspirations from human societies are conducted with formal concepts. So, it is possible to rea- son about the inspiration processes themselves regardless of the source or inspired models. The present work presents a nucleus around which sev- eral research projects can be initiated. These projects are to be managed according to three main axes. In the first one, it is necessary to study the maximum possible of collective phenomena and organizations in human societies and sub- sequently to model them with category theory concepts. A classification of the produced categorical models must be carried out. Each class of models responds to the specific needs of one or more types of problems. This classification requires a parameterization operation to output a signature that characterizes and allows classifying each model in one or more classes. Once reached at an advanced stage in the study, categorical modeling and classifying collective phe- nomena and organizations, a library of models is the result. To look for an organizational solution for a multi-agent sys- tem designed for a given problem, we have to do the param- eterization of the problem. The result signature directs the search for a solution in the model library. The search for a solution in the model library may be done in an automatic way. Thus, the reuse of solutions is pushed very far. In addition, it is possible to evaluate the appropriateness of each chosen solution with the type of problem for which the solution is chosen. The traces of the different evalu- ations allow better directing the search for organizational solutions for each type of problems. This approach is sim- ilar to component-oriented development approaches where off-the-shelf components are ready to use. In the second axis, works must be driven to study on the basis of the cat- egorical models the emergent phenomena in both MASs and human societies. In the third axis, sociology benefits from the possibilities of making simulations to study the impact of the variations that societies can undergo. . References [1] C. Szyperski (1998) Component Software Beyond Object- Oriented Programming, Addison-Wesley. [2] B. Z Abraham, J. C Aguilar (2007) Software Compo- nent Selection Algorithm Using Intelligent Agents, Agent and Multi-Agent Systems: Technologies and Applications, Lecture Notes in Computer Science 4496, Springer-Verlag, pp. 82–91. https://doi.org/10.1007/ 978-3-540-72830-6_9 [3] P. Pelliccione, M. Tivolia, A. Bucchiaroneb and A. Polini (2008) An architectural approach to the correct and automatic assembly of evolving component- based systems, Journal of Systems and Software, sciencedirect, V ol 81, pp. 2237–2251. https://doi.org/10.1016/j.jss.2008. 05.030 [4] N. Obeid, S. Al-Areqi (2013) Using Agents for Dy- namic Components Redeployment and Replication in Distributed Systems, Contemporary Challenges and Solutions in Applied Artificial Intelligence, Studies in Computational Intelligence, Springer-Verlag, pp. 19–25. https://doi.org/10.1007/ 978-3-319-00651-2_3 [5] A. Siam , R. Maamri and Z. Sahnoun (2012) An approach based on software components and mobile agents for developing distributed applications with verification of validity criterion, Proceedings of The 6th International Conference on Complex, Intelli- gent, and Software Intensive Systems, IEEE Xplore, Palermo, pp. 407–413. https://doi.org/10.1109/CISIS.2012. 97 [6] S. Leriche , JP. Arcangeli (2007) Adaptive Au- tonomous Agent Models for Open Distributed Systems, Proceedings of the International Multi- Conference on Computing in the Global Information Technology, IEEE Xplore, Gosier Guadaloupe, pp. 18–24. https://doi.org/10.1109/ICCGI.2007. 10 [7] G. Eleftherakis , P. Kefalas and E. Kehris (2011)A methodology for developing component-based agent systems focusing on component quality, Proceedings of the Federated Conference on Computer Science and Information Systems, IEEE Xplore, Szczecin, Poland, pp. 561–568. A Category-theoretic Approach to Organization-based Modeling of. . . Informatica 42 (2018) 563–576 575 [8] A. Siam , R. Maamri and Z. Sahnoun Zaidi (2014) Organization of Self-Adaptive Agents Based On Software Components, International Journal of Intelligent Information Technologies, IGI Global, V ol 10, No 3, pp. 36–56. https://doi.org/10.4018/ijiit. 2014070103 [9] A. J Macintyre , D. S Scott (2010) Category theory, Second Edition, Oxford University press. [10] B. Michael, S. W Charle (1990) Category Theory for Computing Science, Prentice Hall. [11] W. R Scott (1998) Organizations: rational, natural and open systems, 4 edition, Prentice Hall. [12] O. Boissier, L. Coutinho and J.S. Sichman (2006) Organization oriented programming: from closed to open organizations ıEngineering Societies in the Agents World VII (ESAW’06), LNCS, Springer- Verlag, Berlin, Heidelberg, V ol.4457, pp.86–105. https://doi.org/10.1007/ 978-3-540-75524-1_5 [13] A. Estefania ,J. Vicente and B. Vicente (2006) Multi- Agent System Development Based on Organizations, Electronic Notes in Theoretical Computer Science, V ol 150, Elsevier, pp. 51–77. https://doi.org/10.1016/j.entcs. 2006.03.005 [14] J. Deguet, L. Magnin, and Y . Demazeau (2006) Ele- ments about the emergence issue: A survey of emer- gence definitions, BIO INSPIRED METHODS, Com- PlexUs, pp. 24–31. https://doi.org/10.1159/000094185 [15] C. Lemaître, C. B Excelente (1998) Multiagent Orga- nization Approach., Proceedings 2nd Iberoamerican Workshop on Distributed Artificial Intelligence and Multi-Agent Systems , Toledo, Spain, pp. 07–16. [16] J. L Dessalles, J. P Müller and D Phan (2007) Emergence in multi-agent systems: conceptual and methodological issues. In: Agent-based modelling and simulation in the social and human sciences, Ox- ford : Bardwell Press. [17] S. Bouarfa, H. AP Blom, R. Curran and M. HC Everdij (2013) Agent-based modeling and simulation of emergent behavior in air transportation, Complex Adaptive Systems Modeling, SpringerOpen, pp. 1–15. https://doi.org/10.1186/ 2194-3206-1-15 [18] Y . M Teo, B. L Luong and C. Szabo (2013) For- malization of emergence in multi-agent systems, Proceedings of the 1st ACM SIGSIM Conference on Principles of Advanced Discrete Simulation, ACM DL, NTU, Singapore, pp. 231–240. https://doi.org/10.1145/2486092. 2486122 [19] J. Pavon, J. J Gomez-Sanz (2003) Agent oriented software engineering with INGENIAS, Multi-Agent Systems and Applications III, Springer Berlin Hei- delberg, V ol. 2691 pp. 394–403. https://doi.org/10.1007/ 3-540-45023-8_38 [20] Author (2004) The MaSE Methodology, In Method- ologies and Software Engineering for Agent Systems, SringerLink, pp. 107–126. https://doi.org/10.1007/ 1-4020-8058-1_8 [21] J. Ferber, O Gutknecht (1998) A meta-model for the analysis and design of organizations in multiagents systems, Proceedings of the 3rd International Con- ference on Multi-Agent Systems, IEEE Computer So- ciety, Paris, France, pp. 128–135. [22] M. Esteva, A. J. A Rodriguez-Aguiar, C. Sierra,P. Garcia and J. L Arcos (2001) On the formal specifi- cation of electronic institutions, Notes in Computer Science, Springer, V ol 191 pp. 126–147. https://doi.org/10.1007/ 3-540-44682-6_8 [23] D. B Panos (1979) Social Interaction and Social Pro- cesses, Social Science, JSTOR,V ol. 54, No. 3 pp. 147–167. [24] V . Pareto (1968) The rise and fall of the elites, Totowa NJ Bedminster Press. [25] J. K DeVree, J. C Dagevos (1994) The structure of action and interaction: The structural similarity of systems in social science, Journal of Mathematical Sociology, Taylor and francis, V ol. 19 pp. 91–127. https://doi.org/10.1080/0022250X. 1994.9990138 [26] D. S Dendrinos (1996) Cities as spatial chaotic attrac- tors, Chaos Theory in the Social Sciences, University of Michigan Press, pp. 237–269. https://doi.org/10.3998/mpub.14623 [27] P. Cvitanovic (1984) Universality in Chaos, 2nd ed, Bristol, Adam Hilger Ltd. https://doi.org/10.1002/bimj. 4710270818 [28] D. L Sallach (2000) Classical social processes: Attractor and computational models, The Journal of Mathematical Sociology, Taylor and francis, V ol. 24, pp. 245–272. https://doi.org/10.1080/0022250X. 2000.9990238 [29] S. P Robbins, A. Timothy (2012) Organizational Be- havior, 15 Edition, Pearson. 576 Informatica 42 (2018) 563–576 S. Abderrahim et al. [30] C. D Manning, P. Raghavan and H. Schütze (2009) An Introduction to Information Retrieval, Cambridge University Press. [31] S. A Paul, K. Seok-Woo (2002) Social Capital: Prospects for a New Concept, The Academy of Man- agement Review, JSTOR,V ol. 27 pp. 17–40. https://doi.org/10.2307/4134367 [32] F. Mandl (1991) Statistical Physics 2nd Edition, John Wiley and Sons. [33] K. Kravari, N. Bassiliades (2015) A Survey of Agent Platforms , Journal of Artificial Societies and Social Simulation, V ol.18 pp. 11. https://doi.org/10.18564/jasss.2661