Blood type

Jump to: navigation, search

This page contains a research report representing semestral project for 4IT495 Simulation of Systems class (WS 2012/2013).

  • Project name: Blood type
  • Class: 4IT495 Simulation of Systems (WS 2012/2013)
  • Author: Marta Machová
  • Model type: Agent-based simulation
  • Software used: NetLogo 5.0.1

Problem definition

Importance of blood group system

Blood type is property of blood, that is most important for blood donation. The exact blood group of recipient need the same blood group or group, that is acceptable. Its the reason, why number of each blood group representatives is so important information for transfusion department. Transfusion can save ones life it can also kill, when is incompatible group given to recipient.

Another important reason why to explore blood group is, that it says ways of migration of human tribes because blood group was evolving in time, the first was established the "0" type without any antigens (antibody generator) and in evolution of human race was developing according to changing of enviromental conditions. So its important also for anthropology because it answer few questions of human (or race) origin.

The way of formation blood type

The type of blood is inherited by parents. But child don't inherits blood group from one of parents, but in fact, it interits one of allele from mother and one of allele from father. Two alleles together give rice to exact group. The blood-type-creation principle is shown in model.


In model, there is used the method of multi-agent simulation. The reason of this choice is, that each agent have some properties and behavior, that makes the system very complex and hard to describe upper-level behavior. So multiagent simulation is suitable because of unpreddictable global progress.


Description of agents, procedures and interface


Dynamics of model is based on actions of two kinds of "Turtle" agent. Man and woman.



  • name: Man
  • shape: person
  • colour: blue
  • label: blood type
  • paremetres: first and second allele, blood type, father, mother, age, max-age



  • name: woman
  • shape: person
  • colour: red
  • label: blood type
  • paremetres: first and second allele, blood type, father, mother, age, max-age, children (number of children)



  • is all cleared and reset number of ticks
  • all the alleles are set to one of type: A, B, 0
  • is created number of men and women that user chosen (on sliders)
  • to men and women is set the default colour, women are set the number of children = 0
  • all agent are given the default shape and the two allele, the blood type is computed
  • age is set to 0 and maximal age is set by choice of user


  • all turtles are moving radomly
  • men are calling procedure reproduce
  • each tick increase the age of all the turtles
  • each tick are dying turtles, that are older or same aged as parameter max-age

Computing of blood type

There is 9 possible combinations of alleles: 00, 0A, A0, 0B, B0, AA, BB, AB, BA that are divided into 4 blood type:

  • 0: first and second alleles are 0, the chance of creating 0 blood type is 1/9
  • A: possible combinations: A0, 0A, AA, the chance of creating A blood type is 3/9
  • B: possible combinations: B0, 0B, BB, the chance of creating B blood type is 3/9
  • AB: first and second alleles have to be AB or BA, chance is 2/9


  • if man's age is between "man-child-from" and "man-child-to" then find woman on the same patch and
    • if the woman is at reproductive age=age between "woman-child-from" and "woman-child-to" and
      • if the woman has less then women-max-children (set by user) than
        • with probability "reproduce-probability" (chosen by user) born a child
  • child inherits one random allele from mother and one random allele from father
  • child is man with probability set by user man-born-probability


Interface of model in Netlogo


Sliders xmacm45.png

  • men-count: user is choosing initial number of men
  • women-count: user is choosing initial number of women
  • reproduce-probability: user choose probability of born child, when man and woman meets
  • man-born-probability: user choose preference of ratio new-born men/women
  • women-max-children: choosing maximal number of children women could give birth to
  • average-age-ticks: choosing of average age

Input boxes

Input-box xmacm45.png

  • man-child-from: user write down the minimal age range when man could have a child
  • man-child-to: user write down the maximal age range when man could have a child
  • woman-child-from: user write down the minimal age range when woman could have a child
  • woman-child-to: user write down the maximal age range when woman could have a child


Buttons xmacm45.PNG

  • setup: runs procedure setup, described in section Procedures
  • go once: runs simulation for one tick
  • go: runs simulation, described in section Procedures


Monitors xmacm45.PNG

  • 0: sum of all agents that have blood group 0
  • A: sum of all agents that have blood group A
  • B: sum of all agents that have blood group B
  • AB:sum of all agents that have blood group AB
  • Population: total number of agents
  • 0%: percentage of all agents that have blood group 0
  • A%: percentage of all agents that have blood group A
  • B%: percentage of all agents that have blood group B
  • AB%:percentage of all agents that have blood group AB


Plot xmacm45.PNG

  • ratio men/women
    • men-count: number of men
    • women-count: number of women
    • time: number of ticks

Plot xmacm45b.PNG

  • blood-type
    • 0: number of 0 type
    • A: number of A type
    • B: number of B type
    • AB: number of AB type


Environment xmacm45.PNG

  • environment: agents behave upon procedures that are run by GO procedure - moving, reproducing and dying, agents have labels with name of blood group


results of simulations

According to ratio new-born men/women in Czech republic, setting of ratio will be default 49%(men)/51%(women). In Czech republic, there is this distribution of blood group:

  • 0: 30-35%
  • A: 45%
  • B: 15-20%
  • AB: 5-7%

so, distribution of alleles is:

  • 0: 70-78,3%
  • A: 50-52%
  • B: 20-27%

the default parameters:

  • men-count: 485
  • women-count: 504
  • reproduce-probavility: 70
  • man-born-probability: 49
  • woman-max-children: 2
  • average-age-ticks: 64
  • xx-child-from: 15
  • man child-to: 100
  • woman-child-to: 40

5 cycles was run, each cycle stopped 9times to check all the values. The enter and final values of blood-type were:

  • "0"
    • 32,76 - 31,33
    • 33,46 - 26,96
    • 32,25 - 33,53
    • 32,05 - 32,82
    • 30,73 - 31,37
  • "A"
    • 46,00 - 45,44
    • 46,00 - 53,40
    • 45,60 - 46,65
    • 45,80 - 39,55
    • 45,09 - 48,7
  • "B"
    • 15,26 - 15,06
    • 13,44 - 11,69
    • 14,86 - 13,07
    • 15,87 - 19,16
    • 15,97 - 12,74
  • "AB"
    • 5,96 - 8,15
    • 7,07 - 7,93
    • 7,28 - 6,73
    • 6,20 - 8,40
    • 8,19 - 7,16



I was expecting, because of probability, that in time "0" blood-type will decrease until it disappear or be very low. But I found, that this case maybe can happend in very long time, not only some thousand of ticks. The blood types can evolve in balance. In fact, the percentage of "host" of each blood group seems to be unpredictable.

The model is very simplified, because the blood groups evolutions simulation is very complex and is important to include lots of variables into model. This model shows that in Czech republic, the balance between the groups is very good set and we need not fear to disappear one of groups.


File:Simulation-blood type-xmacm45.nlogo

--Marta Machová 23:22, 13 January 2013 (CET)