First, we are going to create a class, called Mouse, to identify the mouses used in a genetic reseach laboratory. This class will have these variables:
Modify the program developed in the exercise 1 to include a new method to calculate the genealogic history of a mouse.
The genealogic history of a mouse is a vector containing the codes of all its ancestors in the following order:
Then, if we don't know who the mouse parents are, the genealogic history is a vector with only one value, the mouse code.
If we only know who the father and the mother of the mouse are, the genealogic history is a vector with only three values, the mouse code, the father code and the mother code.
In general, the genealogic history of a mouse is calculated mixing the genealogic history of its father with the genealogic history of its mother, taking one value alternatively from each of them.
Write a method, called GenHistory, which returns a vector with the genealogic history of a given mouse.
Include this method in the exercise 1 and test it.
Execution example: filling the hash table with these mouses:
Mouse(m42,Jacinta,white,m31,m32) Mouse(m41,Segundo,white,m31,m32) Mouse(m18,Teresa,white,null,null) Mouse(m17,Apolinar,white,null,null) Mouse(m16,Anastasia,white,null,null) Mouse(m15,Eugenio,white,null,null) Mouse(m14,Maria,white,m01,m02) Mouse(m13,Damian,white,null,null) Mouse(m12,Paula,white,null,null) Mouse(m11,Gabriel,white,null,null) Mouse(m34,Juan,white,m26,m25) Mouse(m33,Pedro,white,m23,m24) Mouse(m32,Laura,white,m23,m24) Mouse(m31,Felipe,white,m21,m22) Mouse(m02,Candida,white,null,null) Mouse(m01,Santiago,white,null,null) Mouse(m27,Fernanda,white,m13,m14) Mouse(m26,Serapio,white,m13,m14) Mouse(m25,Heliodora,white,m11,m12) Mouse(m24,Manuela,white,m17,m18) Mouse(m23,Felix,white,m15,m16) Mouse(m22,Delfina,white,m13,m14) Mouse(m21,Gregorio,white,m11,m12)the genealogic history of m41 must be:
m41, m31, m32, m21, m23, m22, m24, m11, m15, m13, m17, m12, m16, m14, m18, ?, ?, ?, ?, ?, ?, m01, ?, ?, ?, ?, ?, ?, ?, m02