Bahria-Cafeteria-Simulation-Model-V3
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
breed [males male] breed [females female] breed [servers server] breed [waiters waiter] males-own [cafe-time status] females-own [cafe-time status] globals [counter] to setup clear-all setup-cafeteria reset-ticks end to setup-cafeteria make-counter make-tables make-students make-servers make-waiters set counter 0 end to make-counter ask patch (0) (max-pycor) [ ask patches with [ distance myself < 6 ] [ set pcolor yellow ] ] end to make-tables ask patch (-0.6 * max-pxcor) 5 [ ask patches with [ distance myself < 2.5 ] [ set pcolor blue ] ] ask patch (0.6 * max-pxcor) 5 [ ask patches with [ distance myself < 2.5 ] [ set pcolor cyan ] ] ask patch (-0.6 * max-pxcor) -5 [ ask patches with [ distance myself < 2.5 ] [ set pcolor red ] ] ask patch (0.6 * max-pxcor) -5 [ ask patches with [ distance myself < 2.5 ] [ set pcolor green ] ] end to make-students create-ordered-males male-students [ set shape "person" set color white move-same-students ] create-ordered-females female-students [ set shape "person" set color pink move-same-students ] end to move-same-students set size 1.5 set heading 0 setxy (10 + random -22) min-pycor set cafe-time average-waiting-time set status 0 end to make-servers create-servers number-of-servers [ set shape "person" set color black set size 1.5 setxy (1 + random 5) (max-pycor - 2) ] end to make-waiters create-waiters number-of-waiters [ set shape "person" set color violet set size 1.5 setxy (-2 + random 5) (max-pycor - 4) ] end to go ask males [ if pycor != 12 [ move-students ] ] ask females [ if pycor != 12 [ move-students ] ] tick end to move-students if (ticks mod 60 = 0) [ set cafe-time (cafe-time - 1) ] if (cafe-time = 0) [ die ] if counter = 0 [ if(status = 0) [ move-to patch -12 -5 set status 1 set counter counter + 1 ] ] if counter = 1 [ if(status = 0) [ move-to patch -15 -6 set status 1 set counter counter + 1 ] ] if counter = 2 [ if(status = 0) [ move-to patch 14 -3 set status 1 set counter counter + 1 ] ] if counter = 3 [ if(status = 0) [ move-to patch 14 -7 set status 1 set counter counter + 1 ] ] if (status = 0) [ fd random 2 ] set label cafe-time end
There is only one version of this model, created over 7 years ago by Yasir Siddique.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bahria-Cafeteria-Simulation-Model-V3.png | preview | Preview for 'Bahria-Cafeteria-Simulation-Model-V3' | over 7 years ago, by Yasir Siddique | Download |
ODD-Bahria-Cafeteria-V3.docx | word | ODD-Bahria-Cafeteria-V3 | over 7 years ago, by Yasir Siddique | Download |
This model does not have any ancestors.
This model does not have any descendants.