Data from: Smart self-propelled particles: A framework to investigate the cognitive bases of movement
Data files
Jul 03, 2023 version files 1.79 GB
-
1_paramsofreference.zip
-
2_surviveobjfunction.zip
-
3_turningpenalty.zip
-
4_slowspeed.zip
-
README.md
Abstract
We present a framework specifically developed to develop theories of spatial decision-making and to fully understand the rational of decisions embedded in an environment (and therefore the underlying evolutionary processes). This is achieved by the means of cognitive agents, moving thanks to artificial neural networks controlling movements and whose parameters are optimised with a genetic algorithms. Specifically, we investigate a simple task in which single agents need to learn to explore their square arena without leaving its boundaries. We show that agents evolve by developing increasingly optimal strategies to solve a spatially-embedded learning task while not having an initial arbitrary model of movements. The process allows the agents to learn how to move (i.e. by avoiding the arena walls) in order to make increasingly optimal decisions (improving their exploration of the arena).
Our dataset is made of 4 sets of simulations: parameters of reference, a survival objective function, introducing a turning penalty and with a slower speed (see details of parameters below). Each set of simulations is made of 60 trials with different initial conditions, each of which has been simulated with 20,000 agents for 150 generations. For each generation, we record:
- the score of the 20,000 agents across four runs with different and random initial conditions
- the score of the 20,000 agents from the same controlled initial condition (files with _com suffix)
- metadata with parameters used in this simulation
- parameters (weights and biases) of the artificial neural network of the best agent (i.e. with highest score) of each generation
- parameters (weights and biases) of the artificial neural network of the best agent (i.e. with highest score in the controlled initial condition run) of each generation (files with _com suffix)
Methods
The code generating this data is published as supplementary information of the article.
The parameters corresponding to the sets of simulations presented are as follows:
Name | Max. Turning Angle | Nb of Neurons in HL | Goal | Speed | Turning Penalty |
Parameters of reference | 6.28 | 3 | Explore | 50 | 0 |
Survival objective function | 6.28 | 3 | Survive | 50 | 0 |
Parameters with a turning penalty | 6.28 | 3 | Explore | 50 | 0.33 |
Parameters with a slow speed | 6.28 | 3 | Explore | 5 | 0 |
Usage notes
All files are text files with file extension .pkl. These files can be opened in Python and R using these two python functions to respectively read all simulation files and the files containing the parameters of the optimised artificial neural networks:
import pickle
def read_pickle_file(file):
with open(file, "rb") as curfile:
pickle_data = pickle.load(curfile)
return pickle_data
def read_brain_file(file):
with open(file, "rb") as curfile:
pickle_data = pickle.load(curfile)
return pickle_data.get_weights()
These functions can be called from Python or from R using the package Reticulate. For instance, these two lines in R will read the metadata file stored in the folder 'current.simulated.folder'
library(reticulate)
metadata <- read_pickle_file(paste("current.simulation.folder/", "metadata.pkl", sep = ""))