richelbilderbeek / pbdmms

Some models
GNU General Public License v3.0
2 stars 0 forks source link

sado: Fix two "sado_merge_two_species_graph"s #252

Closed Lumphie closed 7 years ago

Lumphie commented 7 years ago

sado_merge_two_species_graph_20 & sado_merge_two_species_graph_21 both add something that can happen in overlapping generations (one of your parents in the same generation as you are and parents having children that are more than one generation away)

Lumphie commented 7 years ago

//Test graph 20 When 2 indivs mate and get 2 kids (generation 0, grandmother with grandfather --> father, mother) one dies (i.e. grandmother is left with father and mother) Grandmother, father and mother go to generation 1. Father becomes species 1 and grandmother + mother become species 2 (reconstructed should be both species 1) Grandmother gets a child (daughter) and father gets a child (son), both go in species 3 (reconstructed 2)

//Test graph 21 Generation 0: Grandfather and grandmother, grandfather gets a child (father) with grandmother, grandfather dies. Generation 1: Grandmother gets a child (mother) and father (son) gets a child. Both die. Generation 2: Mother and son get into one species.

Lumphie commented 7 years ago

Maybe Graph 20 can be fixed if we decide to only look at mother (because the females always die after mating) for inheritance. Fathers don't die and are then able to move in the same species as their children. Not sure if we want that.

Graph 21 gives edges that skips generations, that should just be filtered out when creating a reconstructed tree.

richelbilderbeek commented 7 years ago

There is a mismatch between the ASCII art in the documentation and in the Boost.Graph for graph 20:

screenshot - 03132017 - 10 57 05 am

Lumphie commented 7 years ago

Whoops. Forgot to chance the ascii art there. The png is right.

richelbilderbeek commented 7 years ago

So the correct ASCII would be like below?

  /*

      [3]         [2]
     / | \         | \
    /  |  \        |  \
   |  [1]--[2] -> [1]  |
    \  |  /        |  /
     \ | /         | /
      [0]         [0]
   */
Lumphie commented 7 years ago
  /*

      [3]         [2]
     / | \         | 
    /  |  \        |  
   |  [1]--[2] -> [1]  
    \  |  /        |  
     \ | /         | 
      [0]         [0]
   */
richelbilderbeek commented 7 years ago

Thanks! I'll fix it in the code.

richelbilderbeek commented 7 years ago

In determining the reconstructed tree, if I remove all edges that span multiple generations, the tests will pass.

richelbilderbeek commented 7 years ago

Easier test passes, harder test doesn't yet:

screenshot - 03132017 - 11 53 16 am

Next stop: remove the self-loops :-)

richelbilderbeek commented 7 years ago

@Lumphie : done :sunrise: :rainbow_flag:

Wanna check my work?

Lumphie commented 7 years ago

Looks good