• No results found

A SNN engine was created in order to implement the SNN model described in this chapter as well as other experiments described in this thesis. The coding of the engine was done entirely in Netlogo language as a Netlogo model (See sample code in the appendix). Netl- ogo is a software application that provides an integrated environment for the simulation and programming of multi-agent models and the study of emergent behavior in complex systems [87]. The netlogo programming language provides a set of primitives which allows the agents to perceive and modify their virtual world and also to communicate and interact with other agents. Apart from its simplicity, one of the main advantages of using Netlogo in this work, is that it allows to monitor and manipulate on each single simulation iteration the state of each element of the neural circuit including: (1) neurons and their internal variables, (2) synapses and their parameters (efficacy and delay) and (3) ongoing pulses. Manipulation of the neural circuit can be done with commands given through the observer prompt or by using the agent monitoring tool provided by the Netlogo GUI.

6.5.1

Modelling with Agents and Patches

In Netlogo (version 5.3 at the time) there are four main types of agents. These agents are: Turtles, patches, links and the observer [87]. The turtles are motile individual agents from where other user-defined agents can be derived. Turtles can be created or destroyed at any time during the simulation. Different ’breeds’ (user defined types) of turtles can be defined, each one having its own attributes and behaviours. Patches are non motile agents. Each patch has fix coordinates corresponding to a unique position in the virtual

2-dimensional plane of the simulated world. Patches can have their own user-defined attributes and behaviours in a similar way to turtles, however, with the difference that they can not move. A link is a type of agent that represents an association between two turtles-agents. Thus, a link has two main attributes each one representing a turtle-agent at each one of its ends. Similarly to turtles and patches a link may have its own user defined attributes and behaviours. The link is non motile and is shown as a line connecting the two turtles. The observer, is a single and unique agent (no agents can be derived from it) that can create, observe and command other type of agents.

In this experimental setup the simulated insect-like agent is represented by a turtle agent. Neurons are implemented as turtle agents using a defined ’breed’ that implement the at- tributes and dynamics of the artificial neuron. Synapses on the other hand are implemented as agents of type link. All simulated entities including the artificial insect, neurons and synapses have their own variables and functions that can be manipulated using standard Netlogo commands. The Netlogo virtual world consists of a two dimensional grid of patches where each patch corresponds to a point (x; y) in the plane. In a similar way to the turtles, the patches own a set of primitives which allow the manipulation of their characteristics and also the programming of new functionalities and their interaction with other agents. The visualization of the insect and its environment is done through the Netlogo’s world-view interface. The virtual world of the insect is an ensemble of patches of four different colours, where each one of them is associated with a different type of stimulus. As described before, black and red patches are both used to represent harmful stimulus. Thus, if the insect is positioned on a black or red patch, this will trigger a reaction in the insect’s nociceptor (pain sensor) and its corresponding neural pathway (see figure 6.3). On the other hand, green patches trigger a reaction in the reward sensor of the insect whenever it is positioned on one of them. White patches represent empty spaces and do not trigger any sensory information in the insect.

6.5.2

The Simulated Insect’s World

Timing and Movement

The simulation follows a clock-driven approach where the elapsed time is given by a counter whose value is increased at a discrete time step (Netlogo ’tick’) in every cycle or iteration when the simulation is executed. The movement of the insect is not only determined by its neural controller but it also depends on the rotation degrees and number of patches at which the insect moves on each iteration or tick. For the experiments described in this chapter, in one iteration or tick the number of patches that the insect can move in response to the activation of motoneuron ’M’ is 1-patch. On the other hand the amount of rotation in response to the activation of motoneuron ’R’ is 5 degrees.

Space and Stimuli

As mentioned before the Netlogo virtual world consists of a two dimensional grid of patches where each patch corresponds to a point (with coordinates x; y) in the plane [87]. The virtual world of the insect is an ensemble of patches of four different colours, where each one of them is associated with a different type of stimulus.

During the first experiment black and red patches are both used to represent harmful stimulus (e.g. walls and predators). Thus, if the insect is positioned on a black or red patch, the simulation will activate the insect’s nociceptor (activating pain sensor) and its corresponding neural pathway. On the other hand, green patches trigger the activation of the reward sensor whenever the insect is positioned on one of these patches. White patches represent empty spaces and do not trigger any sensory information in the insect. The type of stimulus associated to each colour can be changed any time during the simulation allowing to carry out the different experimental conditions. This is done using the implemented GUI interface for switching on and off the association between colours and the type of stimulus elicited on the insect. (See Figure 6.19).

The visualisation of the simulation is divided in two areas inside the Netlogo’s world-view interface: (1) The Neural circuit topology which is shown on the left half of the screen. And (2) the insect and its environment which are shown on the right half side of the screen. This is shown in Figure 6.7 as follows:

Figure 6.7: Visualization area in the simulation environment

The topology screen reflects any change (adding or removing components) done to the neural circuit in each iteration. The world screen on the right side, shows the simulated virtual world including patches of four different colours; white, black, red and green representing empty spaces, walls, harmful and rewarding stimuli respectively. The virtual insect is represented with an ant shaped agent that starts moving once the simulation is initiated. In addition to the simulated world, Netlogo provides several interface objects for plotting and monitoring agents behaviour. In the presented simulation, two plots have been implemented in order to visualize the change over time of the membrane potential of any two neurons selected by the experimenter.