Simulation Challenge
Overview of the simulation
This challenge could be solved in a natural setting where there is a male chameleon, a female chameleon and a bird as a predator.
The three agents (male, female and bird) could move around the stage and the male chameleon change color when interacting (touching or being close) with the female or the predator.
When approaching the female he would turn pinkish and when interacting with the predator it would change its color to reddish-yellow.
The WHY behind the simulation
The color change of the male panther chameleon is not only a fascinating phenomenon in nature, but it also offers us a window to better understand concepts of communication and adaptation. In everyday life, both humans and animals use visual cues to communicate and adapt to different situations. By observing how the panther chameleon changes its colors during courtship, confrontations with predators, and competitions with other males, students can reflect on how visual cues play a crucial role in social interaction and survival. This challenge enables us to these concepts through modeling, promoting a deeper understanding of biology and communication.
Furthermore, the simulation of color change in the panther chameleon can be a powerful metaphor for discussing issues related to adaptation and flexibility in our lives. In the educational and professional field, the ability to adapt to different situations is an invaluable skill. Just as the chameleon changes color to meet different challenges in its environment, we as individuals must also learn to adjust our behavior and strategies in response to various circumstances. This challenge invites us to think critically about how we can apply adaptation and flexibility in our daily lives, both in academic and personal contexts.
Finally, this challenge can also be connected to the technological and creative field. The ability to change and adapt is essential in fields such as design, programming and engineering. By modeling panther chameleon behavior, we can look at parallels with how algorithms and technologies must adapt to different users and conditions. This activity not only enriches your scientific understanding, but also fosters an innovative and adaptive mindset, crucial for solving complex problems in an ever-changing world.
Simulation Challenge Walkthrough
In this challenge we will first work with the internal states of the agents (their “traits”). The agents themselves, when created, have three states or traits: their shape (as if it were a costume); their color and their size.
As can be seen in the previous figure, the default values of these three states are:
-
Shape: Cube
-
Color: White
-
Size: 1
Initially we are going to create three breeds of agents: male chameleon; female chameleon; and bird (predator).
Create agent breeds
We will leave the scenario for this challenge as it is, but eventually trees, grass, bushes, rocks, etc. could be added. (see section “Expanding the simulation”)
-
Click on My projects → Create new project
-
Name the project. Click where it says “Title” and write there “CHAMELEON” (or whatever name you want).
-
For now we will leave the description of our model as it is by default.
-
We go to the bottom of the interface, where the “Turtle” tab appears and click on “Rename Breed”
- We rename the “Turtle” breed as “Male chameleon” and we will see that the green “Run code” button appears, we click on it to turn it off.
-
By default, when we create a model in StarLogo NOVA, there is always the breed “Turtle”, but of course you can rename that breed (just as we have done) and also add new breeds, which is what we will do now. To add a new breed, click on the “tab” Add Breed and we will see that a new tab is added with the name “Breed”. By clicking on the orange triangle, we can rename the new breed with the name we choose. In our case, we will call it “Female Chameleon”. - We repeat the procedure to add the “Bird” breed and we are left with the three created breeds:
Create agentes themselves
Although in the previous step we created the agent breeds, we have not yet created the agents themselves. This might seem a bit confusing at first, but keep reading, and the logic will become clear.
In the previous step, by creating the agent breeds, it’s as if we had created categories, but now we need to create the agents within each of those categories.
So, let’s start by creating an agent of the “Male chameleon” breed. The creation of agents, regardless of their breed, is always done in the “The World” tab following a standard procedure using the following blocks (below the image, we explain each step in the numbered order):
SiempreWhenever quea senew creaproject unis nuevocreated proyecto enin StarLogo NOVA, porby defecto se creandefault, dostwo botonesbuttons, are generated: setup yand forever, yalong with unaa cajadata de datosbox llamadacalled data:
VeremosThe entonces“setup” ahorabutton unois pora unoone-time losexecution bloquesbutton, quemeaning conformanthat lawhen secuenciayou paraclick crearit, unthe agenteactions yare darlesexecuted unonly aspectoonce. diferenteOn althe queother tienenhand, porthe defecto“forever” button is a continuous execution button, meaning that when you click it, it stays “on” and continuously executes the configured actions.
For now, we will focus on the “setup” button. Later on (within this same simulation), we will explore how the “forever” button works, while the “Data” box will be covered in another chapter. For now, we don’t need to worry about it.
Step-by-Step Agent Creation, Block by Block
We will now go through each of the blocks that make up the sequence to create an agent and give it a different appearance from the default one (cuboscubes, dewhite in color blanco, y deand tamañosize 1).
Por
- That’s
elwhy theprimer bloque defirstcolorgreen-coloredverdeblock,quewhichcontienecontainsaalllosthedemásotherbloquesblocks,esis "when setup pushed",.esThisdecir,meanscuandothatelwhenusuariothedauserclicclicksentheelsetupbotónbutton,setup,allsetheejecutancommandstodosinsidelosthecomandosgreendeblockloswillbloquesbequeexecuted. - The
segundosecondbloqueblockesis "delete everyone",ywhichseensuresutilizathatparaeveryquetimecadaagentsvezarequecreated,sethecreanpreviousagentes,onesseareborrenremoved.losWithoutquethisestabanblock,antes.everySintimeesewebloque,presscada vez que presionamos el botónthe "setup",sebutton,crearíannewnuevosagentsagenteswouldperobesincreatedborrarwithoutlosdeletinganteriores.the previous ones.El - The
tercerthirdbloqueblock (color marrónbrown-colored)esis "create ... each do ...".EsteThisbloqueblockesperformselthequemagicrealizaofla magia de crear una cantidad determinada de agentes, de una raza específica con unas características determinadas (diferentescreating alasspecificcaracterísticasnumberporofdefectoagentsquefromcadaaagenteparticularposeebreedcuandowithespredeterminedcreado)characteristics (different from the default characteristics that each agent has when created).El - The
cuartofourth,quintofifth, and sixthysextobloqueblocks (colorlightcelesteblue-colored)sonarejustamentepreciselyparauseddarlestounagiveaparienciathedeagentscamaleón,adechameleon-likecolorappearance,naranjamakingythemtamañoorange and size 10.CreoIquebelieve there’s nohaceneedfaltatodecirexplainquéwhathaceeachcadablockbloquedoes,porqueassaltaitaislaquitevista.evident.
AhoraNow, entonceslet's vamoscreate a crear nuestro agenteour camaleónmale machochameleon deagent with an orange color naranja, tamañosize 10, yand apariencia dea camaleónchameleon-like appearance. ParaTo esodo vamosthis, aclick daron clicthe en el botón azulblue "setup" enbutton in Spaceland, yand veremosyou lowill siguiente:see the following:
PorBy defecto,default, lathe vistaview enin Spaceland esis enin 2D,2D, comoas siif estuvieraa unacamera cámarawere mirandolooking desdefrom arriba.above. ParaTo poderswitch verloto ena 3D,3D hayview, queclick dar clic en el botónthe "Edit camera"camera" ybutton, luego,then dandoright-click clicon conthe elstage botónand derechouse sobrethe elmouse escenarioscroll ywheel moviendoto lazoom rueditain deland mouse,rotate podemosthe agrandarscene. laWhen vistathe yscene girarlooks elthe escenario.way Puedenyou experimentarlolike ustedesit, mismosclick perothe aquí"Lock locamera" mostramosbutton. enYou unacan animaciónexperiment parawith quethis observenyourself, cómobut podríawe verse:also show it in an animation (no sound) so you can see how it might look:
![]() |
Set the initial internal states of the agents
Once we have the three breeds of agents created, now we have to create the agents themselves, starting with an agent male chameleon…..
Teacher's Toolbox
This simulation opens the doors to emphasize the relationship between color change and courtship. Explain, for example, how male chameleons change color to attract females, exhibiting vibrant colors that indicate their health and vitality. Not only is this behavior an example of sexual selection, but it also offers an opportunity to discuss how organisms develop specific characteristics to increase their chances of reproduction. It can be an opportunity to encourage students to observe and record variations in color patterns during courtship and to relate them to concepts of evolutionary biology and animal behavior.
In addition, of course, to explore how color change is an evolutionary strategy against predators. Explain that chameleons have the ability to change their coloration to camouflage themselves in their environment and avoid being detected by predators such as birds of prey and owls. This phenomenon can be linked to concepts of adaptation and natural selection, highlighting how chameleons that are more efficient at camouflage are more likely to survive and reproduce. Encourage discussion about other defensive strategies in the animal kingdom and how these contribute to the survival of species. This activity can not only enrich your students' understanding of evolutionary mechanisms, but also the complexity and beauty of adaptations in nature.
Expanding the simulation
-
Add fixed objects to give the scene a more realistic look. Investigate what the natural settings of chameleons are like. What other agents could we add to add realism to the scenario? Fixed or mobile agents? Vary agents in size and distribution.
-
Modify the scenario by stamping a part with a different color to simulate a fixed element such as water with a blue ellipse. What other colors could be used and for what landscape elements?






