Bahria Cafe V1
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 [persons person] breed [waiters waiter] persons-own[ time_to_leave] patches-own[student-on-table] globals [ available tablem-x tablem-y tablef-x tablef-y ] to setup clear-all open-door set-tables set-chairs student-come set available 0 reset-ticks end to open-door ask patches with [ pxcor = 16 and pycor = 0] [ set pcolor brown ] end to set-tables let table 1 set tablem-x 8 + min-pxcor set tablem-y 7 set tablef-x 24 + min-pxcor set tablef-y 7 while [table < tables ] [ ask patch tablem-x tablem-y [ set pcolor brown set table table + 1 set tablem-y tablem-y + 10 ] ask patch tablef-x tablef-y [ set pcolor brown set table table + 1 set tablef-y tablef-y + 10 ] ] end to set-chairs ask patch 5 28[ set pcolor orange ] ask patch 5 26[ set pcolor orange ] ask patch 5 18[ set pcolor orange ] ask patch 5 16[ set pcolor orange ] ask patch 5 8[ set pcolor orange ] ask patch 5 6[ set pcolor orange ] ask patch 11 28[ set pcolor orange ] ask patch 11 26[ set pcolor orange ] ask patch 11 18[ set pcolor orange ] ask patch 11 16[ set pcolor orange ] ask patch 11 8[ set pcolor orange ] ask patch 11 6[ set pcolor orange ] ask patch 21 28[ set pcolor orange ] ask patch 21 26[ set pcolor orange ] ask patch 21 18[ set pcolor orange ] ask patch 21 16[ set pcolor orange ] ask patch 21 8[ set pcolor orange ] ask patch 21 6[ set pcolor orange ] ask patch 27 28[ set pcolor orange ] ask patch 27 26[ set pcolor orange ] ask patch 27 18[ set pcolor orange ] ask patch 27 16[ set pcolor orange ] ask patch 27 8[ set pcolor orange ] ask patch 27 6[ set pcolor orange ] end to student-come create-persons initial-students [ choose-sex ;; become a man or a woman set size 1.5 setxy 16 0.5 set shape "person" set time_to_leave -1 ] end to choose-sex ;; turtle procedure set color one-of [pink blue] end to go if not any? persons [ stop ] ask persons[ ifelse time_to_leave = -1 [ wiggle direct-way ] [ set time_to_leave time_to_leave - 1 if time_to_leave = 0 [ wiggle die ] ] ] if count persons with [ycor > 0] < initial-students [ create-persons 1 [ choose-sex ;; become a man or a woman set size 1.5 setxy 16 0.5 set shape "person" set time_to_leave -1 ] ] tick end to wiggle if pcolor != white and pcolor != brown [ rt random-float 30 lt random-float 30 forward 1 ] if pcolor = brown [ fd 3 ] if pcolor = orange [ set pcolor white fd 0 set time_to_leave random Avg-waiting-time ] if pcolor = white and time_to_leave = 0 [ set pcolor orange ] end to direct-way if color = blue and xcor >= 16 [ rt 180 ] if color = pink and xcor < 16 [ lt 180 ] end
There is only one version of this model, created over 7 years ago by sumbal khan.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bahria Cafe V1.png | preview | Preview for 'Bahria Cafe V1' | over 7 years ago, by sumbal khan | Download |
This model does not have any ancestors.
This model does not have any descendants.