This week I focused on implementing
death by old age into my community simulation. This is very necessary
to implement future additions to the simulation, such as events and
emotions.
To begin with I looked up some
information on the annual chance of death in the UK. This would give
me a good basis to start with.
Looking at the data I had a few
choices. I could either implement the statistics as a simple lookup
table, or I could use an equation which somewhat matched the relation
of age and death chance. Then I would be able to work out a death
chance using age as the input. The second choice is more desirable,
but I chose the first method because it would be quicker to do and
therefore give me more time to experiment. Later in this project I
will consider using an equation instead, as it would give me more
flexibility in the long run.
Below you can see how I implemented a very simple look-up table in Netlogo for representing the random chance of death. This is limited in a number of ways, and not very flexible, as I mentioned earlier. Using an exponential equation with a number of parameters will certain make it more interesting, but for the time being this will do.
if gender = "m"[if age <= 4[set rand random(4386)]if age > 4 and age <= 14[set rand random(8333)]if age > 14 and age <= 24[set rand random(1908)]if age > 24 and age <= 34[set rand random(1215)]if age > 34 and age <= 44[set rand random(663)]if age > 44 and age <= 54[set rand random(279)]if age > 54 and age <= 64[set rand random(112)]if age > 64 and age <= 74[set rand random(42)]if age > 74 and age <= 84[set rand random(15)]if age >= 85[set rand random(6)]]
For the annual chance of death I used some real-world statistics from the National Statistics series in the UK. Each year a random number is generated for each person, based on their age and gender corresponding to the statistics it it determined if they die of natural circumstances or not. Future additions to the simulation may include diseases, which may also be hereditary. However this could be another simulation entirely, so it isn't very important for the time being.
For death to work as expected, the
simulation is required to perform a “death-clean-up” procedure
whenever a person dies. This forces the person to remove any partners
they were with if they were married, so the other partner can remarry
as a widow or a widower. It also removes them from any occupations if
they are employed, this “death event” is then added to the
person’s job history. As further changes are made to the simulation the "death-clean-up" procedure will be updated to effect the emotions of any people who know or are related to the dead person.
Reference: http://www.medicine.ox.ac.uk/bandolier/booth/Risk/dyingage.html
No comments:
Post a Comment