Class LineageGraph

java.lang.Object
org.episteme.natural.biology.genealogy.LineageGraph
All Implemented Interfaces:
Serializable

public final class LineageGraph extends Object implements Serializable
Directed graph structure for biological lineages and successions. Useful for modeling dynastic successions, family trees, or evolutionary paths.
Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • LineageGraph

      public LineageGraph()
  • Method Details

    • addLink

      public void addLink(Individual from, Individual to)
      Adds a lineage link (e.g., Parent to Child, Predecessor to Successor).
      Parameters:
      from - the source individual
      to - the target individual
      Throws:
      NullPointerException - if from or to is null
    • getDescendants

      public Set<Individual> getDescendants(Individual individual)
      Finds all descendants of an individual in this graph using Depth-First Search. Note: This is separate from the biological descendants stored within the Individual objects themselves, allowing for specialized lineage graphs (e.g. only royal successions).
      Parameters:
      individual - the starting individual
      Returns:
      a set of descendants
      Throws:
      NullPointerException - if individual is null