Bahria University Cafeteria3

Bahria University Cafeteria3 preview image

1 collaborator

Default-person Aleeza Safdar (Author)

Tags

(This model has yet to be categorized with any tags)
Model group cosmose | Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.3 • Viewed 157 times • Downloaded 12 times • Run 0 times
Download the 'Bahria University Cafeteria3' modelDownload this modelEmbed this model

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

]
turtles-own [wait-count]
breed [chefs chef]
breed [fishes fish]

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
setup-counter
  setup-counterpath
  setup-chef
  setup-fish

  reset-ticks
end 

to go


    move-turtles
  ask turtles with [color = red]
  [
     set label "food"
  ]
  ask turtles with [color = white]
  [
    lt random 30
    rt random 30
    fd 2
    move-to one-of patches with [pcolor = 35 or pcolor = 114 or pcolor = brown - 12 or pcolor = blue]
    set label "serving"

  ]

  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-fish
   set-default-shape fishes "fish"
   ask n-of 6 (patches with [pcolor = blue]) [sprout-fishes 1 [set color red set size 2]]
end 

to setup-chef

  set-default-shape chefs "Person"

  ask n-of 3 (patches with [pcolor = brown - 12 or pcolor = 114]) [sprout-chefs 1 [set color 9.9 set size 2]]
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-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-counterpath
  ask patch 0 6 [set pcolor brown - 12]
  ask patch -1 6 [set pcolor brown - 12]
  ask patch 1 6 [set pcolor brown - 12]
  ask patch 0 5 [set pcolor brown - 12]
  ask patch -1 5[set pcolor brown - 12]
  ask patch 1 5 [set pcolor brown - 12]
ask patch 0 7 [set pcolor brown - 12]
  ask patch -1 7 [set pcolor brown - 12]
  ask patch 1 7 [set pcolor brown - 12]
  ask patch 0 8 [set pcolor brown - 12]
  ask patch -1 8 [set pcolor brown - 12]
  ask patch 1 8 [set pcolor brown - 12]
end 

to setup-seats
  ask patches [set pcolor black]
 ask patches with [pxcor > -11 and pxcor < 11 and pycor > -13 and pycor < 9] [set pcolor pink]
  ;;ask patches with [(pxcor = 7 or pxcor = 8 or pxcor = -7 or pxcor = -8) and (pycor > 8 and pycor < 12)][set pcolor brown]


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]

  ;;ask patch -9 9 [set pcolor blue]

  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 turtles
  [
 if color = blue
 [
lt random 30
    rt random 30
    fd 2

      move-to one-of patches with [pcolor = white]]


 ;; boys will sit on white chairs
if color = pink

   [
      lt random 30
    rt random 30
    fd 2

     move-to one-of patches with [pcolor = 63]

  ]
    set wait-count wait-count - 1
  ]


  ;; grils will sit on green chairs
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 Cafeteria3.png preview Preview for 'Bahria University Cafeteria3' over 6 years ago, by Aleeza Safdar Download

This model does not have any ancestors.

This model does not have any descendants.