Bahria University Cafeteria2
Model was written in NetLogo 6.0.3
•
Viewed 134 times
•
Downloaded 16 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
globals [ seats1 seats2 trg ] breed [servers serve] turtles-own [wait-count servingtime order ] to setup ca create-turtles students [ set wait-count wait-time ;;set wait-count ticks set shape "person" setxy -16 16 set color one-of [pink blue] set size 1.5 ] set trg 2000 setup-seats setup-path ask patches [ setup-counter ] setup-server reset-ticks end to go move-turtles ask turtles with [color = pink or color = blue or color = orange][ if ticks >= trg or wait-count = 0 [set label ""] ] ask turtles with [color = pink or color = blue][ if ticks >= trg or wait-count = 0 [ move-to one-of patches with [pcolor = grey] ] ] if ticks >= trg [stop] tick ;;if ticks >= 100 [stop] end to setup-path ask patch -16 16 [set pcolor grey] ask patch -15 16 [set pcolor grey] ask patch -16 15 [set pcolor grey] ask patch -15 15 [set pcolor grey] ask patch -16 14 [set pcolor grey] ask patch -15 14 [set pcolor grey] ask patch -16 13 [set pcolor grey] ask patch -15 13 [set pcolor grey] ask patch -16 12 [set pcolor grey] ask patch -15 12 [set pcolor grey] ask patch -16 11 [set pcolor grey] ask patch -15 11 [set pcolor grey] ask patch -16 10 [set pcolor grey] ask patch -15 10 [set pcolor grey] ask patch -16 9 [set pcolor grey] ask patch -15 9 [set pcolor grey] ask patch -16 8 [set pcolor grey] ask patch -15 8 [set pcolor grey] ask patch -16 7 [set pcolor grey] ask patch -15 7[set pcolor grey] ask patch -14 8[set pcolor grey] ask patch -14 7 [set pcolor grey] ask patch -13 7 [set pcolor grey] ask patch -13 8 [set pcolor grey] ask patch -12 8 [set pcolor grey] ask patch -11 8 [set pcolor grey] ask patch -12 7 [set pcolor grey] ask patch -11 7 [set pcolor grey] end to setup-counter ask patch -9 11[ set pcolor blue] ask patch -8 11[ set pcolor blue] ask patch -7 11[ set pcolor blue] ask patch -6 11[ set pcolor blue] ask patch -5 11[ set pcolor blue] ask patch -4 11[ set pcolor blue] ask patch -3 11[ set pcolor blue] ask patch -2 11[ set pcolor blue] ask patch -1 11[ set pcolor blue] ask patch 0 11[ set pcolor blue] ask patch 1 11[ set pcolor blue] ask patch 2 11[ set pcolor blue] ask patch 3 11[ set pcolor blue] ask patch 4 11[ set pcolor blue] ask patch 5 11[ set pcolor blue] ask patch 6 11[ set pcolor blue] ask patch 7 11[ set pcolor blue] ask patch 8 11[ set pcolor blue] ask patch 9 11[ set pcolor blue] ask patch -9 10[ set pcolor blue] ask patch -8 10[ set pcolor blue] ask patch -7 10[ set pcolor blue] ask patch -6 10[ set pcolor blue] ask patch -5 10[ set pcolor blue] ask patch -4 10[ set pcolor blue] ask patch -3 10[ set pcolor blue] ask patch -2 10[ set pcolor blue] ask patch -1 10[ set pcolor blue] ask patch 0 10[ set pcolor blue] ask patch 1 10[ set pcolor blue] ask patch 2 10[ set pcolor blue] ask patch 3 10[ set pcolor blue] ask patch 4 10[ set pcolor blue] ask patch 5 10[ set pcolor blue] ask patch 6 10[ set pcolor blue] ask patch 7 10[ set pcolor blue] ask patch 8 10[ set pcolor blue] ask patch 9 10[ set pcolor blue] ask patch -9 9[ set pcolor blue] ask patch -8 9[ set pcolor blue] ask patch -7 9[ set pcolor blue] ask patch -6 9[ set pcolor blue] ask patch -5 9[ set pcolor blue] ask patch -4 9[ set pcolor blue] ask patch -3 9[ set pcolor blue] ask patch -2 9[ set pcolor blue] ask patch -1 9[ set pcolor blue] ask patch 0 9[ set pcolor blue] ask patch 1 9[ set pcolor blue] ask patch 2 9[ set pcolor blue] ask patch 3 9[ set pcolor blue] ask patch 4 9[ set pcolor blue] ask patch 5 9[ set pcolor blue] ask patch 6 9[ set pcolor blue] ask patch 7 9[ set pcolor blue] ask patch 8 9[ set pcolor blue] ask patch 9 9[ set pcolor blue] end to setup-server set-default-shape servers "Person" ask n-of 3 (patches with [pcolor = blue]) [sprout-servers 1 [set color Orange set size 2] ] end to setup-seats ask patches [set pcolor black] ask patches with [pxcor > -13 and pxcor < 16 and pycor > -13 and pycor < 12] [set pcolor pink - 12] ask patches with [pxcor > -8 and pxcor < 8 and pycor > -10 and pycor < 6][set pcolor brown] ask patches with [pxcor > -7 and pxcor < 7 and pycor > -9 and pycor < 5][set pcolor 114] set seats1 (patch-set patch 8 1 patch 8 4 patch 8 -5 patch 8 -8 patch 8 -2 patch -8 -8 patch -8 -5 patch -8 4 patch -8 -2 patch -8 1 ) ask seats1 [set pcolor white] set seats2(patch-set patch -6 -10 patch -6 6 patch 3 -10 patch -3 -10 patch 0 6 patch 0 -10 patch -3 6 patch 3 6 patch 6 -10 patch 6 6 ) ask seats2 [set pcolor 63] end to move-turtles ask n-of ( int (percentage-of-girls-order / 100 * count turtles with [color = pink ])) turtles ; n-of (int (0.30 * count turtles)) turtles [ movetocounter ] ask n-of ( int (percentage-of-boys-order / 100 * count turtles with [color = blue ])) turtles [ movetocounter ] ask turtles [ if color = blue [ move-to one-of patches with [pcolor = white or pcolor = blue]] ;; boys will sit on white chairs if color = pink [ move-to one-of patches with [pcolor = 63 or pcolor = blue] ] set wait-count wait-count - 1 ] ;; grils will sit on green chairs 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 serving-time set order random 3 end
There is only one version of this model, created over 6 years ago by Aleeza Safdar.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bahria University Cafeteria2.png | preview | Preview for 'Bahria University Cafeteria2' | over 6 years ago, by Aleeza Safdar | Download |
ODD2.docx | word | ODD for version2 | over 6 years ago, by Aleeza Safdar | Download |
This model does not have any ancestors.
This model does not have any descendants.