Party Model (Third Level)

No preview image

1 collaborator

Default-person Kaylin Ervay (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 29 times • Downloaded 3 times • Run 0 times
Download the 'Party Model (Third Level)' 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?

This is a model of a cocktail party. The men and women at the party form groups. A party-goer becomes uncomfortable and switches groups if their current group has too many members of the opposite sex. What types of group result?

HOW IT WORKS

The party-goers have a TOLERANCE that defines their comfort level with a group that has members of the opposite sex. If they are in a group that has a higher percentage of people of the opposite sex than their TOLERANCE allows, then they are considered "uncomfortable", and they leave that group to find another group. Movement continues until everyone at the party is "comfortable" with their group.

HOW TO USE IT

The NUMBER slider controls how many people are in the party, and the NUM-GROUPS slider controls how many groups form.

The SETUP button forms random groups. To advance the model one step at a time, use the GO ONCE button. The GO button keeps the model running until everybody is comfortable.

The numbers in the view show the sizes of the groups. White numbers are mixed groups and gray numbers are single-sex groups.

To set the tolerance of the people for the opposite sex, use the TOLERANCE slider. You can move the slider while the model is running. If the TOLERANCE slider is set to 75, then each person will tolerate being in a group with less than or equal to 75% people of the opposite sex.

The NUMBER HAPPY and SINGLE SEX GROUPS plots and monitors show how the party changes over time. NUMBER HAPPY is how many party-goers are happy (that is, comfortable). SINGLE SEX GROUPS shows the number groups containing only men or only women.

THINGS TO NOTICE

At the end of the simulation (when everyone is happy), notice the number of single-sex groups. Are there more than at the start?

THINGS TO TRY

Try varying TOLERANCE. Is there a critical tolerance at which each all groups end up being single-sex? At different tolerance levels, does it take longer or shorter for everyone to become comfortable?

See how many mixed groups (not a single-sex group) you can get.

Using the GO ONCE button, experiment with different tolerances. Watch how one unhappy person can disrupt the stability of other groups.

Is it possible to have an initial grouping such that the party never reaches a stable state? (i.e. the model never stops running)

Observe real parties. Is this model descriptive of real social settings? What tolerance level do real people typically have?

EXTENDING THE MODEL

Add more attributes to the model. Instead of male/female, try a trait that has more than two types, like race or religion. (You might use NetLogo's breeds feature to implement that.)

Allow each breed of person to have their own tolerance.

Complicate the tolerance rules: For example, the tolerance could go up as long as there are at least two of one breed.

Allow groups to subdivide, instead of finding new groups.

Set a maximum group size, so that if there are too many people in the group, they become unhappy.

NETLOGO FEATURES

Most NetLogo models put the origin (0,0) in the center of the world, but here, we have placed the origin near the right edge of the world and most of the patches have negative X coordinates. This simplifies the math for situating the groups.

Horizontal wrapping is enabled, but vertical wrapping is disabled. Thus, the world topology is a "vertical cylinder".

Notice the use of the mod primitive to space out the groups evenly. Setting up the groups in this manner allows for easy movement from group to group.

RELATED MODELS

Segregation

CREDITS AND REFERENCES

This model is based on the work of the pioneering economist Thomas Schelling: Schelling, T. (1978). Micro-motives and Macro-Behavior. New York: Norton.

See also: Resnick, M. & Wilensky, U. (1998). Diving into Complexity: Developing Probabilistic Decentralized Thinking through Role-Playing Activities. Journal of Learning Sciences, Vol. 7, No. 2. http://ccl.northwestern.edu/papers/starpeople/

HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

COPYRIGHT AND LICENSE

Copyright 1997 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

Comments and Questions

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

Click to Run Model

globals [
  group-sites    ;; agentset of patches where groups are located
  boring-groups ;; how many groups are currently single-sex
]

turtles-own [
  happy?         ;; true or false
  my-group-site
  tolerance
]

to setup
  clear-all
  set group-sites patches with [group-site?]
  set-default-shape turtles "person"
  create-turtles number [
    choose-sex                   ;; become a man or a woman
    set size 3                   ;; be easier to see
    set my-group-site one-of group-sites
    move-to my-group-site
    ;; set tolerance random 10

    if (heading = 180)
    [ set tolerance (random (Woman-Tolerance-Mean - 10) + 10) ]

    if (heading = 0)
    [ set tolerance (random (Man-Tolerance-Mean - 50) + 50) ]
  ]


  ask turtles [ update-happiness ]
  count-boring-groups
  update-labels
  ask turtles [ spread-out-vertically ]
  reset-ticks
end 

to go
  if all? turtles [happy?]
    [ stop ]  ;; stop the simulation if everyone is happy
  ask turtles [ move-to my-group-site ]  ;; put all people back to their group sites
  ask turtles [ update-happiness ]
  ask turtles [ leave-if-unhappy ]
  find-new-groups
  update-labels
  count-boring-groups
  ask turtles [
    set my-group-site patch-here
    spread-out-vertically
  ]
  tick
end 

to update-happiness  ;; turtle procedure
  ;; you are happy if the proportion of people of the opposite sex
  ;; does not exceed your tolerance
  let total count turtles-here
  let same count turtles-here with [heading = [heading] of myself]

  let opposite (total - same)
  set happy? ((opposite / total) <= (tolerance / 100))
    ;; Women
  if happy? and (heading = 180)
  [set color 16]
  if not happy? and (heading = 180)
  [set color 117]

  ;; Men
  if happy? and (heading = 0)
  [set color 96]
  if not happy? and (heading = 0)
  [set color 57]
end 

to leave-if-unhappy  ;; turtle procedure
  if not happy? [
    set heading one-of [90 270]  ;; randomly face right or left
    fd 1                         ;; leave old group
  ]
end 

to find-new-groups
  display   ;; force display update so we see animation
  let malcontents turtles with [not member? patch-here group-sites]
  if not any? malcontents [ stop ]
  ask malcontents [ fd 1 ]
  find-new-groups
end 

to-report group-site?  ;; patch procedure
  ;; if your pycor is 0 and your pxcor is where a group should be located,
  ;; then you're a group site.
  ;; In this model (0,0) is near the right edge, so pxcor is usually
  ;; negative.
  ;; first figure out how many patches apart the groups will be
  let group-interval floor (world-width / num-groups)
  report
    ;; all group sites are in the middle row
    (pycor = 0) and
    ;; leave a right margin of one patch, for legibility
    (pxcor <= 0) and
    ;; the distance between groups must divide evenly into
    ;; our pxcor
    (pxcor mod group-interval = 0) and
    ;; finally, make sure we don't wind up with too many groups
    (floor ((- pxcor) / group-interval) < num-groups)
end 

to spread-out-vertically  ;; turtle procedure
  if (color = 16) or (color = 117)
    [ set heading 180 ]  ;; face south
  if (color = 96) or (color = 57)
    [ set heading   0 ]  ;; face north
  fd 4                   ;; leave a gap
  while [any? other turtles-here] [
    if-else can-move? 2 [
      fd 4
    ]
    [ ;; else, if we reached the edge of the screen
      set xcor xcor - 1  ;; take a step to the left
      set ycor 0         ;; and move to the base a new stack
      fd 4
    ]
  ]
end 

to count-boring-groups
  ask group-sites [
    ifelse boring?
      [ set plabel-color gray  ]
      [ set plabel-color white ]
  ]
  set boring-groups count group-sites with [plabel-color = gray]
end 

to-report boring?  ;; patch procedure
  ;; To see whether this group is single sex, we collect the colors
  ;; of the turtles into a list, then remove all the duplicates
  ;; from the list.  If the result is a list with exactly one color
  ;; in it, then the group is single sex.
  report length remove-duplicates ([color] of turtles-here) = 1
end 

to update-labels
  ask group-sites [ set plabel count turtles-here ]
end 

;;;
;;; color procedures
;;;

;; Blue represents male, pink represents female. No stereotypes are meant
;; to be promoted. Simply change the colors right here if you'd like.

to choose-sex  ;; turtle procedure
  set heading one-of [180 0]
end 

to-report woman?  ;; turtle procedure
  report heading = 180
end 


; Copyright 1997 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created 6 months ago by Kaylin Ervay.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.