Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

WormSim C. elegans simulation engine from Boyle, Berri and Cohen 2012

See Boyle, Berri and Cohen, Gait modulation in C. elegans: an integrated neuromechanical model, Front. Comput. Neurosci., 2012.

This file is based on the original readme.txt in the Supplemental data.

Instructions for running "WormSim" software on a Linux system.

Installation guide:

  1. Clone this project:
git clone https://github.com/OpenSourceBrain/CelegansNeuromechanicalGaitModulation.git
  1. Go to "WormSim" directory.
cd WormSim
  1. Set idaInstallDir:
idaInstallDir=`pwd`/Sundials
  1. Go to sundials-2.3.0 directory, configure & make:
cd sundials-2.3.0
./configure CC=g++ --prefix=$idaInstallDir --disable-mpi --disable-fcmix
make
make install
  1. Look carefully at the resulting output and check for any error messages (there shouldn't be any...). Fix and repeat step 4 if necessary.

  2. You should now be able to proceed to running the simulator.

Usage guide:

  1. The whole integrated model is in worm.cc. Edit this to change any aspects of the model e.g. different environments (water -> intermediate -> agar, with and without objects).

  2. To compile the program, make sure you're in the "Model" directory.

  3. Enter the command:

make
  1. Check the resulting output for errors (some warnings are unfortunately inevitable, but they shouldn't be a problem), fix and re-run "make" if necessary.

  2. Enter the following command and wait for it to complete.

./program
  1. program will generate a file called simdata.csv, and possibly also objects.csv (if objects are being used).

  2. Open the Matlab viewer program, found in WormSim/MatlabSupport/.

matlab WormView.m

If you don't have access to Matlab, try Octave, or should be possible to reproduce this viewer in another language by examining the code and translating it as appropriate.

MatlabView

  1. Try also the new Python viewer:
python WormView.py

PythonView

Note: to get the objects shown in the visualisations above, change the following values in worm.cc, then remake the main program, and rerun:

#define DURATION 20			    //duration of simulation (in seconds)
#define MEDIUM 1.0				//change in the range 0.0 (water) to 1.0 (agar)
#define OBJECTS 20				//set number of objects (>= 0)
#define LAYOUT 2				//change between 0 (square) 1 (hex) 2 (random)