Bahria_university_cafeteria_v2

Bahria_university_cafeteria_v2 preview image

1 collaborator

Default-person anjum iqbal (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.2 • Viewed 57 times • Downloaded 3 times • Run 0 times
Download the 'Bahria_university_cafeteria_v2' 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

turtles-own [count-down
 birth-tick
servingtime
  orderitem
]
breed [servers server]

to
  setup
  reset-ticks
  ca
make-server
   make-student
  make-tables
  make-seats
end 

to make-student
  reset-ticks
create-turtles Student [
     setxy random-pxcor  random-pycor
   set shape "person"
    set size 1.5
    set birth-tick ticks
    set count-down waitingtime
     ]
    ask turtles [choose-gender]
end 

to choose-gender
  set color one-of [yellow blue]
end 

to make-server

  set-default-shape servers "person"
  set-default-shape servers "person"
  ask patches with [pycor > 12 ][set pcolor blue]
  ask n-of 3 (patches with [pcolor = blue]) [sprout-servers 1 [set color yellow set size 3 ]]
end 

to make-tables
  ask patches with[pxcor >= -8 and pxcor <= -4 and pycor >= -7 and pycor <= -4] [set pcolor pink]
  ask patches with[pxcor >= -2 and pxcor <= 2 and pycor >= 4 and pycor <= 7] [set pcolor pink]
  ask patches with[pxcor >= 9 and pxcor <= 13 and pycor >= -3 and pycor <= 0] [set pcolor pink]
  ask patches with[pxcor >= -13 and pxcor <= -9 and pycor >= 10 and pycor <= 13] [set pcolor pink]
end 

to  make-seats
  ask patches with[pxcor >= -13 and pxcor <= -9 and pycor >= 15 and pycor <= 16] [set pcolor red]
  ask patches with[pxcor >= -13 and pxcor <= -9 and pycor >= 7 and pycor <= 8] [set pcolor red]
  ask patches with[pxcor >= -2 and pxcor <= 2 and pycor >= 1  and pycor <= 2] [set pcolor red]
  ask patches with[pxcor >= -2 and pxcor <= 2 and pycor >= 9  and pycor <= 10] [set pcolor red]
  ask patches with[pxcor >= -8 and pxcor <= -4 and pycor >= -10  and pycor <= -9] [set pcolor red]
  ask patches with[pxcor >= -8 and pxcor <= -4 and pycor >= -2  and pycor <= -1] [set pcolor red]
  ask patches with[pxcor >= 9 and pxcor <= 13 and pycor >= 2  and pycor <= 3] [set pcolor red]
  ask patches with[pxcor >= 9 and pxcor <= 13 and pycor >= -6  and pycor <= -5] [set pcolor red]
end 

to go
  move-student
  tick
    if ticks >= 1500 [stop]
end 

to move-student
; ask turtles[
  ;lt random 30
 ; rt random 30
 ; fd 0.1
 ; ]
;end


 ask turtles with [color = yellow ]
  [



    ifelse pcolor != red
    [continue]
    [stay]

  ]
  ask turtles with [color = blue ]
  [


    ifelse pcolor != red
    [continue]
    [stay]

  ]
end 

 To continue
  lt random 10
  rt random 10
  fd 2
end 

to separate-student
  if any? other turtles-here [
    fd 1
    separate-student
  ]
end 

to stay
  set count-down count-down - 1   ;decrement-timer
  set label count-down
  if count-down = 0
    [
      Continue
      set label ""
      reset-count-down
    ] if ticks - birth-tick > 65[ die ]
end 

to reset-count-down
  set count-down waitingtime
end 

















There is only one version of this model, created 12 months ago by anjum iqbal.

Attached files

File Type Description Last updated
Bahria_university_cafeteria_v2.png preview Preview for 'Bahria_university_cafeteria_v2' 12 months ago, by anjum iqbal Download

This model does not have any ancestors.

This model does not have any descendants.