electricity17-5
No preview image
Model was written in NetLogo 4.1.2
•
Viewed 272 times
•
Downloaded 29 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This code example is a demo of a basic random walk. At each step, the yellow turtle changes its heading randomly.
THINGS TO NOTICE
The turtle's pen is down, so it leaves a trail behind it in the drawing.
RELATED MODELS
Random Grid Walk Example - the same except that the random walk is constrained to lie on a grid
Comments and Questions
Click to Run Model
breed [circles circle] breed [lights-on light-on] breed [mafseks-on mafsek-on] breed [mafseks-off mafsek-off] breed [battery batteries] to setup [ clear all ] end to set-up-mafsek-on-ciruit-Serial set-default-shape mafseks-on "mafsek-on" create-mafseks-on 1 [ setxy 20 10 set size 12 set heading 90 ] end to set-up-mafsek-off-ciruit-Serial set-default-shape mafseks-on "mafsek-on" create-mafseks-on 1 [ setxy 20 10 set size 12 set heading 90 ] end to set-up-light-on-ciruit-Serial set-default-shape lights-on "light-on" create-lights-on 1 [ setxy 25 20 set size 3 set heading 90 ] end to set-up-electron-ciruit-Serial set-default-shape circles "circle" create-circles 2 [ setxy 10 10 set size 0.5 set heading 90 ] end to set-up-battery-ciruit-Serial set-default-shape battery "battery" create-battery 1 [ setxy 30 9 set size 12 set heading 360 ] end to set-up-light-on-Parallel-circuit set-default-shape lights-on "light-on" create-lights-on 1 [ setxy 62 15 set size 3 set heading 90 ] set-default-shape lights-on "light-on" create-lights-on 1 [ setxy 62 20 set size 3 set heading 90 ] end to set-up-mafsek-on-Parallel-circuit set-default-shape mafseks-on "mafsek-on" create-mafseks-on 1 [ setxy 57 10 set size 8 set heading 90 ] end to set-up-electron-Parallel-circuit set-default-shape circles "circle" create-circles 2 [ setxy 50 10 set size 0.5 set heading 90 ] end to set-up-battery-Parallel-circuit set-default-shape battery "battery" create-battery 1 [ setxy 68 9 set size 12 set heading 360 ] end to Closed-Circuit-Serial ca end to open-Circuit-Serial ca end to Burning-light ca end to insert-light ca end to Increasing-electrons ca end to setup-ciruit-Serial ca ;; clear everything ask patches[ ;; if patches are between (10,10) to (10,20)... if (pxcor = (10) and pycor >= (10) and pycor <= ( 20 ) ) [set pcolor red] ;; ... draws left edge in red ;; if patches are between (35,10) to (35,20)... if ( pxcor = (35) and pycor >= (10) and pycor <= (20) ) [set pcolor red] ;; ... draws right edge in red ;; if patches are between (10,10) to (35,10)... if ( pycor = (10) and pxcor >= (10) and pxcor <= (35) ) [set pcolor red] ;; ... draws bottom edge in red ;; if patches are between (10,20) to (35,20)... if ( pycor = (20) and pxcor >= (10) and pxcor <= (35) ) [set pcolor red] ;; ... draws upper edge in red ] set-up-light-on-ciruit-Serial set-up-mafsek-on-ciruit-Serial set-up-electron-ciruit-Serial set-up-battery-ciruit-Serial end to go-Serial-circuit ask circles [ ifelse pxcor >= 10 and pxcor <= 34 [ fd 1] [ set heading 0 ] ] ask circles [ ifelse pycor >= 10 and pycor <= 30 [ fd 1] [ set heading 0 ] ] ; ask circles ;[ ifelse ;pxcor <= 34 and pxcor >= 10 [ bk 1] ; [ set heading 360] ;] ; repeat 2 [ fd 8 rt 90 ] end to setup-ciruit-Parallel ask patches[ ;; if patches are between (50,10) to (50,20)... if (pxcor = (50) and pycor >= (10) and pycor <= ( 20 ) ) [set pcolor blue] ;; ... draws left edge in blue ;; if patches are between (75,10) to (75,20)... if ( pxcor = (75) and pycor >= (10) and pycor <= (20) ) [set pcolor blue] ;; ... draws right edge in blue ;; if patches are between (50,10) to (75,10)... if ( pycor = (10) and pxcor >= (50) and pxcor <= (75) ) [set pcolor blue] ;; ... draws bottom edge in blue ;; if patches are between (50,20) to (75,20)... if ( pycor = (20) and pxcor >= (50) and pxcor <= (75) ) [set pcolor pink] ;; ... draws upper edge in pink ;; if patches are between (50,15) to (75,15)... if ( pycor = (15) and pxcor >= (50) and pxcor <= (75) ) [set pcolor pink] ;; ... draws middle edge in pink ] set-up-light-on-Parallel-circuit set-up-mafsek-on-Parallel-circuit set-up-battery-Parallel-circuit set-up-electron-Parallel-circuit end to go-Parallel-circuit ask circles [ ifelse pxcor >= 50 and pxcor <= 75 [ fd 1] [ set heading 0 ] ] ask circles [ ifelse pycor >= 10 and pycor <= 30 [ fd 1] [ set heading 0 ] ] ; ask circles ; [ ifelse ; pxcor <= 34 and pxcor >= 10 [ bk 1] ; [ set heading 360] ; ] end
There is only one version of this model, created over 13 years ago by soheir othman.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.
soheir othman
שאלה למעגלים חשמליים-נשות חשמל נצרת (Question)
שלום שרונה אחרי שחזנו מהלימודים ישבנו בסקייב ועשינו לפי ההדרכה שלך במיל, תיקנו קצת הוספנו בטריה אבל נשאר לנו כמה שאלות: א. אם מפעילים רק המעגל הטורי האלקטרון נע בכיוון ימינה ואחר כך למעלה לא מצליחים לסובב אותו שמאלה ב. כאשר מפעילים המקבילי מופעל שני האקטרונים במקבילי ובטורי נא הדרכותך תודה על שיתוף הפעולה נשות חשמל נצרת
Posted over 13 years ago
Sharona T Levy
שינוי כיוון תנועה במסלול (Question)
כדאי לחשוב על אופן הפעולה של האלקטרון ולבנות לו חוקים מתאימים. לדוגמה: אם אתה מגיע לקצה, תפנה שמאלה תשעים מעלות, אם אז אתה מתנגש תסתובב לאחור ותתקדם. אקדיש לכך זמן היום.
Posted over 13 years ago