Student_Cafeteria

Student_Cafeteria preview image

1 collaborator

Default-person Muhammad Ahsan (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.3 • Viewed 164 times • Downloaded 12 times • Run 0 times
Download the 'Student_Cafeteria' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

patches-own [  table-number ];;for tables
globals[counter_patches ;; for cafe_counter
 point   ;;for break
  Female_Chairs_Chairs
 Male_Chairs
]
turtles-own [ ;;for average waiting time
Timerr
]

to setup
ca
  setup-chiars
 create-turtles students
  [
    set Timerr Ave_time
    ;;setTimerr ticks
      set shape "person"
    setxy -3 -14
     set color one-of [pink blue]
    set size 1.5

  ]
   set point 20

  ask patches[
    setup-table
    recolor-patch

  ]




  reset-ticks
end 

to setup-table  ;;setting tables

    if (distancexy (-0.1 * max-pxcor) 12) < 3
  [
   set pcolor turquoise
  ]
 set counter_patches patches with [ (distancexy (-0.1 * max-pxcor) -14) < 3  ]

  ask counter_patches [
    set pcolor white

  ]

  if (distancexy (0.6 * max-pxcor) -3) < 0.6
  [ set table-number 1
   set pcolor violet
  ]

   if (distancexy (0.6 * max-pxcor) 3) < 0.6
  [ set table-number 3 ]


  if (distancexy (-0.6 * max-pxcor) -3) < 0.6
  [ set table-number 5
   set pcolor violet]

  if (distancexy (-0.6 * max-pxcor) 3) < 0.6
  [ set table-number 7
   set pcolor violet]
end 

to recolor-patch  ;; patch procedure


      if table-number  = 1 [ set pcolor violet ]
      if table-number  = 2 [ set pcolor violet  ]
      if table-number  = 3 [ set pcolor violet ]
end 

to go
move-turtles
   ask turtles with [color = pink or color = blue] [
    if ticks >= point or Timerr = 0
    [ move-to one-of patches with [pcolor = white]
      ht
    ]
  ]
  if ticks >= point


  [stop]


     tick
end 

to setup-chiars
  ask patches [set pcolor black]




  set Female_Chairs_Chairs (patch-set patch 9 2 patch 9 4 patch 9 2 patch 9 -4 patch 9 -2   );;right side female setup
  ask Female_Chairs_Chairs [set pcolor brown]

  set Male_Chairs(patch-set
   patch -10 -4 patch -10 4 patch -10 -2 patch -10 2   );;left side male setup
  ask Male_Chairs [set pcolor green]
end 

to move-turtles

  ask turtles
  [
 if color = blue
 [
lt random 30
    rt random 30
    fd 2

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



if color = pink

   [
      lt random 30
    rt random 30
    fd 2

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

  ]
    set Timerr Timerr - 1
  ]
end 

There is only one version of this model, created over 7 years ago by Muhammad Ahsan.

Attached files

File Type Description Last updated
Student_Cafeteria.png preview Preview for 'Student_Cafeteria' over 7 years ago, by Muhammad Ahsan Download

This model does not have any ancestors.

This model does not have any descendants.