NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)


This is a modified version of 'Party' in the Models Library. It is a model of a cocktail party, where 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?


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.


The NUMBER slider controls how many people are in the party, and the NUM-GROUPS slider controls how many groups they form. The seek_mixed_group on/off button controls people actively seeking mixed sex groups. When on, persons with tolerance level greater than 50 seek mixed groups (see below).

The SETUP button creates 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 middle row of the view show the sizes of the groups. White numbers are mixed groups and gray numbers are single-sex groups. The tolerance level of a person is indicated by a number next to that person.

The tolerance level of each person for the opposite sex is set randomly between 20 and 80 in increments of 10. If the tolerance level of a person is 20 then that person will tolerate being in a group with less than or equal to 20% of the opposite sex. Similarly, a person with tolerance level of 80 will tolerate being in a group with less than or equal to 80% of the opposite sex.

The simulation may be run with seek_mixed_group button off. Then a person is happy when the number of persons of opposite sex in the group is less than or equal to his/her tolerance level.

When the seek_mixed_group button is on then a person is happy not only when the number of persons of opposite sex in the group is less than or equal to his/her tolerance level but also greater than his/her tolerance level less 50. Thus if a person's tolerance level is 70 then he/she will tolerate a group with less than or equal to 70% and greater than or equal to 20% of members of 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.


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

Notice the big difference in the average results when seek_mixed_group switch is set on or off. That indicates that a little bit of affirmative action may lead to a significant change in the outcome.


Try a number of runs with seek_mixed_group off. Add the number of people in single and mixed sex groups and calculate the average proportions.

Try the same number of runs with seek_mixed_group on. Again, add the number of people in single and mixed sex groups and calculate the average proportions. Notice the difference in the average results between the two sets of results. Also, notice that it takes longer for everyone to get comfortable when the seek_mixed_group is on.

Sometimes, the simulation does not stop running when seek_mixed_group is on, the number happy curve shows continuous oscillation. Then terminate the run by pressing the go button and ignore the results of that run and try another.

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


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 is 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.


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.




The model is an updated version of a model called Party. The original model is the creation of U. Welensky which was modified by Asish Ghosh

The original 'Party' 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.

(back to the NetLogo User Community Models)