Document not found! Please try again

Agent Based Simulation for Social Systems: From ... - Semantic Scholar

3 downloads 175 Views 318KB Size Report
programming on some concrete agent simulation platform). This requires ... Describing social phenomena with a visual, high-level modeling language and implementing ..... monitoring what happens without the scheduler functions? Doing so ...
Agent Based Simulation for Social Systems: From Modeling to Implementation Candelaria Sansores and Juan Pavón ∗ Universidad Complutense de Madrid, Dep. Sistemas Informáticos y Programación 28040 Madrid, Spain [email protected], [email protected]

Abstract. This paper presents experimental results of our model-driven approach to agent based simulation. According to this, the development process for agent based simulation should focus on modeling rather than implementation (i.e., programming on some concrete agent simulation platform). This requires the use of transformation tools from simulation models to implementation code. Describing social phenomena with a visual, high-level modeling language and implementing the simulation in this way should facilitate the use of toolkits by experts in social sciences without a deep knowledge of programming concerns. This simulation approach is supported here by the INGENIAS Development Kit (IDK), which provides a model editor for multi-agent systems, and code generation support. To validate the transformation mechanism, we have modeled a concrete social system with the INGENIAS agent-oriented modeling language, and generated two independent implementations for two different platforms (Repast and Mason simulation toolkits). This experimentation shows the feasibility of the model driven implementation approach and has enabled the study of facilities provided by simulation toolkits that can have impact on the transformation process, in particular, the scheduling techniques. Also, comparing the simulation results of the case study with the original work and between implementations has led us to discover biases introduced by simulation mechanisms that can be found in most simulation platforms.

1 Motivation Computer simulation has an important role in the development of theories of non linear and dynamic systems, and its use is at the origin of the interdisciplinary scientific area of complex systems [8]. Complex systems are dynamical systems composed of a high number of components and multiple interactions among them. Also, [5] requires that the components be themselves complex, which is certainly true for the actor of social systems (like the individual), but in the case of some biology systems (like swarm systems) the actors use to be simple. Even social systems models usually contain relatively simple actors, and simplicity vs. complexity of actors is still ∗

This work has been developed with support of the Consejo Nacional de Ciencia y Tecnología (CONACYT) from México and the project TIC2002-04516-C03-03, funded by the Spanish Council for Science and Technology.

R. Marín et al. (Eds.): CAEPIA 2005, LNAI 4177, pp. 79 – 88, 2006. © Springer-Verlag Berlin Heidelberg 2006

80

C. Sansores and J. Pavón

an open debate (reviewed in [12]). Furthermore, [6] defines complex systems as complex adaptive systems that consist of networks of interacting agents and exhibit dynamic aggregate behaviors that emerge from individual activities. An aggregate behavior is emergent if it requires new categories to describe it, which are not used when describing the behavior of the underlying components. Our work focuses on modeling and implementing non-linear complex systems in social sciences that exhibit these characteristics. As it is extensively discussed in [8], mathematical modeling has had little success for studying this kind of systems, mainly because expressing laws that regulate these phenomena is rather difficult if not impossible. An alternative is to make use of computer simulation where systems are modeled as societies of agents. Agents, in this context, are autonomous software systems that are intended to describe the behavior of observed social entities (e.g. individuals, organizations). An advantage of the agent-based modeling approach is the ability to estimate the plausibility of the behavior of agents, the way in which agents interact, and the consequences of that behavior and interaction [1]. Our aim is to build artificial societies [4], that is, multi-agent based models of social entities whose social structure and group behavior emerge from the interaction of individuals, under relative simple rules. Also, in this category we can include swarm systems, like many social insects groups, which show impressive collective problem-solving capabilities. In this context, we have addressed several open issues found in conceptual modeling and implementation of social simulation systems. For conceptual modeling we provide an easily customizable tool for describing phenomena in different social domains with a visual language, which is based on the agent-oriented methods and tools of INGENIAS [9]. This agent-oriented visual language is implementation language-independent so it hides computational complexity to modelers. The technical description and an example of the use of this language is presented in [12]. The use of an agent-oriented modeling language facilitates the task of building conceptual models with respect to the direct use of simulation toolkits, where scientists do not build conceptual models but directly program their systems by using simulation support libraries. This is a problem for users or modelers without a strong programming background. Therefore, we propose to use an agent-oriented high-level language (in our case, INGENIAS), and for implementation issues we provide code generation tools that support the transformation of conceptual models into code for different simulation toolkits. This has an additional advantage, as it facilitates model replication (in the sense that a simulation model can be executed on different simulation toolkits, to see whether the results do not deviate from one platform to another). This paper complements [12] and [11] by presenting experimentation results that validate the feasibility of our approach for modeling and simulation of artificial societies as multi-agent systems (MAS). The validation has been made by replicating the same model on two different toolkits, in this case, Repast [10] and Mason [7]. In this way, we show that the proposed agent-based modeling language can be independent of particularities of specific toolkits. This work also shows interesting issues related with simulation facilities provided by the toolkits we used, which can facilitate or complicate the translation process. Section 2 briefly presents a case study and describes the model replication results obtained during the validation process, which considers whether the transformed

Agent Based Simulation for Social Systems: From Modeling to Implementation

81

simulation models implement the specification correctly. Section 3 discusses simulation facilities of the two simulation toolkits that have appeared to be determinant during simulation implementation. Section 4 summarizes our contributions and concludes with the identification of further work.

2 Validation Process of Model Translation In agent-based social simulations, scientists, in general, are presented with already emerged collective phenomena and must theorize about micro-rules that can generate them. In this way, they model behaviors at the individual level, whose combination may result in a complex system behavior. To this extent, we are considering examples of systems where emergent properties of local interaction among adaptive agents influence one another in response to the influence they receive. Here we show the results of the work on one such model, which has been replicated in two different simulation toolkits, RePast and Mason. This case study is based on a system originally described by [2]. This model examines which type of mental constructs corresponds to the norm of reciprocity within the simulation-based study of altruism: a simple or sub-cognitive altruistic algorithm, or smart, or quasi-cognitive. In the former, agents apply routines under given conditions. In the latter, agents execute actions to achieve their goals. Thus, the system studies altruism among simple and smart entities in a society. In this case study the society consists of a population of vampire bats (the agents) that live in roosts, where they get back to after hunting and perform social activities like grooming and sharing food. The entities explicitly modeled as agents are the bats. Roosts are modeled as aggregates of bats. In roosts, bats are allowed to share food and to groom one another. Each simulation cycle includes one daily and one nightly stage. During the daily stage, the simulated bats perform the social activities, in the night they hunt. Each night 93% of the population will find food to survive until the next hunt. The remaining 7% will starve, unless they receive help from some fellow (under the form of regurgitation). A starving bat will turn to grooming partners for help, and will avoid death if any of them is found to be full. Help-giving allows animals to achieve credits, which will be extinguished if and when help is returned. Animals are endowed with social knowledge: consisting of a memory of past grooming and foodsharing interactions, and of consequent credits. After each simulation the number of death bats, the number of altruistic acts performed and the number of credits turned on or off are recorded. The experiment in this case study is the dynamic variant of smart agents in [2]. The smart algorithm implemented a small number of rules modifying the values of agents’ motivational force for pursuing goals, in particular of the normative goal [12]. This was supposed to increase or decrease as an effect of others’ impact on one’s own conditions. If one receives help, the force of the altruistic motivation increases, whereas it decreases if one is denied help. This effect is even stronger, if one is not reciprocated and its credits are therefore not extinguished. The main questions are: What happens under these circumstances? What are the effects of goal-dynamics on altruism, and more specifically on the fitness of the smart population?

82

C. Sansores and J. Pavón

2.1 Simulation Results from Reimplementation The results given by [2] showed that different strategies (Cheater, Prudent, Fair, Generous, Martyr) emerge in the experimental condition, and their difference increases when strategies are inherited by the agents’ offspring. These strategies correspond to different patterns of relationships among agents’ goals. The implementations to compare results were generated for Repast [10] and Mason [7], both generated from different visual models. The mechanisms used for code generation are explained in [11]. Here we show the execution of both applications with the same parameters: 10000 days, a population of 150 bats, 10 roost, reproduction mechanism and inheritance activated.

Fig. 1. Emergence of Altruistic Strategies with inheritance. On the left side Repast statistic graph, on the right Mason graph. Values are number of agents per strategy (y), and simulation steps (x). Population is composed of 10 roosts of 15 agents each. Every agent is Prudent at the beginning.

First test results are shown in Fig. 1. On the left side we can see the statistic graph generated with Repast simulation, and on the right the one obtained from Mason. Based on the results presented in the original model, it is clear that Repast simulation results aligned very well with the original ones. In both conditions, the dominant strategy appears to be Martyrdom. Since this strategy is self-reinforcing one would expect this result: as soon as Cheaters start to decline, donations will increase and reciprocity will emerge. Consequently, Martyr bats will grow spontaneously. Mason statistic results did not align with the original ones as we can see in Fig. 1. Note the difference in scale between both y axes, in Mason chart, population decreases even thought reproduction is activated. This could be due to an inadequate

Agent Based Simulation for Social Systems: From Modeling to Implementation

83

specification, like missing parameters in the specification, or to an erroneous implementation, in this case an erroneous transformation of the visual model. We cross checked both independent simulations and even though they were implementing the same underlying process, Mason implementation did not produce results that were sufficiently close neither with the original model nor with Repast results. We had high degree of confidence in the similarity of both implementations, but one of them show significant differences from the original published results and the other one aligned very well, so we speculated that there was a possible source of inconsistency introduced by random number generators or the simulation engine itself, so we debugged the second implementation to find possible errors.

Fig. 2. Mason Statistic Graph without biases. Emergence of Altruistic Strategies with inheritance. Values are number of agents per strategy (y), and simulation steps (x). Population is composed of 10 roosts of 15 agents each. Every agent is Prudent at the beginning.

This task showed some issues (see section 3) on Mason toolkit that were introducing some biases on the results, and having a second implementation to compare with can help to find them and discard translation mechanism errors. On Fig. 2 we can see Mason statistic chart once we handled the bias issues and generate adequate code. The second test we performed to validate our framework’ translation tool was concerned with the reproduction system of the original model. In the first test, we implemented reproduction with inheritance of strategy and credits. This means that offspring gain credits transmitted by their parents. In the second test, inheritance was turned off. The results are shown in Fig. 3. Without inheritance, strategies will not differentiate, and the population gradually and slowly decreases.

84

C. Sansores and J. Pavón

Fig. 3. Emergence of Altruistic Strategies without inheritance. On the left side Repast statistic graph, on the right Mason graph. Values are number of agents per strategy (y), and simulation steps (x). Population is composed of 10 roosts of 15 agents each. Every agent is Prudent at the beginning.

Having two independent simulations re-implementations made it possible to discover shortcomings of the translation mechanisms and greatly aided us in finding possible errors introduced by external sources, like the simulation toolkit itself.

3 Multi-agent Based Simulation Toolkit Facilities Most multi-agent based simulation environments are time-driven discrete event simulation tools where the simulated time is advanced in constant time steps for simulating the perception-reaction cycle of agents who act by the passage of time. The simulated entities are modeled and implemented in terms of agents that interact with each other and with their environment, that is, in each time step agents are scheduled to execute their autonomous actions. An agent in the context of these rapid development environments use to be an ordinary object, ranging from having no communication at all between entities to communication via the environment, although some of them do provide libraries to implement an agent communication mechanism. Also, this development tools provide the notion of space, letting each entity be assigned a location in the simulated physical geometrical space. More sophisticated mechanisms, like learning abilities for agents, have to be implemented by the developer; besides, no modeling concepts such as beliefs, desires, and intentions, which are common to express agent's behavior, are supported, Table 1 summarizes the main characteristics provided by existing simulation environments for the social domain.

Agent Based Simulation for Social Systems: From Modeling to Implementation

85

Table 1. Main characteristics provided by existing simulation environments for the social domain

Scheduling Time-driven

Environment Represented with the notion of Spaces

Communication Indirect communication through the environment

Agents Model An ordinary object

Due to this simplicity on the agents concepts that are considered by existing simulation environments, some authors [3] question whether these are really computational agents as those found on multi-agent systems theory or on distributed artificial intelligence. Although this is a logical question, we also think that this kind of agents can be develop, some open Java libraries toolkits like Repast or Mason provide means to develop more sophisticated MAS concepts, so we developed our own abstract layer [11] on top of toolkits facilities to consider concepts from our agent-oriented modeling language, like agents’ goals, beliefs, organizations, roles, etc. The main facilities provided by these toolkits are oriented to scheduling, space and indirect communication mechanisms. Following, we review the most relevant for our code generation approach. 3.1 Scheduling All multi-agent simulations need some way of ordering events, but often this scheduling is concealed in the design. Repast and Mason make scheduling explicit. This could seem inappropriate because MAS have no central control and having a scheduling mechanism could be confused as having a central planner, however, this is not the intention of the scheduler in simulation toolkits. The definition of a model period is related with the timing of interactions, and not with a “social” planner that decides who performs what actions. Besides, the order of agents’ activation is systematically randomized from period to period (each step) in order to avoid the reproduction of biases. If global behavior of the system is said to emerge from agents and their interactions, why the model is not just instantiated, letting the agents interact and monitoring what happens without the scheduler functions? Doing so certainly provides an emergent behavior, but social scientists could not be able to understand under what circumstances or what local interaction among agents gives rise to the global emergent structure. Besides, to discover the consequences of their theories in the artificial society modelers need to have control over the simulation to observe what is happening in every moment and what parameters influence the results. The scheduling mechanism in Repast includes a fully concurrent discrete event scheduler. This scheduler supports both sequential and parallel discrete event operations and is responsible for all the state changes within a Repast simulation. Consequently, any changes we want to occur in a simulation must be scheduled with a schedule object. Scheduling offers a way of integrating the actions of many different agents in many different levels of the simulation. In essence, scheduling consists of setting up method calls on objects to occur at certain times.

86

C. Sansores and J. Pavón

Repast scheduling mechanism although flexible enough is contrary to some of the ideas that motivated a multi-agent based approach since creating a list of actions to be taken at each time step looks more like a central coordinator approach. However, we are not committed to do it. Therefore, in our case we were able to schedule the agents themselves for execution. The reproduction mechanism in our model required of dynamic scheduling support. Although rescheduling worked fine, the ordering issue of agents’ executing in the same time step lacked some ideal characteristics, like the possibility of scheduling agents at different ordering numbers. Now, it only supports last ordering parameter, which means that agents scheduled with this parameter on will be executed last. Subdividing a time step in different orders is an ideal characteristic, in our case we required to represent a time step like a day, with two stages, the day and night stage. Mason scheduling mechanism is a single-process discrete-event simulation. It does not schedule events on the scheduler to send to an agent; rather it schedules the agent itself. Thus, it is more in alignment with MAS fundamentals, and so with our MAS framework for modeling and implementing agent-based simulation systems, facilitating the translation mechanism. In this way, an agent is seen like a computational entity that may be scheduled to perform some action, and that can manipulate the environment. Mason provides many facilities for scheduling, including different ordering numbers of scheduled agents in the same time step, as well as dynamic scheduling. However, during the test of our code generation system, we found an issue that introduced biases in our simulation results and that were related to dynamic scheduling and ordering. When we dynamically scheduled agents’ offspring during the 20th month (in order to model the juvenile phase) to be executed every time step after their birth in the same order as parents (in this way, parents and offspring will be randomly executed together, all of them were bats and our intention was they to be treated indistinctly), the ordering mechanism made a distinction between the same order number defined at different time steps, so the parents will be executed randomly between them, and offspring would do the same, but never like a whole list of agents scheduled in the same order, it seemed like ordering in different time steps for the same order number created a sub-ordering. This is not a bug of the system, this behavior is already pursued by the toolkit developers since the Sequence data structure we used to schedule parent agents is not a dynamic data structure, consequently when we added bats’ offspring they were placed in a different internal data structure. This fact is not stated in Mason documentation, and let to misunderstandings, which introduced errors difficult to debug in our system. 3.2 Space The Space describes the spatial arrangements of agents in the model. It is like a controlled environment where agents interact. Note that we do not explicitly state that agents are physically in the environment, though they could be. In Repast toolkit, the space class controls the environment in which the action takes place. It is theoretically possible to omit the explicit ‘Space’ object, but this is rarely done. Spaces in Repast function as a collection of agents that define the spatial relationship of agents relative to each other.

Agent Based Simulation for Social Systems: From Modeling to Implementation

87

Mason Spaces relate arbitrary objects or values with locations in some notional space, although its use is entirely optional. Agents located in spaces are referred to as embodied agents, in this way agents are brains, and do not need to be bodies. In this sense, we completely agree with Mason philosophy of spaces, providing the possibility of having agents not necessarily situated in a space. In this case, agents’ communication mechanisms have to be implemented like direct interaction mechanism between them and not through the space like embodied agents. Both simulation toolkits provide enough facilities to handle spaces. However, for our purpose of translating design artifacts from a visual agent-oriented model to source code [11], Mason facilitates much more the task, specially its support for social networks formation and management. We did not pretend to provide an exhaustive survey of simulation toolkits in this work, but to evaluate some of the core features more commonly found in most of the simulation toolkits that support a MAS simulation paradigm and which should be well understood to accomplish the transformation from agent-oriented modeling to simulation platform code.

4 Conclusions In this paper we presented experimental results of the validation process of our approach for agent-based social simulation. The whole development process is driven by modeling artifacts that are represented with visual elements of a modeling language and that are then transformed into different implementations for particular simulation toolkits. Describing social phenomena and implementing the simulation in this way facilitate the use of toolkits by users who are not necessarily experts in computer programming, but in social sciences. Also, model replication issues are easily addressed with this approach. This is illustrated with a social system case study, for which two implementations in two different simulation platforms have been derived. Initially, we chose Repast and Mason toolkits because both tools are of widespread use for agent-based simulation, and because their way of specifying agents can be supported by the INGENIAS code generation approach without too much difficulty. These experiments showed the feasibility of the model driven approach presented in [11] and enabled the study of particular aspects of each simulation toolkit relevant to multi-agent based simulations. More specifically, we evaluated facilities provided by simulation toolkits that can have impact on the transformation process from models to implementation in different target platforms, like scheduling techniques. Also, we compared the simulation results of our implementations with the original work to discover possible misunderstandings in models specifications or interpretations. Aligning the models proved to be a very rewarding task since it led us to discover biases introduced by simulation mechanism found in most simulation platforms. There is still work to do to reach full automation of the code generation step. We plan to include also deployment support and monitoring of the transformation process. Deployment information is independent of the process defined in the model and should be defined through a customizable tool.

88

C. Sansores and J. Pavón

References 1. Axtell, R., Why Agents? On the Varied Motivations for Agent Computing in the Social Sciences, in Working Paper No. 17. 2000, center on Social and Economic Dynamics, The Brookings Institution: Washington, DC. 2. Di Tosto, G., R. Conte, M. Paolucci. Altruism Among Simple and Smart Vampires. In: Proceedings of the 1st Conference of the European Social Simulation Association (ESSA). Groningen, NL (2003), 3. Drogoul, A., D. Vanbergue, T. Meurisse. Multi-agent Based Simulation: Where Are the Agents? In: J.S. Sichman, et al. (Eds.): Multi-Agent-Based Simulation II: Third International Workshop, MABS 2002. Lecture Notes in Computer Science, Vol. 2581. Springer. Bologna, Italy (2002), 1-15. 4. Epstein, J.M., R. Axtell. Growing artificial societies: social science from the bottom up. Complex adaptive systems. 1996, Washington, D.C.: Brookings Institution Press. 5. Gilbert, N., K.G. Troitzsch. Simulation for the Social Scientist. 1996, Buckingham, U.K.: Open University Press. 6. Holland, J.H. Emergence: from chaos to order. 1998, Reading, Massachusetts: AddisonWesley. 7. Mason. 2004. Mason: Multiagent Simulation Toolkit. Available from: http://cs.gmu.edu/~eclab/projects/mason/ 8. Moretti, S. Computer Simulation in Sociology: What Contribution? Social Science Computer Review, 2002. Vol. 20(1): p. 43-57. 9. Pavón, J., J. Gómez-Sanz. Agent Oriented Software Engineering with INGENIAS. In: V. Marík, et al. (Eds.): Multi-Agent Systems and Applications III, 3rd International Central and Eastern European Conference on Multi-Agent Systems, CEEMAS 2003. Lecture Notes in Computer Science, Vol. 2691. Springer. Prague, Czech Republic (2003), 394-403. 10. Repast. 2004. Repast: Recursive Porus Agent Simulation Toolkit. Available from: http://repast.sourceforge.net 11. Sansores, C., J. Pavón. Agent-Based Simulation Replication: a Model Driven Architecture Approach. In: A. Gelbukh, et al. (Eds.): Fourth Mexican International Conference on Artificial Intelligence, MICAI-2005. Lecture Notes in Artificial Intelligence, Vol. 3789. Springer-Verlag. Monterrey, México (2005), 244-256. 12. Sansores, C., J. Pavón, J. Gómez-Sanz. Visual Modeling for Complex Agent-Based Simulation Systems. In: J. Sichman, et al. (Eds.): Multi-Agent-Based Simulation, Sixth International Workshop on Multi-Agent-Based Simulation, MABS 2005. Lecture Notes in Computer Science, Vol. 3891. Springer-Verlag. Utrech, Netherlands (2005), 174-189.

Suggest Documents