Bahria_University_CafeV1Updated

Bahria_University_CafeV1Updated preview image

1 collaborator

Default-person Kashif Khan (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.3 • Viewed 245 times • Downloaded 22 times • Run 0 times
Download the 'Bahria_University_CafeV1Updated' 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

; Version One of the simulation of the Bahrai University Cafeteria
; Developed by Kashif Khan


turtles-own [ Girls Boys ]

to setup
  clear-all
 draw-walls
door
  ask patches [ setup-tables setup-chairs]  ;; create a blank background
  create-turtles initial-students [
     set shape "person"
    set size 2
    move-to one-of patches

    setxy random-xcor random-ycor


    if (Gender = "Girls")     [ set color blue ]
    if (Gender = "Boys")  [ set color red ]
    if (Gender = "mixed")     [ set color one-of [ red blue ] ]


    set Girls one-of other turtles
    set Boys one-of other turtles
  ]
  reset-ticks
end 

to go
  ask turtles [
    if (color = blue)  [ Girls-set ]
    if (color = red)   [ boys-set ]
  ]
   if ticks >= 1000

  [stop]

  tick
end 

to Girls-set


     move-to one-of patches with [pcolor = yellow ]
wait waiting-tim
end 

to boys-set
move-to one-of patches with [pcolor = blue ]
wait waiting-tim
end 

to preset [ seed ]
  set Gender "mixed"
  set initial-students initial-students
  random-seed seed
  setup
end 

to setup-tables

  let x pxcor
  let y pycor



   ask patches with [pxcor >  -15 and pxcor < -3 and pycor =  10]

    [
       set pcolor pink
       ]
  ask patches with [pxcor >  -15 and pxcor < -3 and pycor = 11 ]
      [
       set pcolor pink
       ]
   ask patches with [pxcor >  -15 and pxcor < -3 and pycor =  12]
      [
       set pcolor pink
       ]


  ask patches with [pxcor =  -4 and pycor > 10 and pycor <  21 ]

      [
       set pcolor pink
       ]




  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  0 ]

      [
       set pcolor red
       ]

  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  0 ]

      [
       set pcolor red
       ]


    ask patches with [pxcor >  5 and pxcor < 9 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  0 ]

      [
       set pcolor red
       ]

    ask patches with [pxcor >  9 and pxcor < 13 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  0 ]

      [
       set pcolor red
       ]

  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -9 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -10 ]

      [
       set pcolor red
       ]

  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  -9 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  -10 ]

      [
       set pcolor red
       ]

  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  -9 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  -10 ]

      [
       set pcolor red
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -9 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -10 ]

      [
       set pcolor red
       ]
end 

to setup-chairs


 ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  3 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -2 ]

      [
       set pcolor yellow
       ]


  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  3 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  -2 ]

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  3 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  -2 ]

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  3 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -2 ]

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -7 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -12 ]

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  -7 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  1 and pxcor < 5 and pycor =  -12 ]

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  -7 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  -12 ]

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -7 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -12 ]

      [
       set pcolor yellow
       ]
end 

to draw-walls
  ask patches with [abs pxcor = max-pxcor]
    [ set pcolor pink ]
  ask patches with [abs pycor = max-pycor]
    [ set pcolor pink ]
end 

to door

   ask patches with [pxcor >  -3 and pxcor = -3 and pycor =  16 ]

      [
       set pcolor white
       ]
  ask patches with [pxcor >  -2  and pycor =  16 ]

      [
       set pcolor pink
       ]
end 

There is only one version of this model, created over 6 years ago by Kashif Khan.

Attached files

File Type Description Last updated
Bahria_University_CafeV1Updated.png preview Preview for 'Bahria_University_CafeV1Updated' over 6 years ago, by Kashif Khan Download

This model does not have any ancestors.

This model does not have any descendants.