BahriaUmodelV3

BahriaUmodelV3 preview image

1 collaborator

Default-person Kashif Khan (Author)

Tags

cosmose 

Tagged by Kashif Khan almost 6 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.3 • Viewed 227 times • Downloaded 15 times • Run 0 times
Download the 'BahriaUmodelV3' 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 [ Girls Boys waiting-time ]

to setup
  clear-all
 draw-walls
door

  createserver
  createwaiter
  createfish
  ask patches [ setup-tables setup-chairs]  ;; create a blank background

  create-turtles initial-students [
     set shape "person"
    set size 2
    move-to one-of patches

    setxy random-xcor random-ycor

    if (Gender = "Girls")     [ set color blue ]
    if (Gender = "Boys")  [ set color red ]
    if (Gender = "mixed")     [ set color one-of [ red blue ] ]

    set Girls one-of other turtles
    set Boys one-of other turtles
  ]
  reset-ticks
end 

to createfish
create-turtles 3 [
     set shape "fish"
    set size 2
    set color gray
   ; setxy -11 10
  ]
end 

to movefish
  ask turtles with [ color = gray ][
  move-to one-of patches with [pcolor = red ]
  ]
end 

to createserver
 create-turtles 3 [
     set shape "person"
    set size 2
    set color green
    set label "server"
    setxy -11 14

  ]
end 

to moveserver
  ask turtles with [ color = green ][
  move-to one-of patches with [pcolor = orange ]
  ]
end 

to createwaiter
 create-turtles 3 [
     set shape "person"
    set size 2
    set color white
    set label "waiter"
    setxy -11 14

  ]
end 

to movewaiter
  ask turtles with [ color = white ][
  move-to one-of patches with [pcolor = red ]
  ]
end 

to go
  ask turtles [
    if (color = blue)  [ Girls-set ]
    if (color = red)   [ boys-set ]
     fd 0.1
  ]
  moveserver
  movewaiter
  movefish
  tick
end 

to Girls-set

set label "Girls"
     move-to one-of patches with [pcolor = yellow ]
   set waiting-time waiting-time - 1
wait waiting-tim
if ticks >= 5000

  [stop]
end 

to boys-set
  set label "Boys"
move-to one-of patches with [pcolor = blue ]
wait waiting-tim
 set waiting-time waiting-time - 1
  if ticks >= 5000

  [stop]
end 

to preset [ seed ]
  set Gender "mixed"
  set initial-students initial-students
  random-seed seed
  setup
end 

to setup-tables

  let x pxcor
  let y pycor



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

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


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

      [
       set pcolor pink
       ]




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

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

      [
       set pcolor red
       ]

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

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

      [
       set pcolor red
       ]


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

      [
       set pcolor red
       ]
  ask patches with [pxcor >  5 and pxcor < 9 and pycor =  0 ]

      [
       set pcolor red
       ]

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

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

      [
       set pcolor red
       ]

  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -9 ]

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

      [
       set pcolor red
       ]

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

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

      [
       set pcolor red
       ]

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

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

      [
       set pcolor red
       ]

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

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

      [
       set pcolor red
       ]
end 

to setup-chairs


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

      [
       set pcolor blue
       ]

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

      [
       set pcolor yellow
       ]


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

      [
       set pcolor blue
       ]

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

      [
       set pcolor yellow
       ]

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

      [
       set pcolor blue
       ]

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

      [
       set pcolor yellow
       ]

  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 yellow
       ]

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

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  -3 and pxcor < 1 and pycor =  -12 ]

      [
       set pcolor yellow
       ]

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

      [
       set pcolor blue
       ]

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

      [
       set pcolor yellow
       ]

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

      [
       set pcolor blue
       ]

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

      [
       set pcolor yellow
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -7 ]

      [
       set pcolor blue
       ]

  ask patches with [pxcor >  9 and pxcor < 13 and pycor =  -12 ]

      [
       set pcolor yellow
       ]

;  ask patches with [pxcor >  -15 and pxcor < -4 and pycor =  15 ]
 ; [
 ; set pcolor orange
 ; ]
end 

to draw-walls
  ask patches with [abs pxcor = max-pxcor]
    [ set pcolor pink ]
  ask patches with [abs pycor = max-pycor]
    [ set pcolor pink ]
end 

to door

   ask patches with [pxcor >  -3 and pxcor = -3 and pycor =  16 ]

      [
       set pcolor white
       ]
  ask patches with [pxcor >  -2  and pycor =  16 ]

      [
       set pcolor pink
       ]
end 

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

Attached files

File Type Description Last updated
BahriaUmodelV3.png preview Preview for 'BahriaUmodelV3' almost 6 years ago, by Kashif Khan Download

This model does not have any ancestors.

This model does not have any descendants.