Courses/CS 461/Winter 2006/Nghia Phan/Nghia Phan/Week 2

From CSWiki

Jump to: navigation, search

[edit] Dining Philosophers

1. Emergent phenomenon or property

The emergent phenomenon is that resources (which are the folks in this model) are shared by the philosophers. In computer science, this model represents how resources are being shared by concurrent independent processes, and how deadlock occurs.

2. Rules of agents

Philosophers and folks are agents in this model. Philosophers have three states: thinking, hungry, and eating. Initially, all philosophers are in thinking states, and he/she might eventually become hungry. When a philosopher is hungry, he/she will try to acquire both folks on his/her left and right to start eating. If a philosopher is in eating state and after finish eating, then he/she will release both folks for future uses or to his/her neighbors on left and right.

3. Description of why the rules give rise to the emergent phenomenon or property

Philosophers do not communicate with each others. Thus, they do not know how to share their resources (folks) with their neighbors. The emergent phenomenon occurs when a philosopher is from thinking state and become hungry; he/she then looks for available folks on both left and right. If a folk of one side is not available, a philosopher will wait until that folk is released by his/her neighbor. When both folks are available, a philosopher will pick up and start eating. After finish eating, a philosopher will release the folks which may be used by next hungry neighbor. Deadlock occurs when all philosophers are hungry, and each holds one folk and wait for the next available folk of a neighbor.

[edit] Traffic Basic

1. Emergent phenomenon or property

The emergent phenomenon is how traffic jams occurs without any causes of the particular incidents such as accidents, broken bridges, or etc.

2. Rules of agents

The car slows down if it sees a car close ahead, and it speeds up if it does not see a car ahead.

3. Description of why the rules give rise to the emergent phenomenon or property

The cars are moving in the constant speed, and they will slow down if they see other car close ahead. Eventually, some cars are grouped together, and they will move slowly. Thus, this causes other cars behind them to slow down and forms a traffic jam.

[edit] Party

1. Emergent phenomenon or property

The emergent phenomenon is the formation of certain groups in a particular party.

2. Rules of agents

The partygoers will move to other groups if they are uncomfortable with a higher percentage of people of the opposite sex.

3. Description of why the rules give rise to the emergent phenomenon or property

Each partygoer has a level of tolerance which determines whether he/she is comfortable with a higher percentage of people of the opposite sex. The number of happy partygoers is corresponding with the level of tolerance; the higher level of tolerance will cause the higher number of happy partygoers. Thus, certain groups will be formed in the party in which they are not uniform.