Bahria_Cafe_Model_V3_Aamir_Sultan

Bahria_Cafe_Model_V3_Aamir_Sultan preview image

1 collaborator

Default-person aamir sultan (Author)

Tags

cosmose 

Tagged by aamir sultan over 6 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.3 • Viewed 225 times • Downloaded 22 times • Run 0 times
Download the 'Bahria_Cafe_Model_V3_Aamir_Sultan' 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 white
  ]
  setup-turtles
  setup-patches
  setup-waiters

  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

    ]
end 

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

to setup-waiters
 ; create-waiters with different number by slider

  create-turtles waiters [
    set size 1.5                   ;; be easier to see
    set color yellow               ;;Yellow color for waiters
  ]
  ask turtles
  [
    setxy random-xcor random-ycor
    set shape "person"
  ]
end 


; <<<<<<<<<<<<<<<<<<<<<<<<<< Tables procedure now >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

to setup-tables

  let x pxcor
  let y pycor


  ;  Cafe Counter
  ;=============================================================================

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

      [
       set pcolor black
       ]
   ask patches with [pxcor >  -3 and pxcor < 7 and pycor =  12 ]

      [
       set pcolor black
       ]

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

      [
       set pcolor black
       ]
 ask patches with [pxcor =  8 and pycor > 10 and pycor <  21 ]

      [
       set pcolor black
       ]


  ;============================= Tables 1================================================

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

      [
       set pcolor brown
       ]
  ask patches with [pxcor >  -15 and pxcor < -11 and pycor =  0 ]

      [
       set pcolor brown
       ]

  ;============================= Chair 1================================================

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

      [
       set pcolor brown
       ]
  ask patches with [pxcor >  -15 and pxcor < -11 and pycor =  -2 ]

      [
       set pcolor brown
       ]
    ask patches with [pxcor >  -11 and pxcor < -9 and pycor =  1 ]

      [
       set pcolor brown
       ]
   ask patches with [pxcor >  -17 and pxcor < -15 and pycor =  1 ]

      [
       set pcolor brown
       ]

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

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

      [
       set pcolor red
       ]
  ;=================================Chair 2============================================
 ask patches with [pxcor >  -7 and pxcor < -3 and pycor =  3 ]

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

      [
       set pcolor red
       ]



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

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

      [
       set pcolor orange
       ]
  ;==========================Chair3 ==============================================
   ask patches with [pxcor >  1 and pxcor < 5 and pycor =  3 ]

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

      [
       set pcolor orange
       ]

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

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

      [
       set pcolor blue
       ]
  ;; ===========================Chair 4 ==========================================
   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 blue
       ]


  ;===========================table 5==================================================
  ask patches with [pxcor >  -15 and pxcor < -11 and pycor =  -9 ]

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

      [
       set pcolor pink
       ]

  ;=========================Chair 5 ============================================

    ask patches with [pxcor >  -15 and pxcor < -11 and pycor =  -7 ]

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

      [
       set pcolor pink
       ]


  ;=============================table 6================================================
  ask patches with [pxcor >  -7 and pxcor < -3 and pycor =  -9 ]

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

      [
       set pcolor black
       ]

  ; ==============================Charir 6 ====================================
   ask patches with [pxcor >  -7 and pxcor < -3 and pycor =  -7 ]

      [
       set pcolor black
       ]
       ; downside chairs-----------------------------------------------------
  ask patches with [pxcor >  -7 and pxcor < -3 and pycor =  -12 ]

      [
       set pcolor black
       ]


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

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

      [
       set pcolor brown
       ]
  ;==========================Chair 7 ==========================================
   ask patches with [pxcor >  1 and pxcor < 5 and pycor =  -7 ]

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

      [
       set pcolor brown
       ]

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

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

      [
       set pcolor blue
       ]
;=================================Chair 8 ======================================
  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -7 ]

      [
       set pcolor blue
       ]
       ; downside chairs-----------------------------------------------------
  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -12 ]

      [
       set pcolor blue
       ]
end 


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

Attached files

File Type Description Last updated
Bahria_Cafe_Model_V3_Aamir_Sultan.png preview Preview for 'Bahria_Cafe_Model_V3_Aamir_Sultan' over 6 years ago, by aamir sultan Download

This model does not have any ancestors.

This model does not have any descendants.