Bahria cafe model V1 by Junaid khan 012

Bahria cafe model V1 by Junaid khan 012 preview image

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

1 collaborator

Default-person Junaid khan (Author)

Tags

cosmose 

Tagged by Junaid khan 5 months ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.2 • Viewed 74 times • Downloaded 8 times • Run 0 times
Download the 'Bahria cafe model V1 by Junaid khan 012' 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

patches-own
[
  tables
  chairs
]

to clear
  clear-all
end 

to setup
  clear-all
  ask patches
  [
    set pcolor black
  ]
  setup-turtles
  setup-patches
  reset-ticks
end 

to go
 ; setup-turtles
  move-turtles
  tick
end 

to setup-turtles
; create-turtles with different number by slider
create-turtles Initial-Students [
    choose-sex                   ;; become a man or a woman
    set size 1.5                   ;; be easier to see
  ]
  ask turtles
  [
    setxy random-xcor random-ycor
    set shape "person"
  ]
end 

to choose-sex  ;; turtle procedure
  set color one-of [pink blue]
end 

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

to move-turtles
  ask turtles
  [
    right random 360
    fd 1
   ; set energy energy - 1
    ; pen-down
  ]
end 

to setup-tables

  let x pxcor
  let y pycor

  ;  From left to right table no 1 at coordinates below
  ;=============================================================================
   ask patches with [pxcor =  0 and pycor =  0 ]

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

      [
       set pcolor red
       ]
  ask patches with [pxcor =  -2 and pycor =  0 ]

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

      [
       set pcolor red
       ]
  ask patches with [pxcor =  -1 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  -2 and pycor =  1 ]

      [
       set pcolor red
       ]

; From left to right  table no 2 at coordinates below
  ;==========================================================================
  ask patches with [pxcor =  2 and pycor =  0 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  3 and pycor =  0 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  4 and pycor =  0 ]

      [
       set pcolor red
       ]
   ask patches with [pxcor =  2 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  3 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  4 and pycor =  1 ]

      [
       set pcolor red
       ]

  ; From left to right table no 3 at coordinates below
  ;==========================================================================
   ask patches with [pxcor =  6 and pycor =  0 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  7 and pycor =  0 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  8 and pycor =  0 ]

      [
       set pcolor red
       ]
   ask patches with [pxcor =  6 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  7 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  8 and pycor =  1 ]

      [
       set pcolor red
       ]
  ; From left to right table no 4 at coordinates below
  ;=============================================================================
   ask patches with [pxcor =  10 and pycor =  0 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  11 and pycor =  0 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  12 and pycor =  0 ]

      [
       set pcolor red
       ]
   ask patches with [pxcor =  10 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  11 and pycor =  1 ]

      [
       set pcolor red
       ]
  ask patches with [pxcor =  12 and pycor =  1 ]

      [
       set pcolor red
       ]
end 

to setup-chairs

  ; chairs arround table no 1 at below coordinates
       ; upside chairs---------------------------------------------------------
  ask patches with [pxcor =  0 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  -1 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  -2 and pycor =  3 ]

      [
       set pcolor green
       ]
       ; downside chairs------------------------------------------------------
  ask patches with [pxcor =  0 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  -1 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  -2 and pycor =  -2 ]

      [
       set pcolor green
       ]

  ; chairs arround table no 2 below  coordinates
         ; upside chairs-----------------------------------------------------
  ask patches with [pxcor =  2 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  3 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  4 and pycor =  3 ]

      [
       set pcolor green
       ]
        ; downside chairs--------------------------------------------------
  ask patches with [pxcor =  2 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  3 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  4 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ; chairs arround table no 3 at below coordinates
       ; upside chairs-----------------------------------------------------
  ask patches with [pxcor =  6 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  7 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  8 and pycor =  3 ]

      [
       set pcolor green
       ]
        ; downside chairs---------------------------------------------------
  ask patches with [pxcor =  6 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  7 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  8 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ; chairs arround table no 4 at below coordinates
         ; upside chairs-----------------------------------------------------
  ask patches with [pxcor =  10 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  11 and pycor =  3 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  12 and pycor =  3 ]

      [
       set pcolor green
       ]
        ; downside chairs---------------------------------------------------
  ask patches with [pxcor =  10 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  11 and pycor =  -2 ]

      [
       set pcolor green
       ]
  ask patches with [pxcor =  12 and pycor =  -2 ]

      [
       set pcolor green
       ]
end 

There is only one version of this model, created 5 months ago by Junaid khan.

Attached files

File Type Description Last updated
Bahria cafe model V1 by Junaid khan 012.png preview Preview for 'Bahria cafe model V1 by Junaid khan 012' 5 months ago, by Junaid khan Download
Bahria cafe model version 1 experiment 1 for model v1-table.csv data bahria cafe model behavior space experiment 1 for model v1 5 months ago, by Junaid khan Download
Bahria cafe model version 1 experiment 2 for model v1-table.csv data bahria cafe model behavior space experiment 2 for model v1 5 months ago, by Junaid khan Download
odd-bahria-cafe (1).pdf pdf ODD for Bahria student cafeteria mode V1 5 months ago, by Junaid khan Download
v1.01.PNG png bahria cafe model behavior space experiment 1 for model v1 5 months ago, by Junaid khan Download
v1.02.PNG png bahria cafe model behavior space experiment 2 for model v1 5 months ago, by Junaid khan Download

This model does not have any ancestors.

This model does not have any descendants.