Introduction
Physarum Polycephalum, better known as “Slime Mould” is a single celled organism that can perform complex biological computations without any central controlling mechanism. Due to this property its computational abilities have become widely researched since the beginning of the 21st century. My initial studies were developed with SharpMatter and are based on Jeff Jones book “From Pattern Formation to Material Computation. Multi-Agent Modelling of Physarum Polycephalum ”. Specifically from chapter 3 -3.3. You can find a brief overview here
Each particle like agent is encoded with very simple rules of behaviour. The agents communicate and interact with each other through a “pheromone value” in the environment. Each agent can receive and modify the local values of the chemical through their 3 different sensors. Diffusion then helps to propagate the chemoattractant values through the environment. Depending on how each agent reads its environment different collective patterns emerge over time. The patterns formed are most of the times dynamic and adaptive to changing environmental conditions.
This type of system is of particular interest for me because it has a big potential to be used as a bottom-up strategy for spatial organization and also as a self organizing network system that could be used for structural purposes. I think an interesting principal about bottom-up computational models, is that they have all the ingredients to create higher intelligence. Normally, these kinds of systems have global parameters which the designer or computer programmer changes in a rather discrete and manual way. What will happen if these parameters are no longer global but local?, could these software agents actually evolve their own parameter space in order to achieve a specific goal? There could be huge potential, in my opinion, to combine a Machine Learning model with a bottom-up system to achieve such a thing.
Agent Morphology
Each agent has three different sensors which are in front of its current position, making the particle have a forward bias. Each sensor is rotated at a specific angle (SA) and is at a specified distance from the agents current position (SO). These characteristics are some of the parameters of all the Physarum model. Changing the SA and SO values causes a different types of patterns to emerge. The function of these sensors is to sample the chemical values at each of their corresponding positions, to later inform the behaviour of the agent during the Sensory stage of the simulation.

Chemoattractant Diffusion
The environment is represented as a 2-Dimensional grid, or scalar field as I like to call it, which in turn is made up of N X N amount of cells. Each cell holds a chemical value and information about its occupation state; meaning if It has an agent inside or not.
The chemoattractant values are diffused through out the field through a mean filter in a 3X3 Matrix. A mean filter in image processing simply means to compute the average value of all the neighbouring pixels. The diffusion value is applied to all cells simultaneously during every execution step of the simulation, the chemoattractant values are usually scaled by a decay factor of 0.1. Smaller values will create less damping of diffusion while larger values will make the chemoattractant “evaporate” quicker. The chemical is then diffused through the environment by a differential equation, that under the hood works exactly the same as the heat equation.
A further detail that can be added, is Jone’s implementation of a greyscale image which informs in which areas of the simulation environment there are smaller or larger damping values, to control the diffusion speed of the chemoattractant. By having different decay values, the chemical will have a differentiated diffusion rate over the environment and will affect the organizational patterns of the model.

Computing cell occupation
Cell occupation is calculated at every execution step of the simulation and it only influences the agent’s behaviour during its Motor stage. The strategy outlines here to calculate occupation is the way Jeff Jones implemented his model and it aims to avoid overcrowding. Each cell in the environment ( the environment is coded as a 2D scalar field) can only contain one agent at a time for it to receive a chemical value, usually a constant value of 5. If the agent’s next cell is empty, the agent will occupy the new cell and deposit a chemoattractant value and it will maintain its same orientation. If the next cell is occupied, the agent will stay in the same position and it won’t deposit a chemical value, rather, it will choose a random new orientation. The whole process is outlined in the diagrams shown below.
Pitfalls
This method to calculate cell occupancy is computationally expensive and for now it has been nearly impossible to parallelise having a big impact on the performance of the simulation. Just imagine if you have 400,000 cells, each cell is checking through all the population of particles for example 7,000 if it contains an agent or not. This means that per update call there are 2,800,000,000! computations to be done. Currently I am trying out to figure out a solution to this problem so I can scale up the simulation and include much larger populations of agents. Clearly 7,000 is not nearly enough!.
A failed attempt for now has been to use RhinoCommon’s spatial search algorithm R-Tree, I surely must be doing something wrong because my computer crashes when I try to use it.

Initial implementation videos
Initial transport network images. Parameter variation








