# PANDA BEAR

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)

## WHAT IS IT?

Perimeters and Areas by Embodied Agent Reasoning, or PANDA BEAR, is a microworld for mathematics learning that lies at the intersection of dynamic geometry environments and participatory simulation activities. In PANDA BEAR, individual students identify with and control a single vertex of a shared, group-polygon.

The measures of perimeter and area of the group-polygon are foregrounded in the environment. Group-level challenges involving the perimeter and area that cannot be solved by one individual are issued by the activity leader to the students. Through the communication of ideas and strategies with each other, the students collaboratively build solutions for the challenges.

## HOW TO USE IT

### Server interface

SETUP is run automatically when the activity is opened, and can be run whenever the teacher wants to clear the links comprising a group-polygon and prepare students to be formed into a different polygon when EDGIFY is pressed next. GO is the main button for allowing students to log in and move around. After the EDGIFY button has been pressed, the students will all be connected in a single group-polygon. When the students are connected, the PERIMETER and AREA monitors update automatically as students move their vertices around. The PANDA plot shows both of those measures over time as a record of the group's actions as they work towards a goal. SETUP-PLOT resets the plot to start a new challenge with the same group-polygon. To force all students' clients to exit the activity and re-enter, the teacher can press the RESET button on the HubNet Control Center.

### Client interface

The client interface allows each student to control one vertex in the group-polygon. The YOU ARE A: monitor shows a description of the shape and color of the vertex the student is controlling. CHANGE APPEARANCE changes the vertex's shape and color. The LOCATED AT: monitor shows the current coordinates of the student's vertex. The HEADING: monitor shows the current heading of the student's vertex - that is, the direction in which the vertex travels if asked to move forward. The PERIMETER: and AREA: monitors show the current measures of the group-polygon. The FD (forward), BK (back), LT (right-turn), and RT (right-turn) buttons change the student's vertex's location and heading. The STEP-SIZE and TURN-AMOUNT input boxes control the amount of movement of the FD, BK, LT, and RT buttons. The GET-CENTERED button rounds the student's vertex's x and y coordinates to the nearest integer, which can be helpful for coordinating with other students.

## THINGS TO NOTICE

In a triangle, for an individual vertex, moving "between" the other two vertices minimizes the perimeter for a given area.

In a triangle, when all three vertices attempt to form an isosceles triangle, an equilateral triangle is formed.

Strategies that work for challenges at the triangle level often work at the square level as well.

As the number of vertices is increased, the polygon that maximizes the area given a perimeter and minimizes the perimeter given an area gets closer and closer to a circle.

## THINGS TO TRY

With three students (and so, three vertices), ask the students to make the area as big as possible while keeping the perimeter at or below 25.

With three students (and so, three vertices), ask the students to make the perimeter as small as possible while keeping the area at or above 25.

Increase the number of students in the polygon from three to four (and beyond - approaching a circle) and issue similar challenges.

Modify the challenges in a patterned way. For example, with four students, doubling the allowed perimeter should quadruple the maximum area.

## EXTENDING THE MODEL

Add vertices that the students can't control.

Add different methods of movement. For example, instead of turning and going forward and backward, the students could be allowed to move in the 4 cardinal directions or with a mouse.

Allow the students to give their vertex movement rules to follow over and over so that the group-polygon "dances".

## NETLOGO FEATURES

This model uses links to form the sides of the polygon; each vertex is linked to exactly two other vertices. The sum of the lengths of all the links is the perimeter of the polygon.

The area calculation is based on information found here: http://mathworld.wolfram.com/PolygonArea.html

## RELATED MODELS

PANDA BEAR Solo

## CREDITS AND REFERENCES

Thanks to Josh Unterman for his work on this model.

## HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

- Unterman, J. and Wilensky, U. (2007). NetLogo HubNet PANDA BEAR model. http://ccl.northwestern.edu/netlogo/models/HubNetPANDABEAR. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.

## COPYRIGHT AND LICENSE

Copyright 2007 Uri Wilensky.

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

## Comments and Questions

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variable and Breed declarations ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; globals [ ;; variables used to assign unique color and shape to clients shape-names ;; list that holds the names of the shapes a student's turtle can have colors ;; list that holds the colors used for students' turtles color-names ;; list that holds the names of the colors used for students' turtles used-shape-colors ;; list that holds the shape-color pairs that are already being used max-possible-codes ;; total number of possible unique shape/color combinations ] breed [ students student ] ;; created and controlled by the clients, also vertices in the polygon students-own [ user-id ;; unique id, input by the client when they log in, to identify each student turtle step-size ;; the current value of the STEP-SIZE input box on the client turn-amount ;; the current value of the TURN-AMOUNT input box on the client next-student ;; points to the next student in the polygon (used when calculating area) ] ;;;;;;;;;;;;;;;;;;;;; ;; Setup Functions ;; ;;;;;;;;;;;;;;;;;;;;; to startup hubnet-reset setup-vars setup end ;; Deletes polygon sides, and shuffles the order of students ;; so that polygon is rearranged when edgify is next pressed. ;; Also initializes the plot. to setup ask links [ die ] ask students [ set label "" ] send-info-to-all-clients reset-ticks end ;; initialize global variables to setup-vars set shape-names [ "airplane" "android" "butterfly" "cactus" "cat" "cow skull" "ghost" "heart" "leaf" "monster" ] set colors (list brown green (violet + 1) (sky - 1)) set color-names ["brown" "green" "purple" "blue"] set max-possible-codes (length colors * length shape-names) set used-shape-colors [] end ;; initialize the plot to setup-plot set-current-plot "PANDA" clear-plot end ;;;;;;;;;;;;;;;;;;;;;;; ;; Runtime Functions ;; ;;;;;;;;;;;;;;;;;;;;;;; to go every 0.1 [ ;; get commands from the clients, ;; execute them, ;; and send the clients new data listen-clients display-angles-and-lengths tick ] end to display-angles-and-lengths if any? links [ ask links [ set label less-precise link-length ] ask students [ if any? link-neighbors [ ;; make sure the angle is positive let angle (subtract-headings towards first sort link-neighbors towards last sort link-neighbors) mod 360 ;; make sure the angle is the interior angle if angle > 180 [ set angle 360 - angle ] set label less-precise angle ] ] ] end ;; recursive procedure that links all the vertices together ;; one at a time. to edgify ;; student procedure ;; each student is linked to once and then, in turn links to ;; another student that has not yet been linked, when we ;; run out of students we've made a line and we just need ;; to close the polygon by linking back to the beginning let candidates other students with [ not any? link-neighbors ] ifelse any? candidates [ set next-student one-of candidates create-link ask next-student [ edgify ] ] [ set next-student one-of other students with [ count link-neighbors = 1 ] create-link ] end to create-link create-link-with next-student [ set color white set label-color white ] end to-report perimeter report sum [link-length] of links end ;; this area calculation is based on the formula found here: ;; http://mathworld.wolfram.com/PolygonArea.html to-report area let result 0 ask students [ let addend ((xcor * [ycor] of next-student) - (ycor * [xcor] of next-student)) set result result + addend ] report abs (result / 2) end ;;; used to keep the clients from having too much cluttering detail to-report less-precise [ precise-num ] report precision precise-num 1 end ;;;;;;;;;;;;;;;;;;;;;;; ;; HubNet Procedures ;; ;;;;;;;;;;;;;;;;;;;;;;; ;; determines which client sent a command, and what the command was to listen-clients while [ hubnet-message-waiting? ] [ hubnet-fetch-message ifelse hubnet-enter-message? [ create-new-student ] [ ifelse hubnet-exit-message? [ remove-student ] [ ask students with [user-id = hubnet-message-source] [ execute-command hubnet-message-tag send-info-to-all-clients ] ] ] ] end ;; executes the correct command sent by client to execute-command [command] if command = "Change Appearance" [ change-turtle stop ] if command = "Fd" [ move 1 stop ] if command = "Bk" [ move -1 stop ] if command = "Rt" [ rt turn-amount stop ] if command = "Lt" [ lt turn-amount stop ] if command = "Get Centered" [ setxy round xcor round ycor stop ] if command = "step-size" [ set step-size hubnet-message stop ] if command = "turn-amount" [ set turn-amount hubnet-message stop ] end to move [ direction ] ;; student procedure let new-xcor (xcor + step-size * (dx * direction)) let new-ycor (ycor + step-size * (dy * direction)) ;; don't end up at the same place as any other students if not any? students with [xcor = new-xcor and ycor = new-ycor] [ fd step-size * direction update-plots ] display end ;; Create a turtle, set its shape, color, and position ;; and tell the node what its turtle looks like and where it is to create-new-student create-students 1 [ setup-student-vars if any? links [ edgify update-plots ] send-info-to-client ] end ;; sets the turtle variables to appropriate initial values to setup-student-vars ;; turtle procedure set user-id hubnet-message-source set-unique-shape-and-color setxy random-xcor random-ycor set heading 0 set step-size 1 set turn-amount 90 set label-color white end ;; Kill the turtle, set its shape, color, and position ;; and tell the node what its turtle looks like and where it is to remove-student ask students with [user-id = hubnet-message-source] [ set used-shape-colors remove my-code used-shape-colors die ] ;; when a student leaves if there is already a polygon ;; automatically make a new one if there are ;; enough students ifelse any? links and count students > 2 [ ask links [ die ] ask one-of students [ edgify ] ] [ ;; if we don't have at least 3 students ;; dismantle the polygon since it is no longer a polygon ask links [ die ] ask students [ set label "" ] ] update-plots end to send-info-to-all-clients ask students [ send-info-to-client ] end ;; sends the appropriate monitor information back to the client to send-info-to-client ;; student procedure hubnet-send user-id "You are a:" (word (color-string color) " " shape) hubnet-send user-id "Located at:" (word "(" less-precise xcor "," less-precise ycor ")") hubnet-send user-id "Heading:" heading ;; if there are no links perimeter and area don't apply hubnet-send user-id "Perimeter:" ifelse-value any? links [ less-precise perimeter ] [ "" ] hubnet-send user-id "Area:" ifelse-value any? links [ less-precise area ] [ "" ] end to change-turtle ;; student procedure set used-shape-colors remove my-code used-shape-colors set-unique-shape-and-color end ;; pick a base-shape and color for the turtle to set-unique-shape-and-color ;; student procedure let code random max-possible-codes while [member? code used-shape-colors and count students < max-possible-codes] [ set code random max-possible-codes ] set used-shape-colors (lput code used-shape-colors) set shape item (code mod length shape-names) shape-names set color item (code / length shape-names) colors end ;; report the string version of the turtle's color to-report color-string [color-value] report item (position color-value colors) color-names end ;; translates a student turtle's shape and color into a code to-report my-code ;; student procedure report (position shape shape-names) + (length shape-names) * (position color colors) end ; Copyright 2007 Uri Wilensky. ; See Info tab for full copyright and license.

There are 7 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

PANDA BEAR.png | preview | Preview for 'PANDA BEAR' | over 11 years ago, by Uri Wilensky | Download |

This model does not have any ancestors.

This model does not have any descendants.