BUIC Cafeteria Version 1

No preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Default-person Taif Ali (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.2 • Viewed 201 times • Downloaded 16 times • Run 0 times
Download the 'BUIC Cafeteria Version 1' 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

;Author Name Taif ali
;taifekhann@gamil.com
;version 1




turtles-own [time-notify
  arrival-tick

]

to setup
  ca

  setup-students ;male and female

  ask patches [setup-tables]
  ask patches [setup-chairs]




  reset-ticks
end 

to setup-tables

ask patch 24 14 [ set pcolor red]
  ask patch 24 13 [ set pcolor red]
  ask patch 24 12 [ set pcolor red]
  ask patch 24 5 [ set pcolor red]
  ask patch 24 4 [ set pcolor red]
  ask patch 24 3 [ set pcolor red]
  ask patch 24 -14 [ set pcolor red]
  ask patch 24 -13 [ set pcolor red]
  ask patch 24 -12 [ set pcolor red]
  ask patch 24 -5 [ set pcolor red]
  ask patch 24 -4 [ set pcolor red]
  ask patch 24 -3 [ set pcolor red]

  ask patch 13 14 [ set pcolor red]
  ask patch 13 13 [ set pcolor red]
  ask patch 13 12 [ set pcolor red]
  ask patch 13 5 [ set pcolor red]
  ask patch 13 4 [ set pcolor red]
  ask patch 13 3 [ set pcolor red]
  ask patch 13 -14 [ set pcolor red]
  ask patch 13 -13 [ set pcolor red]
  ask patch 13 -12 [ set pcolor red]
  ask patch 13 -5 [ set pcolor red]
  ask patch 13 -4 [ set pcolor red]
  ask patch 13 -3 [ set pcolor red]
end 

to setup-chairs
  ask patch 26 14 [ set pcolor white]
   ask patch 26 12 [ set pcolor white]
  ask patch 22 14 [ set pcolor white]
   ask patch 22 12 [ set pcolor white]

  ask patch 26 5 [ set pcolor white]
   ask patch 26 3 [ set pcolor white]
  ask patch 22 5 [ set pcolor white]
   ask patch 22 3 [ set pcolor white]

  ask patch 26 -5 [ set pcolor white]
   ask patch 26 -3 [ set pcolor white]
  ask patch 22 -5 [ set pcolor white]
   ask patch 22 -3 [ set pcolor white]

  ask patch 26 -14 [ set pcolor white]
   ask patch 26 -12 [ set pcolor white]
  ask patch 22 -14 [ set pcolor white]
   ask patch 22 -12 [ set pcolor white]

  ask patch 15 14 [ set pcolor white]
   ask patch 15 12 [ set pcolor white]
  ask patch 11 14 [ set pcolor white]
   ask patch 11 12 [ set pcolor white]

  ask patch 15 5 [ set pcolor white]
   ask patch 15 3 [ set pcolor white]
  ask patch 11 5 [ set pcolor white]
   ask patch 11 3 [ set pcolor white]

  ask patch 15 -5 [ set pcolor white]
   ask patch 15 -3 [ set pcolor white]
  ask patch 11 -5 [ set pcolor white]
   ask patch 11 -3 [ set pcolor white]

  ask patch 15 -14 [ set pcolor white]
   ask patch 15 -12 [ set pcolor white]
  ask patch 11 -14 [ set pcolor white]
   ask patch 11 -12 [ set pcolor white]
end 

to setup-students

  reset-ticks
  set-default-shape turtles "person"

  create-turtles totalnoofstudents[
    set color one-of [brown pink]
    set ycor random-ycor

    set arrival-tick ticks

    set time-notify responsetime
  ]
end 

to distinct-student
  if any? other turtles-here [
    fd 2
    distinct-student
  ]
end 

to go
 proceed-turtles

  tick


  if ticks >= 720 [stop]
end 

to proceed-turtles
  ask turtles with [color = pink ]
  [



    ifelse pcolor != white
    [continue]
    [stay]
   ; [leave]
   ; if ycor > 25 [ die ]
  ]
end 

 To continue
  lt random 9
  rt random 9
  fd 3
end 

to stay
  set time-notify time-notify - 1
  set label time-notify
  if time-notify = 0
    [
      Continue
      set label ""

    ] if ticks - arrival-tick > 70[ die ]
end 

to reset-arrival
  set time-notify responsetime
end 

There is only one version of this model, created almost 6 years ago by Taif Ali.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.