RoundAbout
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
to draw-road ask patches [ set pcolor green - random-float 0.5 ] let road-y (max-pycor / 2) - 7 let road-width 6 ask patches with [pycor >= road-y - road-width / 2 and pycor <= road-y + road-width / 2] [ set pcolor grey - 2.5 + random-float 0.25 ] setup-credits drawy-road round-about create-car end to drawy-road let road-x (max-pxcor / 2) - 8 let road-width 6 ask patches with [pxcor >= road-x - road-width / 2 and pxcor <= road-x + road-width / 2] [ set pcolor grey - 2.5 + random-float 0.25 ] end to round-about ask patches [ let distance-to-center distancexy 0 0 if distance-to-center <= 11 [ set pcolor grey - 2.5 + random-float 0.25 ] ] ask patches [ let distance-to-center distancexy 0 0 if distance-to-center <= 4.5 [ set pcolor white - 2.5 + random-float 0.25 ] ] end to create-car create-turtles 5 [ setxy min-pxcor ((max-pycor / 2) - 7) ; Left to right set heading 90 set shape "car" set color red ] create-turtles 5 [ setxy max-pxcor ((max-pycor / 2) - 9) ; Right to left set heading 270 set shape "car" set color blue ] create-turtles 5 [ setxy ((max-pxcor / 2) - 8) max-pycor ; Top to bottom set heading 180 set shape "car" set color orange ] create-turtles 5 [ setxy ((max-pxcor / 2) - 6) min-pycor ; Bottom to top set heading 0 set shape "car" set color cyan ] end to go go-from-left go-from-right go-from-top go-from-bottom end to go-from-left ask turtles with [heading = 90] [ if xcor < -5 or xcor > 5 [ set ycor ((max-pycor / 2) - 7) ] if xcor >= -5 and xcor <= 5 [ set ycor ((max-pycor / 2) - 3) ] fd 1 ] end to go-from-right ask turtles with [heading = 270] [ if xcor < -5 or xcor > 5 [ set ycor ((max-pycor / 2) - 9) ] if xcor >= -5 and xcor <= 5 [ set ycor ((max-pycor / 2) - 11) ] if xcor >= -4 and xcor <= 4 [ set ycor ((max-pycor / 2) - 12) ] if xcor >= -3 and xcor <= 3 [ set ycor ((max-pycor / 2) - 13) ] fd 1 ] end to go-from-top ask turtles with [heading = 180] [ if ycor < -5 or ycor > 5 [ set xcor ((max-pxcor / 2) - 8) ] if ycor >= -5 and ycor <= 5 [ set xcor ((max-pxcor / 2) - 4) ] if ycor >= -4 and ycor <= 4 [ set xcor ((max-pxcor / 2) - 3) ] fd 1 ] end to go-from-bottom ask turtles with [heading = 0] [ if ycor < -5 or ycor > 5 [ set xcor ((max-pxcor / 2) - 6) ] if ycor >= -5 and ycor <= 5 [ set xcor ((max-pxcor / 2) - 2) ] fd 1 ] end to setup-credits create-turtles 1 [ setxy (max-pxcor ) (min-pycor ) set label "Credits: Wahaj" set label-color white ] end
There is only one version of this model, created 6 months ago by Wahaj Naveed.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
RoundAbout.png | preview | Preview for 'RoundAbout' | 6 months ago, by Wahaj Naveed | Download |
This model does not have any ancestors.
This model does not have any descendants.