Serendip is an independent site partnering with faculty at multiple colleges and universities around the world. Happy exploring!

Emergence, Projects

Paul Grobstein's picture

Welcome to the on-line forum associated with the Biology 361 = Computer Science 361 at Bryn Mawr College. Its a way to keep conversations going between course meetings, and to do so in a way that makes our conversations available to other who may in turn have interesting thoughts to contribute to them. Leave whatever thoughts in progress you think might be useful to others, see what other people are thinking, and add thoughts that that in turn generates in you.

Plans/ambitions for your semester project?  Things discovered/learned along the way?
jguillen's picture

project idea

I'm at the point in my model where turtles are interacting and learning through experience and interaction.

I also have a button that can add more barriers and affect the movement of the turtles. With this button I can also create holes in the barriers. This button sort of adds a bit more complexity in terms of the path that the turtles follow as they navigate the environment. 

I would now like to start adding graphs to my model. More specifically, I want to add a graph that keeps track of the learning by interaction. I want the graph to keep track of the interactions. I also want the graph to keep track of the turtles that are learning by experience. Maybe both of these types of learning can be included on one graph.

Also, I would like to introduce conflict into my model by creating a malicious turtle, which harms turtles/confuses them by sharing information that makes them forget their knowledge of barrier avoidance. The malicious turtle could either kill the turtle that it comes in contact with or make that turtle forget its knowledge of barrier avoidance.

I'm thinking that the malicious turtle could cause more harm to the turtles that have had less interactions by killing them and harming the stronger turtles (those that have more interactions) by taking away their knowledge.

I'm interested in seeing how this manipulation would affect the turtle population. Also, it would be nice to add one malicous turtle after a certain number of clicks...

These are a few ideas that I hope to add to my model this week.

jguillen's picture

project idea

My model is the one dealing wih learning by interaction. I am interested in creating a model in which turtles learn from their ancestors. By designing a model in which turtles can communicate with each other I would like for that communication to be able to make certain varaibles switch/adjust, so that the turtles with the most health are more likely to inject their knowledge into the brains of others.

I've started to play with this idea and have been able to come up with a model in which the turtles start out not knowing to avoid barriers. Once a turtle hits a barrier it learns to avoid it and if it comes into contact with another turtle that has not learned to avoid a barrier, it will pass its knowledge onto that turtle so that it can also avoid the barriers. However, it is possible that other turtles will learn to avoid the barriers based on experience and without interaction.

If a turtle learns by interaction it turns blue.

So far my model is showing two things: learning by interaction and learning by experience with the environment.

Using Evan's help, I have also been able to add a button that allows me to play with the barriers and poke holes in them.

I'm at the point where I want to introduce something else to my model. I'm thinking about introducing another variable for those turtles that have learned by interaction. I would like to give turtles that have learned by interaction an advantage in the environment, but I'm not sure what the advantage would be yet.

I know that I oringinally came up with an idea of a model that would show competition...it would be nice to add that component to this model of interaction.

It would also be nice to add something related to links...to keep track of the number of links present in the world between turtles.

evanstiegel's picture

my project

I am steadily making progress on my project.  To remind everyone, my project is a model of trends as they spread according to Malcolm Gladwell's book, The Tipping Point.  Specifically, I am incorporating the individuals he discusses who spread fads or messages into my model.  In my base model, I have 1000 red turtles and 1 green turtle, who is the initiator of the trend.  Once the green turtle comes into contact with three other turtles, it turns the next one it comes into contact with green as well (it spreads the fad).  Eventually, all the turtles will become green.  

So far, I have incorporated Gladwell's idea of salesmen into this model, and I am working on incorporating connectors right now. Salesmen, which if you remember are very convincing individuals, are blue turtles that, once green, will turn every turtle they run into green as well rather than having to run into three like the normal turtles.

The connectors (individuals that have a lot more connections than a typical person) that I am working on now will once they are green be able to turn multiple turtles in an area green as well. I'm just having some difficulty with the code for this.

Lastly, mavens, or the information holders that Gladwell discusses are last on my agenda.  I am having difficulty coming up with ideas on how to model them. 

I am excited to show everybody what I have so far in class tomorrow. 

evanstiegel's picture

update

I have successfully incorporated connectors into my model. They start off as yellow people and turn other people green within a small radius.  I've started to generate some code for maven's but they still have a long way to go.  I plan on them to have the ability to attract other peopleto them.  I have been reading over and trying to undertsand code from a flocking model in order to generate this code.  This code however is pretty complicated.  I am also working on making a graph which tracts what percentage of all people are green vs. red (have acquired the fad vs. have not acquired the fad).

evanstiegel's picture

I have now modeled for all

I have now modeled for all three person (salesmen, mavens, connectors).  I switched the behavior between mavens and connectors because I decided that the other's behavior better represented that particular person.  So, connectors now display flocking behavior, and mavens spread the trend within a particular radius.  I have also added a graph which tracks how long it takes for the entire population to turn green.  This addition is great because it allows one to adjust the initial number of salesmen, mavens, and connectors to see what combination allows for the fastest spread of the trend.  I might be done but I am still open for idea of any additions I can make. 
jguillen's picture

Project idea

I want to show two different ideas in my model: competition and learning behavior.  

For my project I would like to come up with a model in which the turtles would exhibit avoidance learning behavior towards barriers AND in which the turtles would also compete against each other in terms of visiting patches. The goal is to visit the most number of patches without stepping on a barrier.

Initiallly, I want the turtles to be able to step on any patch and to be punished as soon as they hit a colored barrier. Once they've hit a barrier their health will change and they should learn to avoid the barrier.

The competition component of the model would involve different turtles competing against each other with the goal of stepping on the most number of patches. A button to keep track of this would be helpful. Also once the turtle learns that a barrier must be avoided, if it does happen to touch the barrier again I want it to remain stuck at that fixed point. I hope that I can some how control the model in such a way that ultimately only one turtle will be left and will thus be the winner turtle.

Additional buttons could control the level of competition...and this could be done by adding more turtles or barriers...I think...These are just initial thoughts. Please feel free to provide feedback.

kdilliplan's picture

NetLogo Bottleneck Model

            I am working on a model that will show the effects of a bottleneck event on a population.  I want to be able to show that a change in the distribution of traits in a population can be driven by simple random events without trait selection playing a part at all.  I am starting simply, with a population of turtles that spawn new turtles that are identical to them at a set interval.  When the “bottleneck” button is pushed, all turtles in a certain area of the world will die, and the rest will continue to reproduce.  Currently, I am borrowing a few elements of Evan’s model, specifically the graph of trait distributions, to show the effects of the bottleneck.  I want to move towards a more visual model, probably using turtle color to represent traits, as well as a graph similar to the one in the Wolves and Sheep Predation model in the Netlogo library to show the relative abundance of each trait in the population.  I also plan to try and have the turtles “mate” instead of spontaneously producing offspring, and having the traits of the offspring be dependent on the traits of their parents in a simple Mendelian inheritance pattern, mostly to bring the model a little closer to an actual biological context.  I may see if I can include a feature that introduces a random mutation to see what that does to the population, and if I’m feeling particularly ambitious, I may add a feature that does include selection (some sort of probability of dying depending on color?) so the effects of selection can be compared to the effects of a bottleneck event in the same model.  

kdilliplan's picture

Another Update

I'm still pretty much on track with my model.  I've determined that there should only be one reproduction each time two turtles are on the same patch, since each turtle moves forward one patch, checks to see if another turtle is there, and reproduces if there is.  Then the next turtle does the same, so the second turtle would move before checking if they can mate.  My problem now is writing code that identifies characteristics of the turtle that moves and the turtle already on the patch.  I am trying a system similar to the Cellular Automata setup, where a patch's color depended on the patch and it's two neighbors.  Here, the offspring's color will depend on the color of its parents.  Can anyone help me sort through the code that can help me do this?  I've figured out a way to randomize the alleles of the heterozygote turtles (I think) so now I just need a way to distinguish between the two turtles on the patch.
kdilliplan's picture

Update

I continue to work on my Bottlenecking model as originally planned.  So far, I've managed to build a model that has turtles "breed" if they are old enough and if they're on the same patch.  An observer can set how many turtles to start with, how many turtles there can be at one time, how old the turtles have to be before they can reproduce, and their maximum lifespan.  I've included two different colors, set at random at the setup, which are passed directly on to their offspring as well as moniters to show the ratio of the colors in the population.  The bottleneck event can be triggered by hitting the button.  So far, I've set up a bottleneck event that kills large numbers of turtles based on location in the world, and one that kills them randomly based on ID number.  I'm still working on adding a genetic component into the model, but I haven't gotten there yet.

I've been having two main problems.  First, I've been trying to mess with the parameters so that the model makes sense in a biological context.  I suppose I could leave the sliders in so the user can choose the parameters, but I don't want the model to be too complicated.  The second problem has mostly to do with syntax.  I am having a hard time programming line graphs the way I want to.  I have been unsuccessful cannibalizing existing graph codes, and the NetLogo programming manual and dictionary are not as helpful as I'd like.  Is anyone else planning on having graphs in their models?  Might we work on this as a class?

Marwa's picture

Incomplete ideas

My idea is not half as concrete as Evan's. I am still trying to figure out completely what to do for my final project, and maybe with everyone's help, I can have a full plan.


I was thinking about modeling the spread of something (maybe disease?) . There will be some infected turtles at the beginning, and some uninfected but susceptible, and some that are not susceptible at all. The ones that are susceptible will have a certain level of susceptibility – for example, if the susceptibility level is 8 out of 10, that means the turtle will need 8 encounters with the infected to become infected itself, whereas a turtle with susceptibility level of 2 will only require 2 encounters. I hope to make a more concrete plan as I go along. I am not sure if something like this exists on Netlogo already. I hope not!

 

Marwa's picture

Updates

I have changed my plans a lot since last week. I am hoping to look at a relation between age/experience and decision making. I am not sure what the outcome will be, but we will find out.


I hope to have certain areas that are unsafe - health is reduced if you are on those patches. Now the decision to set foot on those patches depends on the turtle's age and experience. If the turtle is young, even when it sees something that is dangerous, there is a higher probability that it will make a rash decision and go on the patch nevertheless. For a more experienced turtle, the probability that it will go onto the dangerous patches is lower. With experience, it has learned that its health goes down on dangerous patches, do it should try to avoid them more.


Of course, health gets reduced with old age as well. Younger people have better health. And then at a certain old age, turtles will die. New turtles will be born. So what happens eventually? Are there more young turtles because their health is better because of their age? Or are there going to be more older turtles because they make better decisions and thus can avoid health-reducing situations more?

Marwa's picture

More updates

I have incorporated most of the things that I mentioned in my post last time. So right now I have a model that has some "unsafe" patches that are red - if turtles land on those patches, their health is reduced. Whether they land on the unsafe patches depends on their experience/age. The turtles look at the patch ahead to see if it is unsafe when they are moving about. When they see that the patch is unsafe, older turtles have a higher chance of making a better decision and turning away than the younger turtles. After a certain time, new young turtles are born. The user can control how many turtles are there at the beginning, as well as how many are born at the end of each time sequence.

 

Turtles die when their health gets reduced to a certain value. The user can decide if they want the turtles to die from old age as well or not. There is a counter that keeps track of how many turtles of which age there are in the world (which I hope to change to a bar graph instead...) It seems like there are almost always more of the oldest turtles, whether we decide to make them die from old age or not.

Sahitya P.'s picture

Modeling Complex Behavior

For my project I wanted to come up with a model that depicts how different animals allocate their energy towards growth and reproduction.  In this model, all the turtles will have a limited amount of energy they could devote to growth/reproduction.  I will create different life strategies that the animals could follow.  The first strategy will be one in which the animals do not devote much energy to growth, reproduce early and have many offspring.  The cost to this strategy will be that all the animals might not survive.  Another type of strategy will be one in which the animals spend more energy towards growth and reproduce later in life. In this case they would have much fewer offspring but they have a greater chance of survival.  A third strategy could have animals devote an equal amount of energy to growth and reproduction.  I will then make a graph showing the number of offspring of each type over time.  I am hoping we will see how different patterns of complex behavior evolve over time given certain environmental costs and benefits.

These are just some initial thoughts and I am still in the process of coming up with a plan of how to do this using netlogo. 

 

 

Sahitya P.'s picture

Update

My plan is to show how the environment can select for organisms that most suited to it resulting in the evolution of organisms that are adapted to the environment.  So far I have created two different types of animals. One type reproduces once during its lifetime and lives a long time--animal1. The second type of animal reproduces more often but has a shorter life span—animal2.  I then tried to create an environment which would give one type of organism a selective advantage over the other.  One such environment is where there are many predators; in this case a population of animal2 would have an advantage simply because there are more organisms in this population than in a population of animal1. Contrastingly, an environment where a population of animal1 may have an advantage is one where there are limited resources.  In this case having fewer organisms in a population would be advantageous because there would be less competition for resources.

Sahitya P.'s picture

Update

This past week I have made several changes to my model. Initially my model consisted of two populations: one population that reproduces twice during its life span at a certain age and lives for a shorter time, and another population that reproduces once at a certain age and has a longer life span. I also had a population-capacity global variable to maintain the population size below a certain determined number.  One of the changes I made to the model was to make the two different populations of organisms reproduce at different rates but not have determined ages when they reproduce.  Another change was that in addition to having each population of organisms die at a certain age, I made their death rates a function of populations size, to model more realistically how population density is maintained constant over time. 

So currently the model consists of two populations that vary in terms of birth rates, death rates and life span. With the current values I have set for birth rate and death rate, population 1 on average has a density of 200 organisms and population 2 on average has a density of 100 organisms.  I intend to make sliders to allow the user to vary these variables to see how they affect population density.

I then introduced predators into the model which will kill an organism when they land on a patch that an organism is occupying. If the organisms are above a certain age they can learn to avoid predators. So for each population of organisms there is a certain range of ages when they can avoid predators: for population 1 the range is between ages 7 through 9, and for population 2 the range is between ages 7 and 49. I then made monitors to show how the predators are affecting the distribution of ages in the two populations. I hope to add a bar chart showing the number of animals at various ages over time.

ssv's picture

Abstractly Modelling Thought

For my project, I would like to hopefully focus on thinking/decision making (lightly touched on in my book for the midterm, Six Degrees: The Science of A Connected Age by Duncan Watts).     To make this a reality, I'm postulating that I would have to make a set of choices for the turtles to work with later.  As we talked about in class, I'm thinking of adding a snap-decision method where the turtles didnt have to go through a long choosing process.  The snap-decision method would be based on a few criteria.  Opposingly, the critical thinking method would be one based on many kinds of criteria and recursively it could have little methods inside the big critical thinking method that helps it to its greater goal of making a decision.

I'm considering adding something which can determine how successful the model was in making its decisions.  I have yet to decide what exactly this is and how it could interact with the model.

I intend to go much further with this than I explained here, but for now, these are my thoughts.

ssv's picture

Updates

Since our last discussion on what I'd like to implement, I've come up with a few ideas on how to start my project.  Inspired by what Professor Grobstein showed us in class, I thought of implementing that into my decision making model.  I supposed that there will be a certain or random amount of turtles generated.  These turtles can climb the peaks and descend down them.  Some peaks will be "too high" (after a certain height number) and the turtle will die if it decides to go up them and come back down again.  This model will have to be a learning model at first, then the decision part of the model will be created.  The decision making part will consider what the learning part has found.  I am hoping to make a good results record as well.  More updates will definitely follow!
ssv's picture

Update

So far my model runs by generating turtles that go at random headings.  When they hit a peak, their health decreases by 1 (health initally set to 100).  Throughout the model running, there is a timer.  For every 5 seconds, every turtle gains one year of age.  Something I am planning to implement this week is: once the turtle reaches a certain age, its process of decision making changes from a snap decision (performed by the young, or < 30 to a lengthy process of decision making (reserved for the older crowd of turtles).  I am going to add a plot as soon as I can get the health per turtle working as well as a regeneration of turtles as turtles die out.
ssv's picture

Changes

My model has changed since I last posted here.  My model now compares different way the turtles move in the model to the total amount of height that they climb (on the peaks generated when the model is set up).  Currently, there are two turtles in my model:  a turtle that has a random and heading and a turtle that goes continually straight.  Both turtles have calculated averages for how they travel.  I'm now planning to add another turtle that just goes to peaks and goes uphill, to add another variable into it. Also, I'm going to add switches for each turtle so I can compare them in different ways and I will also add graphs for all 3 turtles comparing ticks vs. height gathered.
EMR's picture

Modelling Evolution

Well, I thought it would be fun to take on a project that seems a little over-ambitious.  However, I don't expect to make a model that I can point to and say, "Look, that's evolution."  I'm starting with the basic necessaries of an evolving system:

  • A population of critters
  • with a certain 'trait' (sight distance)
  • which reproduce, passing on their trait value to their children, with slight variations.

I also wanted a good way to visualize the distribution of trait values in the population over time.  This setup successfully demonstrated an important idea about evolution (which Paul Grobstein pointed out)- evolution can occur without any selective pressure, due to variations within a population and the left-wall effect.  The next step was to see if I could introduce some form of selective pressure and see its effects on the population.  For this, I:

  •  Introduced 'predators'
  • which could eat members of the 'prey' population,
  • BUT the prey could sense the presence of predators when they came within a certain distance related to the prey's trait value (sight distance)
  • on sensing a predator nearby, the prey would run away

Over time, the prey population 'evolved;' those prey with higher trait values were more likely to survive and reproduce, passing on their trait value (with variation) to their offspring.  This created a trend toward a population with a larger mean trait value over time (check out the model here).  From there I wanted to add another trait, controlling the prey's 'field of vision,' which I did and which showed a similar trend in the presence of predators (mean field of vision steadily increased up to a complete circle).  This model is not yet on Serendip but can be seen here.

From that point, I have gone in several directions without seeming to make any particular headway.  I tried giving predators some traits which would affect how good they were at catching prey, with more successful predators having a better chance of reproducing and passing on their trait values.  I also played with several more traits for prey (mostly controlling their response on sensing the presence of a predator), all of which showed basically the same pattern over time as the existing traits, and didn't get me anywhere particularly new and interesting.  Additional ideas I have come up with but not really tried to incorporate yet include:

  • Creating a more varied landscape, which could introduce new complexities into the evolutionary process.  This could include some 'resources' the critters need, affect both predator and prey's sight ability (and maybe encourage 'hiding' or 'sneaking' behavior).
  • Making some traits to control group dynamics- how prey and predators interact with their kind 
  • Somehow generalizing the trait creation process such that I don't have to create a specific trait and name how it will vary and how it will affect behaviors, but let turtles discover traits for themselves and surprise me with some ingenuity or mis-ingenuity.
I would welcome any ideas, suggestions, questions, or challenges, and look forward to seeing what other people are working on and where they are.  Go team!
EMR's picture

The Continuing Story of Evolution Bill...

Seeing myself speeding into a steepening spiral of more and more complicated models, containing turtles with more and more 'traits' interacting in more and more complex ways, I have gone back to my earlier model with only one trait and started working in a different direction.  Acting on  Paul Grobstein's suggestion, I'm working on more ways to visualize the way simple evolutionary processes (randomness and the left-wall effect) can affect the distribution of trait values in a population.  The current iteration of my model calculates and displays a 'trait diversiy index,' which measures the diversity of trait values within the population using Simpson's Diversity Index.  Next I added a plot that shows how trait values branch out in a tree-like form from one or several initial starting points.  I'm still looking for further ways to refine my model and make it more useful and powerful without necessarily cluttering up the interface with lots of options.
EMR's picture

More...

Since my last post I have added a few features to my model, but mostly I have combined a few of my different iterations into a single model.  I started out trying to create a live plot showing three-dimensional trait space and ancestry, but found NetLogo to be uncooperative on the three-dimensional front.  Instead, at Paul's suggestion, I created a two-dimensional trait space plot, with one trait on each axis.  This also meant that I had to incorporate a second trait into my model, which I borrowed from an earlier version.  Then I had to modify all the plots and monitors to run two traits, and also extend setup options to include the second trait.  Part of the new setup is the ability to create two distinct 'groups' and watch how each varies over time.  I also made an option that limits the sume of the two traits, such that one trait can only go up at the cost of the other trait.  The intention was to see if populations would evolve in different directions given different starting points, but I haven't run it enough with the new settings to get an answer.  Perhaps I will use the behaviorspace to put the model through a number of different runs and see what I get.