Lesson 6. Constructing a model using coding blocks

Teresa Granito, Sugat Dabholkar, Mandy Peel, Shruti Researcher
Biology
1 class period of 45 minutes
High School Advanced Placement (AP) Biology
v5

Overview

In this lesson, students use a software called NetTango to use coding blocks for constructing a computational model of animal behavior.

* For teachers: Please find an attachment below with solutions for the NetTango activities.

Standards

Next Generation Science Standards
  • Life Science
    • [HS-LS2] Ecosystems: Interactions, Energy, and Dynamics
    • [HS-LS4] Biological Evolution: Unity and Diversity
  • NGSS Crosscutting Concept
    • Patterns
    • Causation
    • Scale
    • Systems
    • Stability and Change
  • NGSS Practice
    • Analyzing Data
    • Communicating Information
    • Constructing Explanations, Designing Solutions
    • Asking Questions, Defining Problems
    • Using Models
    • Using Mathematics
    • Arguing from Evidence
    • Conducting Investigations
Computational Thinking in STEM
  • Data Practices
    • Analyzing Data
    • Collecting Data
    • Creating Data
    • Manipulating Data
    • Visualizing Data
  • Modeling and Simulation Practices
    • Assessing Computational Models
    • Designing Computational Models
    • Using Computational Models to Find and Test Solutions
    • Using Computational Models to Understand a Concept
    • Constructing Computational Models
  • Computational Problem Solving Practices
    • Assessing Different Approaches/Solutions to a Problem
    • Creating Computational Abstractions
    • Developing Modular Computational Solutions
    • Computer Programming
    • Troubleshooting and Debugging
    • Preparing Problems for Computational Solutions
  • Systems Thinking Practices
    • Communicating Information about a System
    • Investigating a Complex System as a Whole
    • Thinking in Levels
    • Understanding the Relationships within a System

Credits

This curricular unit is co-designed by Teresa Granito and Sugat Dabholkar.

Activities

  • 1. Set up a chamber with roly-polies
  • 2. Making roly-polies move realistically
  • 3. Set up two chambers and conditions
  • 4. Computationally model roly-poly behavior
  • 5. Reflection Questions

Student Directions and Resources


In this lesson, you will make your own computational model of roly-polies. You will use a computational tool called NetTango to code animal behavior using blocks.

1. Set up a chamber with roly-polies


This is a computational setup designed using a tool called NetTango. This setup will allow you to construct your own computational model of roly-poly behavior. You will use coding block to build a computational model.

Play around with some of the coding blocks and see if you can setup a chamber. 

Try the challenges below:

  1. Drag blocks over to make a chamber.
  2. Increase the size of the chamber.

  3. Move the chamber to the left, and to the right.

  4. Move the chamber up, down.

  5. “add-roly-polies”

  6. Make 2 Chambers that are connected.

  7. Add the ‘clear’ block and see how it works.

  8.  Setup again and run the model by pressing the ‘go’ button.  

Blocks can be used multiple times. Blocks can be dragged to the trash to take them out of the code.            

Anytime you make changes click on the "recompile" button followed by setup and go.

You can also watch the embedded video to learn how the use NetTango blocks to add and move roly-polies. [If the video is not displayed, ask your teacher to screen the video.]


Question 1.1

What parameters did you change to move a chamber? How do they work?



Question 1.2

How did you increase the size of the chamber?



Question 1.3

Take screenshots of your 'setup' and 'go' procedures and upload the files.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


2. Making roly-polies move realistically


Challenge:  Add roly-polies and have them move in a realistic way.

  1. Drag blocks over to make two chambers that are connected. Add roly-polies. Tell the roly-polies how to behave.

  2. Get the roly-polies to move around the field.

  3. Get the roly-polies to move around the field more realistically.

  4. Get the roly-polies to stay within the chambers.


Question 2.1

Describe what happened when you first added the roly-polies to the chambers.



Question 2.2

Did the roly-polies stay in the chambers? If not, how did you change the code?



Question 2.3

Take a screenshot of your chambers and NetTango code (i.e., blocks). Upload the files.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


3. Set up two chambers and conditions


You have more blocks now. Use those to setup two chambers and conditions in each chamber. 


Question 3.1

Which new blocks did you use?



Question 3.2

Describe any benefits of the new blocks and any difficulties you faced in using the new blocks.



Question 3.3

Upload your screenshots of chambers with conditions and your NetTango code here.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


4. Computationally model roly-poly behavior


Let's use the model from one of the previous lessons, except the "go" button does not work!!

You can make it work by programing behavior of roly-polies using blocks, so that they behave just like how you observed the behaving experimentally. 

CHALLENGE:  Add Chamber Preference

In the roly-poly animal behavior experiment that we conducted, we learned that roly-polies prefer the moist chamber over the dry chamber.  Code for that preference behavior using the NetTango blocks.  

Run your model.

Keep changing the parameter in the blocks until the roly-poly behavior in the model more closely matches the roly-poly behavior observed in the experiment we conducted.


Question 4.1

Take screenshots of the NetTango code and of the graphs in your model. Upload the files.

Upload files that are less than 5MB in size.
File Delete
Upload files to the space allocated by your teacher.


5. Reflection Questions



Question 5.1

A few lessons ago, you changed a model by typing lines that setup "new-condition" in a model. Now you changed a model by moving blocks to set up conditions. What are the benefits of using block-based coding like this NetTango model, compared to typing lines of code?



Question 5.2

What other blocks would you want to add to this model?



Question 5.3

List 5 big ideas about coding that you learned by completing the lessons in this entire unit.