Student_Cafe V3
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
patches-own [ table-number ;; number (1, 2, or 3) to identify the food sources ] turtles-own [fwd Ma Fe num i head waiting waits lab x y a b ] breed [male maless] breed [female femaless] breed [waiter waiters] breed [servant servants] to setup clear-all create-female females [ set shape "person" set color blue setxy 2 -10 set label waits set heading 0 set fwd 1 ] ;;students create-male males [ set shape "person" set label waits set color red set heading 0 setxy -1 -10 set fwd 1 ] create-waiter 1[ set shape "person service" setxy 0 11 set heading 180 set color white ] create-servant 2[ set shape "person" setxy random-xcor random-ycor set size 2 set color white ] ask patches[ setup-table recolor-patch ] ask turtles[ set num 0 set i 19 set head 0 set waits 0 set Fe 0 set Ma 0 set x 8.37 set y 7.99999999999997 set a -8.37 set b 7.99999999999997 ] reset-ticks end to go ask turtles[ if i = 3 [ set i 19 ] ] ask turtles[ if Fe >= 8 [stop] if num < 8[ ask turtle num [ while [fwd < i][ fd 0.1 set fwd fwd + 0.1 ] ;set num num - 1 if num < 4 [ set heading 90 ] if num > 4 and num < 8 [ set heading -90] ] set num num + 1 set i i - 4 ] if num >= 8 [ if head < 8 [ ask turtle head [ fd 0.67 ] set head head + 1 ] ] ] ask turtles[ if head >= 8 [ ask turtle 9 [ setxy x y set label "Getting Order" setxy 0 11 set label "Giving Order" set y y - 3 ] ask turtle 10 [ setxy a b set label "Getting Order" setxy 0 11 set label "Giving Order" set b b - 3 ] ] ] ;ask servant [ ; rt one-of [-90 0 90] ;; go left, straight, or right ; forward 1 ;;; set heading ((random 4) * 90) ;;; fd 0.1 ; ] ; ;----------------------------------------------------------------------------------- ; set waiting random 100 ; ;if head >= 8[ ; ; if Fe < 8 ; [ ; ; ask turtle Fe ; [ ; ; ; ; ; ; while [waiting != waits ] ; [ ; set waits waits + 1 ; set label waits ; if waits = waiting ; [ ; set lab waits ; set label lab ; set heading 180 ; set Ma Ma + lab ; fd 4 ; ] ; ] ; ; set waits 0 ; ; ; ; ; ] ; set Fe Fe + 1 ; ] ; ; ; ] end to move-turtle ; if M > 3 and M <= 7[ ; ask turtle M ; ; [ ; if head >= 8[ ; ; if label != "0"[ ; set waiting random 100 ; ] ; set waits 0 ; while [waiting != waits ] ; [ ; set waits waits + 1 ; set label waits ; if waits = waiting ; [ ; die ; ] ; ] ; set M M + 1 ; ] ; ; ] ; ] end to setup-table ;; patch procedure if (distancexy ( 0 * max-pxcor) 12) < 2 [ set pcolor Blue ] ;; setup Table one on the right if (distancexy (0.6 * max-pxcor) 0) < 0.6 [ set table-number 1 set pcolor yellow ] if (distancexy (0.6 * max-pxcor) 4) < 0.6 [ set table-number 2 set pcolor yellow ] if (distancexy (0.6 * max-pxcor) 8) < 0.6 [ set table-number 3 ] if (distancexy (0.6 * max-pxcor) -4) < 0.6 [ set table-number 4 set pcolor yellow ] if (distancexy (-0.6 * max-pxcor) 0) < 0.6 [ set table-number 5 set pcolor yellow] if (distancexy (-0.6 * max-pxcor) 4) < 0.6 [ set table-number 6 set pcolor yellow] if (distancexy (-0.6 * max-pxcor) 8) < 0.6 [ set table-number 7 set pcolor yellow] if (distancexy (-0.6 * max-pxcor) -4) < 0.6 [ set table-number 1 ] end to recolor-patch ;; patch procedure ;; give color to nest and food sources if table-number = 1 [ set pcolor yellow ] if table-number = 2 [ set pcolor yellow ] if table-number = 3 [ set pcolor yellow ] ;; scale color to show chemical concentration end
There is only one version of this model, created over 7 years ago by Muhammad Karim.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Student_Cafe V3.png | preview | Preview for 'Student_Cafe V3' | over 7 years ago, by Muhammad Karim | Download |
This model does not have any ancestors.
This model does not have any descendants.