Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
fef62d1
removed CTRNN
adampdp Jun 19, 2025
946e7e1
updated datawriter
adampdp Jun 20, 2025
4420459
data updates
adampdp Jun 20, 2025
065d718
brought it test_CO18 files
adampdp Jul 25, 2025
32e54b9
merged
adampdp Jul 26, 2025
4f76d60
merged more
adampdp Jul 26, 2025
290fa5d
added papers to history.md
adampdp Jul 29, 2025
191475a
updated phenotype plot
adampdp Jul 29, 2025
f798664
fixed bug in run_main
adampdp Jul 29, 2025
55c1fd3
bug in resume
adampdp Jul 29, 2025
8c5563f
added W2Dmoddev option
adampdp Jul 29, 2025
847ae9e
changed CO tests and updated CEOrientation
adampdp Jul 30, 2025
2ca4f4f
added cell xml files
adampdp Jul 30, 2025
5286a57
latest 45 files
adampdp Jul 30, 2025
57f4fa6
fixed muscle simulation
adampdp Jul 30, 2025
1328c0b
added neuroml musc demo simulation
adampdp Aug 7, 2025
ad8c945
added Worm2Dmods for oscillator
adampdp Aug 7, 2025
fc4b086
added NSosc Nervous system
adampdp Aug 7, 2025
c26b533
updates to W2Dosc
adampdp Aug 8, 2025
2bb16f8
added evolvable
adampdp Aug 8, 2025
9dbfdec
added Evolvable.h
adampdp Aug 8, 2025
b622ef1
updates to worm2dmods
adampdp Aug 10, 2025
f3e4e8e
updates to worm2dmods
adampdp Aug 11, 2025
0a8b1b1
added main_osc
adampdp Aug 11, 2025
cd2750b
added main_osc
adampdp Aug 11, 2025
221150a
updated main_osc
adampdp Aug 11, 2025
b9aee41
updated main_osc
adampdp Aug 11, 2025
f3b3334
added W2Dosc example
adampdp Aug 11, 2025
076b8e6
try W2DoscHalf
adampdp Aug 12, 2025
d3ce7f7
further try W2DoscHalf
adampdp Aug 12, 2025
bad2f2e
further try W2DoscHalf
adampdp Aug 12, 2025
aaa94e1
added bestphen output file
adampdp Aug 13, 2025
0852b67
added W2Dosc example directory
adampdp Aug 13, 2025
d58c042
better W2Dosc example
adampdp Aug 14, 2025
726ad5a
fixed plotting bug
adampdp Aug 14, 2025
c4c8ee0
made W2Dosc base for W2Dosc21
adampdp Aug 14, 2025
1c1506b
further updates
adampdp Aug 15, 2025
a047997
reworked muscle connector
adampdp Aug 15, 2025
b70c77c
added W2Dosc21
adampdp Aug 15, 2025
8a4ddcb
added W2Dosc xml
adampdp Aug 16, 2025
0a62368
updated W2Dosc xml
adampdp Aug 16, 2025
3af34b4
added json support
adampdp Aug 16, 2025
16aff11
updates to neuroml
adampdp Aug 17, 2025
d1c0cd2
updates for W2Dosc nml
adampdp Aug 17, 2025
aed509f
updates for W2Dosc nml
adampdp Aug 17, 2025
af26918
further nml updates
adampdp Aug 17, 2025
743af49
updates to nml
adampdp Aug 17, 2025
ff15297
W2Dosc nml updates
adampdp Aug 18, 2025
d144503
added Worm2DPars
adampdp Aug 18, 2025
f98b76b
nml updates
adampdp Aug 18, 2025
23386cc
restructured for bug
adampdp Aug 18, 2025
a75f4aa
added json for osc parameters
adampdp Aug 19, 2025
e3f4c4d
added setupmuscles from json
adampdp Aug 19, 2025
c0c07a8
updates to nml and W2Dosc
adampdp Aug 19, 2025
a3c1c5b
added osc sim
adampdp Aug 20, 2025
52d235a
added experiments osc_sim and nml
adampdp Aug 20, 2025
1672354
fixed bug, replaced osc_sim
adampdp Aug 20, 2025
6f403a0
fixed for ruff
adampdp Aug 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .test.CO.omt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ experiments:
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.6
threshold: 0.9
tolerance: 0.0
3 changes: 1 addition & 2 deletions .test.COW2D.mep
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ system: Testing activity of some neurons
experiments:
Test:
expected:
spike times: [0.06, 1.53, 5.73, 11.32, 15.51, 19.72]

spike times: [1.93, 6.12, 10.75, 14.93, 19.05]
2 changes: 1 addition & 1 deletion .test.COW2D.omt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ experiments:
scaling: [1, 1]
spike detection:
method: threshold
threshold: 0.6
threshold: 0.9
tolerance: 0.0
8 changes: 5 additions & 3 deletions CE_orientation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const double TauMax = HST;
const double MinNeckTurnGain = 1.0;
const double MaxNeckTurnGain = 2.0;

SuppliedArgs supArgs1;
SuppliedArgsCO supArgs1;


// Global variables
Expand Down Expand Up @@ -353,8 +353,10 @@ int main (int argc, const char* argv[])
s.SetSearchResultsDisplayFunction(ResultsDisplay);
s.SetSelectionMode(RANK_BASED); //{FITNESS_PROPORTIONATE,RANK_BASED}
s.SetReproductionMode(GENETIC_ALGORITHM); // {HILL_CLIMBING, GENETIC_ALGORITHM}
s.SetPopulationSize(26); //96
s.SetMaxGenerations(40); //100
//s.SetPopulationSize(26); //96
s.SetPopulationSize(supArgs1.pop_size); //96
//s.SetMaxGenerations(40); //100
s.SetMaxGenerations(supArgs1.max_gens);
s.SetMutationVariance(0.05);
s.SetCrossoverProbability(0.5);
s.SetCrossoverMode(UNIFORM); //{UNIFORM, TWO_POINT}
Expand Down
4 changes: 4 additions & 0 deletions F2_fig_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def make_fig(plot_format):
###############################
def plot_worm(ax, k):
dx, dy = x[k] - xc[k], y[k] - yc[k]
dx = dx / 100.0
dy = dy / 100.0
# b = np.arctan((dx[0]-dx[-1])/(dy[0]-dy[-1]))
b = 3 * np.pi / 2 + np.arctan((dx[0] - dx[-1]) / (dy[0] - dy[-1]))
tx = np.cos(b) * dx - np.sin(b) * dy
Expand All @@ -85,6 +87,8 @@ def plot_worm(ax, k):
ax.plot(tx + r / 2.0 * np.cos(ta), ty + r / 2.0 * np.sin(ta), "k", lw=1)
ax.set_xlim(-0.0005, 0.0005)
ax.set_ylim(-0.00015, 0.00015)
# ax.set_xlim(-0.05, 0.05)
# ax.set_ylim(-0.015, 0.015)
ax.text(
-0.0004,
0.0001,
Expand Down
59 changes: 59 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,62 @@ This paper develops a neuroanatomically-grounded model of salt klinotaxis, a for
<details><summary>Abstract</summary>
Increased efforts in the assembly and analysis of connectome data are providing new insights into the principles underlying the connectivity of neural circuits. However, despite these considerable advances in connectomics, neuroanatomical data must be integrated with neurophysiological and behavioral data in order to obtain a complete picture of neural function. Due to its nearly complete wiring diagram and large behavioral repertoire, the nematode worm Caenorhaditis elegans is an ideal organism in which to explore in detail this link between neural connectivity and behavior. In this paper, we develop a neuroanatomically-grounded model of salt klinotaxis, a form of chemotaxis in which changes in orientation are directed towards the source through gradual continual adjustments. We identify a minimal klinotaxis circuit by systematically searching the C. elegans connectome for pathways linking chemosensory neurons to neck motor neurons, and prune the resulting network based on both experimental considerations and several simplifying assumptions. We then use an evolutionary algorithm to find possible values for the unknown electrophsyiological parameters in the network such that the behavioral performance of the entire model is optimized to match that of the animal. Multiple runs of the evolutionary algorithm produce an ensemble of such models. We analyze in some detail the mechanisms by which one of the best evolved circuits operates and characterize the similarities and differences between this mechanism and other solutions in the ensemble. Finally, we propose a series of experiments to determine which of these alternatives the worm may be using.
</details>

## 2016

### Propagation of rhythmic dorsoventral wave in a neuromechanical model of locomotion in Caernohabditis elegans

**Eduardo J. Izquierdo, Randall D. Beer**


https://direct.mit.edu/isal/proceedings/alif2016/28/544/99414

<details><summary>Abstract</summary>
With 302 neurons and a fully reconstructed connectome, Caernohabditis elegans is an ideal candidate organism to study how behavior is grounded in the interaction between an organism's brain, its body, and its environment. Since nearly its entire behavioral repertoire is expressed through movement, understanding the neuromechanical basis of locomotion is especially critical as a foundation upon which analyses of all other behaviors must build. In this extended abstract, we report on the evolution and analysis of an integrated neuromechanical model of forward locomotion.
</details>




## 2018

### From head to tail: a neuromechanical model of forward locomotion in Caenorhabditis elegans

**Eduardo J. Izquierdo, Randall D. Beer**

https://royalsocietypublishing.org/doi/full/10.1098/rstb.2017.0374


<details><summary>Abstract</summary>
With 302 neurons and a near-complete reconstruction of the neural and muscle anatomy at the cellular level, Caenorhabditis elegans is an ideal candidate organism to study the neuromechanical basis of behaviour. Yet despite the breadth of knowledge about the neurobiology, anatomy and physics of C. elegans, there are still a number of unanswered questions about one of its most basic and fundamental behaviours: forward locomotion. How the rhythmic pattern is generated and propagated along the body is not yet well understood. We report on the development and analysis of a model of forward locomotion that integrates the neuroanatomy, neurophysiology and body mechanics of the worm. Our model is motivated by experimental analysis of the structure of the ventral cord circuitry and the effect of local body curvature on nearby motoneurons. We developed a neuroanatomically grounded model of the head motoneuron circuit and the ventral nerve cord circuit. We integrated the neural model with an existing biomechanical model of the worm's body, with updated musculature and stretch receptors. Unknown parameters were evolved using an evolutionary algorithm to match the speed of the worm on agar. We performed 100 evolutionary runs and consistently found electrophysiological configurations that reproduced realistic control of forward movement. The ensemble of successful solutions reproduced key experimental observations that they were not designed to fit, including the wavelength and frequency of the propagating wave. Analysis of the ensemble revealed that head motoneurons SMD and RMD are sufficient to drive dorsoventral undulations in the head and neck and that short-range posteriorly directed proprioceptive feedback is sufficient to propagate the wave along the rest of the body.
</details>

## 2018

### Potential role of a ventral nerve cord central pattern generator in forward and backward locomotion in Caenorhabditis elegans

**Erick Olivares, Eduardo J. Izquierdo, Randall D. Beer**

https://direct.mit.edu/netn/article/2/3/323/5431

A computational model grounded in the available neuroanatomy and neurophysiology to explore the space of possible configurations of the circuit that matched the neural traces observed during forward and backward locomotion in the worm.


<details><summary>Abstract</summary>
C. elegans locomotes in an undulatory fashion, generating thrust by propagating dorsoventral bends along its body. Although central pattern generators (CPGs) are typically involved in animal locomotion, their presence in C. elegans has been questioned, mainly because there has been no evident circuit that supports intrinsic network oscillations. With a fully reconstructed connectome, the question of whether it is possible to have a CPG in the ventral nerve cord (VNC) of C. elegans can be answered through computational models. We modeled a repeating neural unit based on segmentation analysis of the connectome. We then used an evolutionary algorithm to determine the unknown physiological parameters of each neuron so as to match the features of the neural traces of the worm during forward and backward locomotion. We performed 1,000 evolutionary runs and consistently found configurations of the neural circuit that produced oscillations matching the main characteristic observed in experimental recordings. In addition to providing an existence proof for the possibility of a CPG in the VNC, we suggest a series of testable hypotheses about its operation. More generally, we show the feasibility and fruitfulness of a methodology to study behavior based on a connectome, in the absence of complete neurophysiological details.
</details>


## 2021

### A Neuromechanical Model of Multiple Network Rhythmic Pattern Generators for Forward Locomotion in C. elegans

**Erick Olivares, Eduardo J. Izquierdo, Randall D. Beer**

https://www.frontiersin.org/journals/computational-neuroscience/articles/10.3389/fncom.2021.572339/full


<details><summary>Abstract</summary>
Multiple mechanisms contribute to the generation, propagation, and coordination of the rhythmic patterns necessary for locomotion in Caenorhabditis elegans. Current experiments have focused on two possibilities: pacemaker neurons and stretch-receptor feedback. Here, we focus on whether it is possible that a chain of multiple network rhythmic pattern generators in the ventral nerve cord also contribute to locomotion. We use a simulation model to search for parameters of the anatomically constrained ventral nerve cord circuit that, when embodied and situated, can drive forward locomotion on agar, in the absence of pacemaker neurons or stretch-receptor feedback. Systematic exploration of the space of possible solutions reveals that there are multiple configurations that result in locomotion that is consistent with certain aspects of the kinematics of worm locomotion on agar. Analysis of the best solutions reveals that gap junctions between different classes of motorneurons in the ventral nerve cord can play key roles in coordinating the multiple rhythmic pattern generators.
</details>

1 change: 1 addition & 0 deletions NervousSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class NervousSystem : public NervousSystemBase {
void SetNeuronTimeConstant(int i, double value) {taus[i] = value; Rtaus[i] = 1/value;};
double NeuronExternalInput(int i) {return externalinputs[i];};
void SetNeuronExternalInput(int i, double value) {externalinputs[i] = value;};
void IncNeuronExternalInput(int i, double value) {externalinputs[i] += value;};
double ChemicalSynapseWeight(int from, int to);
void SetChemicalSynapseWeight(int from, int to, double value);
double ElectricalSynapseWeight(int from, int to);
Expand Down
12 changes: 7 additions & 5 deletions TSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ TSearch::TSearch(int VSize, double (*EvalFn)(TVector<double> &, RandomState &))
SetSearchConstraint(1);
SetReEvaluationFlag(0);
SetCheckpointInterval(0);
cptfilename = "search.cpt";
}


Expand Down Expand Up @@ -861,12 +862,12 @@ void TSearch::SortPopulation(void)
// ...
// <RandomState N>

void TSearch::WriteCheckpointFile(void)
void TSearch::WriteCheckpointFile()
{
ofstream bofs("search.cpt", ios::binary);

ofstream bofs(cptfilename, ios::binary);
int i;
double d;

// Write the vector size and population size
bofs.write((const char*) &(vectorSize), sizeof(vectorSize));
i = PopulationSize();
Expand Down Expand Up @@ -925,12 +926,13 @@ void TSearch::WriteCheckpointFile(void)
// Write out the random state for each individual in the population
for (int i = 1; i <= PopulationSize(); i++)
RandomStates[i].BinaryWriteRandomState(bofs);

}


void TSearch::ReadCheckpointFile(void)
void TSearch::ReadCheckpointFile()
{
ifstream bifs("search.cpt", ios::binary);
ifstream bifs(cptfilename, ios::binary);
int i;
double d;
TVector<int> iv;
Expand Down
6 changes: 5 additions & 1 deletion TSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class TSearch {
// Status Accessors
int Generation(void) {return Gen;};
TVector<double> &Individual(int i) {return Population(i);};
//RandomState & itsRandomState(int i) {return RandomStates(i);};
double Fitness(int i) {return fitness(i);};
double Performance(int i) {return Perf(i);};
double BestPerformance (void) {return BestPerf;};
Expand All @@ -130,12 +131,15 @@ class TSearch {
// Input and output
void WriteCheckpointFile(void);
void ReadCheckpointFile(void);

//friend ostream& operator<<(ostream& os, TSearch& s);
//friend istream& operator>>(istream& is, TSearch& s);
string cptfilename; //added search filename

void DoSearch(int ResumeFlag); //make accessible
private:
// Helper Methods
void DoSearch(int ResumeFlag);
//void DoSearch(int ResumeFlag);
int EqualVector(TVector<double> &v1, TVector<double> &v2)
{
if (v1.Size() != v2.Size()) return 0;
Expand Down
26 changes: 22 additions & 4 deletions VectorMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ class TVector {
// Constructors
TVector(void);
TVector(int LowerBound, int UpperBound);
TVector(TVector<EltType> &v);
TVector(TVector<EltType> &v);


// The destructor
~TVector();
// Accessors
int Size(void) {return ub - lb + 1;};
int Size(void) const {return ub - lb + 1;};
void SetSize(int NewSize) {SetBounds(lb,NewSize+lb-1);};
int LowerBound(void) {return lb;};
int LowerBound(void) const {return lb;};
void SetLowerBound(int NewLB) {SetBounds(NewLB,ub);};
int UpperBound(void) {return ub;};
int UpperBound(void) const {return ub;};
void SetUpperBound(int NewUB) {SetBounds(lb,NewUB);};
void SetBounds(int NewLB, int NewUB);
// Other stuff
Expand All @@ -54,6 +56,9 @@ class TVector {
return (*this)(index);
#endif
};


inline const EltType &operator()(int index) const; //added const operator
inline EltType &operator()(int index);
inline TVector<EltType> &operator=(TVector<EltType> &v);

Expand Down Expand Up @@ -94,6 +99,8 @@ TVector<EltType>::TVector(TVector<EltType> &v)
}




// The destructor

template<class EltType>
Expand Down Expand Up @@ -172,6 +179,17 @@ void TVector<EltType>::InitializeContents(EltType v1,...)

// Overload the () operator to provide safe indexing

template<class EltType>
inline const EltType &TVector<EltType>::operator()(int index) const
{
if (index < lb || index > ub)
{
cerr << "Vector index " << index << " out of bounds\n";
exit(0);
}
return Vector[index];
}

template<class EltType>
inline EltType &TVector<EltType>::operator()(int index)
{
Expand Down
Loading
Loading