Modeling and Building a Robotic Sea Slug

Over the past two year Jennifer Kokkines has been being advised by Rhanor Gillette, modeling Pleurobranchaea in both software and recently transitioning over to robotics. I’ve helped out quite a bit, as I have experience both in programming and robotics, and thought it would be fun to write about! You may be asking yourself, why the hell would you want to make a robotic slug? The fact is, it’s cool and fun, but…

It also provides insight about the behavior, specifically we were looking into what causes animals to be social (more on this later).

From wikipedia
From wikipedia

Although we are only in the initial stages, we have wrote a few programs to simulate their behavior, and we are using a LEGO Mindstorm to simulate them in the real world.


We wanted to share with you our insight, how we over came problems, and provide our code/instructions so you can play with this yourself.


Obviously, there are limitations to what Jennifer and I can achieve with no funding, while full-time students, and working part-time. Further, this is only preliminary work. We intend to finish the work in the coming months now that we have positive results (and some funding).


Our project goals were simulate the behavioral circuit of the decision-making processes based on appetitive state in the Pleurobranchaea sea slug.

By starting off with this simple behavioral circuit, we can expand the circuit to encompass aggression based on territoriality and eventually simulate the behavior to the point where it ultimately evolved sociality. The hypothesis being that aggression and territoriality leads to social behavior. It should be noted, for territoriality to occur, food would have to be found in pools (thus easier to protect).

Pleurobranchaea, a Californian Sea Slug

Before we dive too into this, I wanted to share with you the basic Pleurobranchaea life cycle. It’s really quite simple, they eat, forage, and occasionally don’t like what they eat (i.e. toxic) and spit out their food. They will also mate, but we’ll skip that for now.

p_califPleurobranchaea are cannibalistic, solitary creatures. When it comes to foraging, they are able to learn prey preferences and aversions based on odor. One food source that is preferable to a Pleurobranchaea is the Hermissenda.


A Pleurobranchaea will make a cost-benefit decision as it forages by integrating its appetitive state, internal state and sensation. Hungry animals will choose to orient towards any stimuli it senses that is produced by prey, such as betaine (trimethylglycine). Slugs with an even higher appetite will bite or attack even when they sense noxious stimuli. A satiated slug will actively avoid food.

Our goals were to build off this, artificially taking the Pleurobranchaea to the next evolutionary level enabling a slug not only decides not to eat, but it also acts to defend its territory and protect its food.

Simulating Pleurobranchaea

We opted to simulate the Pleurobranchaea neural circuit using NetLogo. NetLogo is a super easy to use programming language, and is often an introductory programming language. Plus, NetLogo has a large number of built in images that we could use to graphically represent our sea slugs.

For example, to create the Pleurobranchaea “breed” in NetLogo, we called a few constructors, and then initialize the values.

Once we created the creatures, we set up their odors, which enable our creatures to smell them.

When we have odors and creatures all we then have to do is build a the control components I will not cover that here. However, it is possible to view the code on the github page. We used the following control/neural circuit below, it’s very simplistic, but that’s exactly why we selected these animals.

pleuro-modelThen once we created the basic motor functions, i.e. orient towards food. We moved to adding the aggressive state once they ate enough food. This adds quite a bit of complexity, but indeed creates a territorial sea slug.

teritorial-sea-slugOnce we implemented the control loops above, we were able to get excellent results. Eventually, we implemented two “breeds” of slugs, so that slugs of the same species would not fight each other. This lead to one species always taking over the pool and chasing the other species away. It always happened in the same way:

Phase #1: Identify the Food Pool 


Until one species gains enough satiation to fight, they will be tolerant of all species. However, once one of our simulated pleurobranchaea gain enough satiation, they will begin protecting the pool. Ultimately, this leads to a power struggle, which can take anywhere from a few seconds to minutes, real world time.

Phase #2: Food Monopolization


After a species gains a significant amount of satiation, they will increase their scent and begin chasing other species off. The dominant species will bite the weaker species, and cause “fear” in the other species, which cause them to keep their distance (further weakening them).

Phase #3: Territorial Expansion and Extinction


In the final phase, the dominate species will begin leaving the pool at maximum satiation, and chase the now completely weak species. Because we did not enable the destruction of the pleurobranchaea or reproduction, the weaker species will not go extinct, however we intend to build out that portion of our simulation in the future.

The point is that there seemed to be a somewhat social behavior. Even though technically the same species only smells the same, and they wont attack each other, they “work together” to dominate the pool. Although this is technically not social behavior, our goal (in this iteration) was to simply show social-like behavior we feel we became close.

Our Robotic Sea Slug

We decided to move to the next phase and begin using robots. Although it is easier to simulate creatures, robots are fun, and they also attract a crowd (i.e. more funding). Here’s a lovely video of our sea slug protecting the lighted “food pool” from my hand.

It’s pretty lame, but it’s actually more complex than the sea slugs we are trying to simulate! More or less, all we did was take the control loop above and created some simple python code (using python-nxt) to implement the behavior.

The code is rather rough, but it does what we desired for a preliminary test, and now we are in the process of purchasing more robots. It should also be noted, that getting blue tooth to work with python on OSX Mavericks is pretty difficult and at the time of the video we found it impossible (switched to Debian). We were able to connect to the robot, but were unable to send commands for some reason.

Most importantly, implementing the robotic version of the sea slug gave Jennifer and I the opportunity to have one of the more popular exhibits at UIUC Beckman Open House 2015.


Who knew we could make sea slugs fun! It also had a lot of interest among the neuroscientists attending as our approach used a mixture of neuroscience, control theory, game theory, computer science, and biology. It was a lot of fun, and I hope to continue the work, as we intend to present it in Chicago the fall of 2015 at the Neuroscience conference. Hopefully, we’ll have a whole bunch of robotic sea slugs running around.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

 characters available

Time limit is exhausted. Please reload the CAPTCHA.