Framework for Adaptive Swarm Simulation and Optimization Using MapReduce

Natural swarms can have multiple structures and follow many different patterns or laws. Most recent studies try to obtain the best solutions in very specific and sophisticated contexts. In this research, instead, an application to find a reasonable approximation to the behaviour of any possible incoming environment is developed. This paper describes a basic framework, GUI and algorithms established in a way that can be easily modified and adapted to desired paradigms, parameters and rules. In experimental research, this will be able to provide help for many applications where natural swarm patterns are followed but no deep, expert simulator has yet been developed. To deal with the complexity of the biggest applications, the simulations are to be run in parallel computing using the MapReduce framework. Background and Motivation We were asked to develop a software which would fit the requirements for taking part in the InformatiCUP [1]. In this year's edition the participants were asked to find the best algorithms some robots should follow under a specific scenario [2]. These are deployed on the ocean's surface and can only communicate between other nearby boids, knowing not more than their relative positions. The aim is to move around the ocean's surface collecting manganese and gather together after a certain time or command. Many spreading or path algorithms could be appropriate, but there was a lack of information about what to optimize (time, fuel, unique track covered ...) so the goals were too ambiguous. None of the existing swarm algorithms that we found satisfied our expectations. As seen in previous studies [3][4][5], it's common to focus research in carefully delimited conditions, but no adaptable platform to use with our constrictions was found. The goal of our project switched to cover this lack of resources and try to set the basis for a lot of possible future developments and applications in experimental research. Different states and phases were introduced to modify the different algorithms' weights according to the desired behaviour of the robots at every moment. Section 2 thoroughly explains the context of the project and the first steps taken, describing how starting with different deployment patterns causes a need of very different movement rules, so regular shapes -square, circleand irregular deployments -random, Gaussian, combinedwere created to study all the possibilities. In section 3, we show how the application itself works, and how the iteration over the desired parameters can provide some acceptable results and how should they be understood for future applications. Section 4 introduces the further need of using parallel computing for the execution of the application. In section 5 the results are showed and commented to extract some conclusions leading to the future work purposed in section 6. Requirements and Basis Settled The requirements for the InformatiCUP were constrictive, especially when establishing which communications could take place between the robots. The uncertainty caused by the incomprehensibly ambiguous formulation of the task gave us total freedom to focus on the creation of a new versatile framework and leave constrictions behind. The required small viewing range and limited knowledge lead to the idea of applying swarm particle algorithms. Any other paradigm followed would be by intuition, and the time was limited to a few weeks which could not be spent on trying unfunded ideas. To keep the difference between what the robots could know and what not, a Simulator class was created to keep track and manage most of the information and share it properly with the other classes. The robot instances are stored in a HashMap also containing information about position (classes Robot and Coordinates). Simultaneously, a first visualisation of a "sea" of 500 by 500 positions was ALIFE 14: Proceedings of the Fourteenth International Conference on the Synthesis and Simulation of Living Systems implemented, so it was time to start with the deployment configurations. Optimising the gathering time is different to optimising the unique surface travelled or the fuel used after they start. Moreover, if the initial set of robots is positioned in different way, it becomes a key fact when it matters of which algorithm to follow in order to run over the surface following some criteria.. Hence, many deployment methods are available: DeployRandom(). Deploys an amount of robots in random positions within the given sea limits. Initially this algorithm was implemented to verify and debug the need of creating a new robot only within the viewing range from at least one other robot. Later in the project, this distribution stayed in the simulator for further testing of new features (new visualisation, determine movement behaviours) and as one of the starting point algorithms for the InformatiCUP. As it is a very inefficient starting set the challenge was more ambitious. DeploySquare() and DeployCircle(). Both deploy an amount of robots following uniformly filled squared or circle patterns. The first robot is one of the four central points of the figure, which grows in a spiral or surrounding shape from the centre point. DeployGauss() and DeployBadCenters(). Given the initial random centre (mean) and variance, deploy the robots following a Gaussian distribution, or in two unequal Gaussian distributions. This offers an interesting and challenging beginning, where two unequal groups are deployed close enough to see each other but far enough to, following the main algorithms seen later, tend to split up into two groups of boids. This is very useful when extreme conditions are going to be tested. Fig. 1. In order, Random, Square, Circle, Gauss and BadCenters deployments shown in the GUI.