Banner
KH-Model with Replacement


KH-Model with Replacement

Spring 2017

PSC/ANB 290


We have a working KH-model that does everything in the original model and, in addition, we can change various parameter values. Before we investigate it systematically, let’s add a feature to the KH-model that require a minimal amount of new code:  replacement.

 

One way in which the KH-model is unrealistic is that there is only a finite population of male and female agents, which all start out with the same dating experience. As they pair off, the population empties out, but is this like real life? No. New people are always entering or re-entering the dating pool, so it would be a step towards a more realistic model to include replacement.

 

How to Extend the KH Model to Include  Replacement

To do this, you will need to add an option for replacement with get and set methods.  Next, write a method in Agent creates a new datable agent of a given sex:

     public void replicate (Environment state, boolean gender){
       //Your code here
	}

Hint:It requires only a couple of lines of code by using a method for finding a location in the Environment.

You can then modify “findLocalDate” and “findDate” methods by introducing the replicate method into a conditional statement.

   if(replacement){
    //add your code here
    //Line #1 for females
    //Line #2 for males
   }

 

Preliminary Analysis of the Model

Try out different parameters values, record the parameter values and setting together with the resulting correlation values.  For both rules do the following:  Use the script to investigate different parameter combinations.  For example, consider the different combinations below:

1. Try at least the following choosiness  values: 1, 2, and 3.

2. Try at least the following MaxDates (maximum dates at which an agent chooses anything) values:   10, 50, 100, 10,000

3. Try at least the following maxAttractivenss (maximum attractiveness) values:  2, 5, 10, 100

4. Try at least the following population sizes for males and females:  100, 500, 1000, 2000

5. Use, for example, Excel to create graphs of your results.