Bahria_university_cafeteria_3
Model was written in NetLogo 6.0.2
•
Viewed 141 times
•
Downloaded 14 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
turtles-own [count-down birth-tick servingtime orderitem ] breed [servers server] to setup reset-ticks ca make-server make-student make-tables make-seats end to make-student reset-ticks create-turtles Student [ setxy random-pxcor random-pycor set shape "person" set size 1.5 set birth-tick ticks set count-down waitingtime ] ask turtles [choose-gender] end to choose-gender set color one-of [yellow blue] end to make-server set-default-shape servers "person" set-default-shape servers "person" ask patches with [pycor > 15 ][set pcolor blue] ask n-of 3 (patches with [pcolor = blue]) [sprout-servers 1 [set color yellow set size 3 set label "take order" ]] end to setup-barcounter if pycor > 25 and pycor < 30 [ set pcolor blue] end to make-tables ask patches with[pxcor >= -8 and pxcor <= -4 and pycor >= -7 and pycor <= -4] [set pcolor pink] ask patches with[pxcor >= -2 and pxcor <= 2 and pycor >= 4 and pycor <= 7] [set pcolor pink] ask patches with[pxcor >= 9 and pxcor <= 13 and pycor >= -3 and pycor <= 0] [set pcolor pink] ask patches with[pxcor >= -13 and pxcor <= -9 and pycor >= 10 and pycor <= 13] [set pcolor pink] end to make-seats ask patches with[pxcor >= -13 and pxcor <= -9 and pycor >= 15 and pycor <= 16] [set pcolor red] ask patches with[pxcor >= -13 and pxcor <= -9 and pycor >= 7 and pycor <= 8] [set pcolor red] ask patches with[pxcor >= -2 and pxcor <= 2 and pycor >= 1 and pycor <= 2] [set pcolor red] ask patches with[pxcor >= -2 and pxcor <= 2 and pycor >= 9 and pycor <= 10] [set pcolor red] ask patches with[pxcor >= -8 and pxcor <= -4 and pycor >= -10 and pycor <= -9] [set pcolor red] ask patches with[pxcor >= -8 and pxcor <= -4 and pycor >= -2 and pycor <= -1] [set pcolor red] ask patches with[pxcor >= 9 and pxcor <= 13 and pycor >= 2 and pycor <= 3] [set pcolor red] ask patches with[pxcor >= 9 and pxcor <= 13 and pycor >= -6 and pycor <= -5] [set pcolor red] end to go move-student ask servers [ rt random 10 fd 1 if orderitem != 0 and pcolor = green [set pcolor white set label "placing order on table"] ] tick tick if ticks >= 500 [stop] end to move-student ; ask turtles[ ;lt random 30 ; rt random 30 ; fd 0.1 ; ] ;end ask turtles with [color = yellow ] [ ifelse pcolor != red [continue] [stay] ] ask turtles with [color = blue ] [ ifelse pcolor != red [continue] [stay] ] end To continue lt random 10 rt random 10 fd 2 end to separate-student if any? other turtles-here [ fd 1 separate-student ] end to stay set count-down count-down - 1 ;decrement-timer set label count-down if count-down = 0 [ Continue set label "" reset-count-down ] if ticks - birth-tick > 65[ die ] end to reset-count-down set count-down waitingtime end to movetocounter let targ one-of patches with[pcolor = blue] if targ != nobody [move-to one-of patches with [not any? turtles-here and pcolor = blue]] set label "give order" set servingtime avgservingtime set orderitem random 3 end
There is only one version of this model, created over 6 years ago by anjum iqbal.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bahria_university_cafeteria_3.png | preview | Preview for 'Bahria_university_cafeteria_3' | over 6 years ago, by anjum iqbal | Download |
This model does not have any ancestors.
This model does not have any descendants.