diffusion_sigal_project
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This section could give a general understanding of what the model is trying to show or explain.
HOW IT WORKS
This section could explain what rules the agents use to create the overall behavior of the model.
HOW TO USE IT
This section could explain how to use the model, including a description of each of the items in the interface tab.
THINGS TO NOTICE
This section could give some ideas of things for the user to notice while running the model.
THINGS TO TRY
This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.
EXTENDING THE MODEL
This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.
NETLOGO FEATURES
This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.
RELATED MODELS
This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.
CREDITS AND REFERENCES
This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.
Comments and Questions
globals [cyan-particles yellow-particles show-dark? tick-delta ] breed [ perfume-particles perfume-particle ] breed [ air-particles air-particle ] turtles-own [ darkparticle? last-collision speed mass ] to setup clear-all create-air-particles 400 ask air-particles [ setxy random-xcor random-ycor set color cyan set size .33 ] set-default-shape turtles "circle" create-perfume-particles 100 set-default-shape perfume-particles "circle" ask perfume-particles [ set color yellow set size .43 setxy -13 -13 forward 1 lt 60 forward 1 ] make-box end to make-box ask patches[ ;; if patches are between (-10,-10) to (-10,-16)... if ( pxcor = -10 and pycor <= -10 and pycor >= -16 ) [set pcolor red] ;; ... draws left edge in red ;; if patches are between (-16,-10) to (-16,-16)... if ( pxcor = -16 and pycor <= -10 and pycor >= -16 ) [set pcolor red] ;; ... draws right edge in red ;; if patches are between (-10,-10) to (-16,-10)... if ( pycor = -10 and pxcor >= -16 and pxcor <= -10 ) [set pcolor red] ;; ... draws bottom edge in red ;; if patches are between (-10,-16) to (-16,-16)... if ( pycor = -16 and pxcor >= -16 and pxcor <= -10 ) [set pcolor red] ;; ... draws upper edge in red ] end to go ; if bounce? [ ask turtles [ bounce ] ] ;; all particles bounce ask turtles [ move ] ;; all particles move ; if collide? ; [ ; ask particles ; [ ; check-for-particlecollision ; ] ; tick-advance tick-delta ; ;; we need to check this down here as well, because if there are no ; ;; particles left, trying to set the new tick-delta will cause an error... ; set tick-delta 1 / (ceiling max [speed] of turtles) ; display end ;to bounce ;; partidarkparticle?darkparticle?cle procedure ; ;; if we're not about to hit a wall (yellow patch), or if we're already on a ; ;; wall, we don't need to do any further checks ; if pcolor = red or [pcolor] of patch-at dx dy != red [ stop ] ; ;; get the coordinates of the patch we'll be on if we go forward 1 ; let new-px round (xcor + dx) ; let new-py round (ycor + dy) ; ;; if hitting left or right wall, reflect heading around x axis ; if (abs new-px = box-x) ; [ set heading (- heading) ] ; ;; if hitting top or bottom wall, reflect heading around y axis ; if (abs new-py = box-y) ; [ set heading (180 - heading) ] ;end to move ;; particle procedure let next-patch patch-ahead (speed * tick-delta) ;; die if we're about to wrap... if ((pxcor != 0 and ([pxcor] of next-patch) = (- pxcor)) or (pycor != 0 and ([pycor] of next-patch) = (- pycor))) [ set darkparticle? true ifelse show-dark? [set shape "dark" set color red][set shape "nothing" set color green]] if next-patch != patch-here [ set last-collision nobody ] jump (speed * tick-delta) end
There is only one version of this model, created over 13 years ago by sigal samon.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.
sigal samon
מה לא בסדר בפרוצדורת go?
העתקתי אתפרוצדורתהgo מCC אך היא לא פועלתלמרות שהמודללא מציין מה לא בסדר.שרונה האם תוכלי לבדוק את הפרוצדורה?
Posted over 13 years ago
sigal samon
מה לא בסדר בפרוצדורת go?
העתקתי אתפרוצדורתהgo מCC אך היא לא פועלתלמרות שהמודללא מציין מה לא בסדר.שרונה האם תוכלי לבדוק את הפרוצדורה?
Posted over 13 years ago