Chemical-oriented simulation of computational systems with ALCHEMIST D Pianini, S Montagna and M Viroli* DISI-Universita di Bologna, Cesena, Italy In this paper we address the engineering of complex and emerging computational systems featuring situatedness, adaptivity and self-organisation, like pervasive computing applications in which humans and devices, dipped in a very mobile environment, opportunistically interact to provide and exploit information services. We adopt a meta-model in which possibly mobile, interconnected and communicating agents work according to a set of chemical-like laws. According to this view, substantiated by recent research on pervasive computing systems, we present the Alchemist simulation framework, which retains the performance of known Stochastic Simulation Algorithms for (bio)chemistry, though it is tailored to the specific features of complex and situated computational systems. Journal of Simulation (2013) 7, 202–215. doi:10.1057/jos.2012.27; published online 18 January 2013 Keywords: distribution; pervasive systems; simulation; bio-inspiration 1. Introduction Complexity is everywhere, both in nature—whether we observe it at the physical, chemical, biological or social level (Zambonelli and Viroli, 2011)—and in artificial computing systems, realised to support nowadays scenarios like those of pervasive computing, which leverage the increasing large- scale availability of smart computational devices. Such natural and artificial systems seem to share a common set of properties including situatedness, adaptivity and self- organisation, which altogether make them react to unpre- dictable situations with no explicit design-time or supervised control, namely, by emergence. It comes not as a surprise, then, that the design of mechanisms and algorithms to be adopted in emerging computing systems typically rely on the two following key pillars. On the one hand, they leverage natural inspiration, either in terms of patterns (Gardelli et al, 2007; Fernandez-Marquez et al, 2012) or of metaphors (Babaoglu et al, 2006; Zambonelli and Viroli, 2011). A notable class of such approaches, which we focus on in this paper, falls under the umbrella of chemical computing. This research thread originated in the work of Gamma (Banaˆ tre and Me´tayer, 1993; Banaˆ tre et al, 2001) and the chemical abstract machine (Berry and Boudol, 1992), then developed in a plethora of theoretical models of computing (see, eg, Bergstra and Bethke, 2002; Credi et al, 2007; Brijder et al, 2011), it was extended with a structuring of the environment in compartments as in biological systems (like in Ambients Cardelli and Gordon, 2000 and P-systems Paun, 2002), and recently it has been framed in the context of coordination models (Viroli and Casadei, 2009) with applica- tions to the field of pervasive computing (Viroli and Zambonelli, 2010; Viroli et al, 2011; Zambonelli et al, 2011). On the other hand, the development methodology for such systems always include simulation as a key step (Babulak and Wang, 2008; Bandini et al, 2009a; Macal and North, 2010; Molesini et al, 2011) to realise what-if analysis prior to actual development, to both assess the general validity of the designed mechanisms and to fine tune system parameters. There are many kinds of simulation tools available: they either provide programming/specification languages devoted to ease construction of the simulation process, especially targeting computing and social simulation (eg, as in the case of multi-agent based simulation (North et al, 2007; Schumacher et al, 2007; Sklar, 2007; Bandini et al, 2009a; Bandini et al, 2009b), or they stick to quite foundational computing languages to better tackle perfor- mance, mostly used in biology-oriented applications (Murata, 1989; Priami, 1995; Uhrmacher and Priami, 2005; Ewald et al, 2007). The ALCHEMIST simulator presented in this paper is aimed at bridging the gap between these approaches, target- ing chemical-oriented computational systems. It extends the basic computing model of chemical reactions—still retaining its high performance—toward ease applicability to complex situated computational systems (following the chemical- oriented abstractions studied in Zambonelli et al, 2011). In particular, ALCHEMIST is based on an optimised version of the Gillespie’s SSA (Gillespie, 1977) called Next Reaction Method (Gibson and Bruck, 2000), properly extended with *Correspondence: M Viroli, DISI-Universita di Bologna, Alma Mater Studiorum Universita di Bologna, via Venezia 52, Cesena, FC 47521, Italy. E-mail: mirko.viroli@unibo.it Journal of Simulation (2013) 7, 202–215 r 2013 Operational Research Society Ltd. All rights reserved. 1747-7778/13 www.palgrave-journals.com/jos/