;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variable declarations ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; globals [ shape-names ;; list that holds the names of the shapes a student's turtle can have patches-with-coords ;; holds the agentset of patches that display coordinates if coords? is true rule ;; holds the current verbal rule that the instructor gives to the users ;; quick start instructions variables quick-start ;; the current quickstart instruction displayed in the quickstart monitor qs-item ;; the index of the current quickstart instruction qs-items ;; the list of quickstart instructions ] turtles-own [ user-id ;; the student's id my-num ;; the number of the point currently picked by the student ] ;;;;;;;;;;;;;;;;;;;;; ;; Setup Functions ;; ;;;;;;;;;;;;;;;;;;;;; to startup setup-quick-start hubnet-set-client-interface "TI-83+" [ "AAA - Function Activity 2.4" [ "L1" ] ] hubnet-reset setup end ;; Initializes the display, and creates a list that contains the names of the shapes ;; used by turtles in this activity. The placement of the shape names in the last ;; corresponds to the numbers sent by calculators. to setup cc cp ct clear-all-plots ;; draw the axes ask patches with [ pxcor = 0 or pycor = 0 ] [ set pcolor 2 ] ;; setup the patches to draw their coordinates if coords? is true set patches-with-coords patches with [ ;; we do not include the patch at (0, -screen-edge-x) since the plabel will be cut off by the edge of the ;; graphics window if we do. so we include (0, -screen-edge-x + 2) instead and have it draw the patch at ;; (0, -screen-edge-x)'s plabel ( pxcor = 0 and ( pycor = 0 or abs pycor = floor ( screen-edge-y / 2 ) or abs pycor = screen-edge-y ) ) or ( pycor = 0 and ( abs pxcor = floor ( screen-edge-x / 2 ) or pxcor = screen-edge-x ) ) or ( pycor = 0 and pxcor = ( 2 - screen-edge-x ) ) ] update-coords ;; create a list of the shape names for the calculators to use set shape-names ["wide wedge" "square" "" "thin wedge" "" "" "" "car"] ;; initially set the rule to nothing set rule "" ;; send the appropriate setup information to the calculators setup-hubnet end ;; give the user some information about what the setup button does so they can ;; know whether they want to proceed before actually doing the setup to setup-prompt if user-yes-or-no? ("The SETUP button should only be used when starting " + "over with a new group (such as a new set of students) since " + "all data is lost. Use the RE-RUN button for continuing with " + "an existing group." + "\n\nDo you really want to setup the model?") [ user-message "Before closing this dialog, please do the following:" + "\n -Have everyone that is currently logged in, log off and " + "clear the calulator memory. (Press 2nd MEM 7 1 2)" + "\n -Open the teacher console for this activity and press the ERASE ALL DATA button." setup ] end ;;;;;;;;;;;;;;;;;;;;;;; ;; Runtime Functions ;; ;;;;;;;;;;;;;;;;;;;;;;; ;; receives information from the calculators and runs the simulation to go listen-calc update-coords end ;; draw or erase coordinates on the patches in patches-with-coords based on the state of coords? to update-coords ifelse( coords? ) [ ;; if coords? is true, draw in the coordinates of certain patches defined by patches-with-coords ask patches-with-coords [ ifelse ( pycor = 0 and pxcor = ( 2 - screen-edge-x ) ) [ set plabel "(" + ( - screen-edge-x ) + ",0)" ] [ set plabel "(" + pxcor + "," + pycor + ")" ] ] ] [ ;; if coords? is false, erase the coordinates of certain patches defined by patches-with-coords ask patches-with-coords [ set plabel no-label ] ] end ;; sets rule to the value that the user enters in an input dialog to set-rule set rule user-input "Enter the Verbal Rule:" end ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Quick Start functions ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; initialize instructions to quickly setup the model, calculators, and TISchool webpage to run this activity to setup-quick-start set qs-item 0 set qs-items [ "Teacher: Follow these directions to setup the HubNet activity." "Optional- Zoom In (see Tools in the Menu Bar) - optional" "Press the GO button." "Everyone: Reset the RAM on your calculator (2nd MEM 7 1 2)." "Login to the calculator." "Choose the PICK POINTS option." "Remember your shape and color and press ENTER." "Move around using the arrow keys to..." "acquaint yourselves with the interface." "Teacher: Tell the students a verbal rule, such as..." "Move until your Y is twice your X." "Optional- Press the NetLogo SET RULE button and enter..." "the verbal rule to be displayed in..." "the CURRENT VERBAL RULE monitor." "Everyone: Pick some points that meet the requirements of..." "the verbal rule." "This is done by moving to a point with the arrow keys and..." "then choosing that point by pressing ENTER or the PICK softkey." "Press the REDO softkey to repick the last picked point." "When you are done picking points, press the DONE softkey." "Choose the VIEW POINTS option to view the last point chosen by..." "each member of the class as well as all the points chosen by you." "When finished viewing the points, press the DONE softkey." "Then, you can create an equation using the CREATE EQN option." "Try to match the equation as closely as possible to..." "the last points picked." "You may keep on trying different equations by pressing..." "the REDO softkey and entering a new equation at the prompt." "When you have chosen the best fit curve, press the DONE softkey." "You can view the class' equations using the VIEW EQNS option." "Press the RFSH softkey to get any new equations." "When you are done viewing the equations chosen,..." "press the DONE softkey." "Teacher: To rerun the activity, do not clear the server." "Stop the simulation by pressing the NetLogo GO button." "Press the NetLogo RE-RUN button." "Press the GO button." "Everyone: Exit to the calculator Main Menu." "Choose the RESTART option from the calculator Main Menu." "Choose the PICK POINTS option and continue." "Teacher: To start the simulation over with a new group,..." "stop the model by pressing the NetLogo GO button, if it is on." "Have everyone, including yourself, logout of their calculators." "Press the ERASE ALL DATA button on the TISCHOOL site." "Press the NetLogo SETUP button." "Follow these instructions from the beginning again." ] set quick-start item qs-item qs-items end ;; view the next item in the quickstart monitor to view-next set qs-item qs-item + 1 if qs-item >= length qs-items [ set qs-item length qs-items - 1 ] set quick-start item qs-item qs-items end ;; view the previous item in the quickstart monitor to view-prev set qs-item qs-item - 1 if qs-item < 0 [ set qs-item 0 ] set quick-start item qs-item qs-items end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Code for interacting with the calculators ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; send the appropriate setup information to the calculators to setup-hubnet locals [ parameters ;; the setup information to be sent to the calculators ] set parameters [ 0 ] ;; 0 means that we can pick multiple points on the calculators set parameters lput (- screen-edge-x) parameters ;; append the negative screen-edge-x set parameters lput screen-edge-x parameters ;; append the screen-edge-x set parameters lput (- screen-edge-y) parameters ;; append the negative screen-edge-y set parameters lput screen-edge-y parameters ;; append the screen-edge-y hubnet-broadcast "PARAM" parameters end ;; when a command is sent, this finds out which calculator sent it and then executes the command to listen-calc locals [ current-id cmd ] while [ hubnet-message-waiting? ] [ hubnet-fetch-message set current-id hubnet-message-source set cmd item 0 hubnet-message execute-cmd current-id cmd ] end ;; Calculator command codes sent to NetLogo to indicate what each student turtle is supposed to be doing: ;; 0 - create and setup (set shape, color, and initial position) a student turtle to execute-cmd [ current-id cmd ] if cmd = 0 [ exe-crt current-id ] if cmd = 3 [ exe-remove current-id ] end ;; 0 Create or Move current Turtles - receives a list 6 items long - 1, shape, color, x, y, and point number to exe-crt [ current-id ] locals [ current-num ] set current-num item 6 hubnet-message ifelse not any? turtles with [user-id = current-id and my-num = current-num] [ cct item 1 hubnet-message [ set user-id current-id set my-num current-num set heading 0 set shape item (item 2 hubnet-message) shape-names set color (item 3 hubnet-message) setxy (item 4 hubnet-message) (item 5 hubnet-message) if color = 3 [ set color white ] ] ] [ ask turtles with [user-id = current-id and my-num = current-num] [ setxy (item 4 hubnet-message) (item 5 hubnet-message) ] ] end ;; 3 Remove Turtles - removes a turtle from the graphics window so a student can redo the last point to exe-remove [ current-id ] locals [ current-num ] set current-num item 1 hubnet-message ask turtles with [user-id = current-id and my-num > current-num] [ die ] end ; ***NetLogo Model Copyright Notice*** ; This activity and associated models and materials was created as part of the project: ; PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS. ; The project gratefully acknowledges the support of the ; National Science Foundation ( REPP program ) -- grant number REC #9814682. ; Copyright 1999 by Uri Wilensky & Walter Stroup. Updated 2001,2002. All rights reserved. ; Permission to use, modify or redistribute this model is hereby granted, ; provided that both of the following requirements are followed: ; a) this copyright notice is included. ; b) this model will not be redistributed for profit without permission ; from the copyright holders. ; Contact the copyright holders for appropriate licenses for redistribution for ; profit. ; To refer to this model in academic publications, please use: ; Wilensky, U. & Stroup, W. (1999). NetLogo HubNet Function Activity model. ; http://ccl.northwestern.edu/netlogo/models/HubNetFunctionActivity. ; Center for Connected Learning and Computer-Based Modeling, ; Northwestern University, Evanston, IL. ; In other publications, please use: ; Copyright 1998 by Uri Wilensky and Walter Stroup. All rights reserved. See ; http://ccl.northwestern.edu/netlogo/models/HubNetFunctionActivity ; for terms of use. ; ; ***End NetLogo Model Copyright Notice*** @#$#@#$#@ GRAPHICS-WINDOW 168 152 742 555 23 15 12.0 1 12 1 1 1 CC-WINDOW 8 559 454 643 Command Center BUTTON 6 10 61 43 Setup setup-prompt NIL 1 T OBSERVER T BUTTON 116 57 202 90 Go go T 1 T OBSERVER T MONITOR 3 203 84 252 Mouse X (round mouse-xcor) / 1 1 1 MONITOR 85 203 166 252 Mouse Y (round mouse-ycor) / 1 1 1 MONITOR 258 10 657 59 Quick Start Instructions (more details in info tab) quick-start 0 1 BUTTON 478 60 556 93 <<< PREV view-prev NIL 1 T OBSERVER T BUTTON 555 60 639 93 NEXT >>> view-next NIL 1 T OBSERVER T BUTTON 276 60 394 93 Reset Instructions setup-quick-start NIL 1 T OBSERVER T MONITOR 3 152 166 201 Number of Points at Mouse count turtles-at round mouse-xcor round mouse-ycor 0 1 SWITCH 6 106 112 139 coords? coords? 0 1 -1000 MONITOR 208 100 735 149 Current Verbal Rule rule 3 1 BUTTON 116 106 202 139 Set Rule set-rule NIL 1 T OBSERVER T BUTTON 6 57 92 90 Re-Run setup NIL 1 T OBSERVER T @#$#@#$#@ WHAT IS IT? ----------- Students each find points that satisfy a spoken rule, such as "Move until your y value is twice your x value." The students can see, on their own calculators, their point and its x and y values, and on the NetLogo display they can see everyone's points moving in real-time. Once everyone has picked one or more points that meet the rule, the students can view the last points picked by everyone. They also have the opportunity to attempt to create an equation that best fits the last point entered by everyone. Finally, they can view each other's equations. This activity requires the TI Navigator activity AAA - Function Activity 2.4 For further documentation, see the Participatory Simulations Guide found at http://ccl.northwestern.edu/ps/ HOW TO USE IT ------------- QUICKSTART INSTRUCTIONS: ------------------------ Contains instructions as to how to quickly setup the model, calculators, and TISchool web page so as to run this activity. The instructions can be found below: Teacher: Open the TISchool site in your web browser. Enable activity AAA - Function Activity 2.4 Open the teacher console and press the ERASE ALL DATA button. If it is not open already, open the NetLogo model. If you are prompted by a Login dialog, enter your teacher id and password and any other necessary information. Optional- Zoom In (see Tools in the Menu Bar) Press the GO button. Everyone: Reset the RAM on the calculator by pressing the following keys: 2nd MEM 7 1 2. Login to the calculator. Choose the PICK POINTS option. Remember your shape and color and press ENTER. Move around using the arrow keys to acquaint yourselves with the interface. Teacher: Tell the students a verbal rule, such as "Move until your Y is twice your X." Optional- Press the NetLogo SET RULE button and enter the verbal rule to be displayed in the CURRENT VERBAL RULE monitor. Everyone: Pick some points that meet the requirements of the verbal rule. This is done by moving to a point with the arrow keys and then choosing that point by pressing ENTER or the PICK softkey. Press the REDO softkey to repick the last picked point. When you are done picking points, press the DONE softkey. Choose the VIEW POINTS option to view the last point chosen by each member of the class as well as all the points chosen by you. When finished viewing the points, press the DONE softkey. Now that points are picked, you can create an equation of those points using the CREATE EQN option. Try to match the equation as closely as possible to the last points picked. You may keep on trying different equations by pressing the REDO softkey and entering a new equation at the prompt. When you have chosen the best-fit curve, press the DONE softkey. You can view the class's equations using the VIEW EQNS option. Press the RFSH softkey to get any new equations. When you are done viewing the equations chosen, press the DONE softkey. Teacher: To rerun the activity, do not clear the server. Stop the simulation by pressing the NetLogo GO button. Press the NetLogo RE-RUN button. Press the GO button. Everyone: Exit to the calculator Main Menu. Choose the RESTART option from the calculator Main Menu. Choose the PICK POINTS option and continue. Teacher: To start the simulation over with a new group, stop the model by pressing the NetLogo GO button, if it is on. Have everyone, including yourself, logout of their calculators. Press the ERASE ALL DATA button on the TISCHOOL site. Press the NetLogo SETUP button. Follow these instructions from the beginning again. BUTTONS: -------- SETUP - clears all turtles and patches. This should only be pressed when starting out with a new group of users since all data is lost. RE-RUN - sets up the model to be able to run again with the same users GO - runs the simulation SET RULE - displays an input dialog that allows the leader to enter the verbal rule. The entered rule is then displayed in the CURRENT VERBAL RULE monitor. This is meant for a convenience of the users and has no effect on the actual running of the simulation. NEXT >>> - shows the next quick start instruction <<< PREVIOUS - shows the previous quick start instruction RESET INSTRUCTIONS - shows the first quick start instruction MONITORS: --------- MOUSE X - shows the pxcor of the patch the mouse is currently on, or if the mouse is no longer over the graphics window, it displays the pxcor of the patch the mouse was last on MOUSE Y - shows the pycor of the patch the mouse is currently on, or if the mouse is no longer over the graphics window, it displays the pycor of the patch the mouse was last on NUMBER OF POINTS AT MOUSE - shows the number of turtles on the patch the mouse is currently on, or if the mouse is no longer over the graphics window, it displays the number of turtles on the patch the mouse was last on CURRENT VERBAL RULE - displays the last rule that was entered when the SET RULE button was pressed. This is meant for a convenience of the users and has no effect on the actual running of the simulation. CALCULATOR INFORMATION ---------------------- TEACHER CALCULATOR: ------------------- Students and teacher have identical calculator programs. STUDENT CALCULATORS: -------------------- To select points, choose option PICK POINTS from the calculator Main Menu. Move the cursor with the arrow keys. To pick a point, press the ENTER key or PICK softkey. To remove the last picked point, press the REDO softkey. Be aware that the cursor will move back to the position of the point being removed. To change the distance that the cursor moves when you press an arrow key, press the STEP softkey. This allows you to choose a new distance by which to move the cursor. When you are done picking points, press the DONE softkey. You can choose the VIEW POINTS option to view the last point chosen by each member of the class as well as all the points chosen by you. When finished viewing the points, press the DONE softkey. Then, you can create an equation using the CREATE EQN option. Try to match the equation as closely as possible to last points picked. You may keep on trying different equations, by pressing the REDO softkey and entering a new equation at the prompt. When you have chosen the best-fit curve, press the DONE softkey. You can view the class's equations using the VIEW EQNS option. Press the RFSH softkey to get any new equations. When you are done viewing the equations chosen, press the DONE softkey. THINGS TO NOTICE ---------------- Notice how my-num and user-id are used in keeping track of a particular student's individual points. THINGS TO TRY ------------- Here are a few verbal rules for the teacher to have the students make with their points: Move until your y value is twice your x value. Move until your y value is x times your x value. Move until your y value is the inverse of your x value. EXTENDING THE MODEL ------------------- CREDITS AND REFERENCES ---------------------- This activity and associated models and materials was created as part of the project: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS. The project gratefully acknowledges the support of the National Science Foundation ( REPP program ) -- grant number REC #9814682. Copyright 1999 by Uri Wilensky & Walter Stroup. Updated 2001,2002. All rights reserved. Permission to use, copy, or modify this software and its associated documentation, models and curricular materials for educational and research purposes only and without fee is hereby granted, provided that this copyright notice and the original authors' names appear on all copies and supporting documentation. For any other uses of this software, in original or modified form, including, but not limited to distribution in whole or in part, specific prior permission must be obtained from Uri Wilensky and Walter Stroup. These programs shall not be used, rewritten, or adapted as the basis of a commercial or hardware product without first obtaining appropriate licenses from Uri Wilensky & Walter Stroup. We make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. To refer to this model in academic publications, please use: Wilensky, U. & Stroup, W. (1999). NetLogo HubNet Function Activity model. http://ccl.northwestern.edu/netlogo/models/HubNetFunctionActivity. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. In other publications, please use: Copyright 1999 by Uri Wilensky and Walter Stroup. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/HubNetFunctionActivity for terms of use. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 car true 15 Circle -1 false true 185 55 60 Circle -1 false true 183 186 61 Polygon -1 true true 214 52 214 22 182 26 162 38 144 74 138 102 100 120 99 161 102 201 118 246 152 267 190 275 210 251 187 240 178 200 204 182 215 181 214 118 193 112 182 98 181 72 198 52 square true 0 Rectangle -7566196 true true 48 27 253 222 thin wedge true 0 Polygon -7566196 true true 133 20 70 252 127 148 177 245 wide wedge true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 @#$#@#$#@ NetLogo 2.0beta5 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@