Class LineageGraph
java.lang.Object
org.episteme.natural.biology.genealogy.LineageGraph
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLink(Individual from, Individual to) Adds a lineage link (e.g., Parent to Child, Predecessor to Successor).getDescendants(Individual individual) Finds all descendants of an individual in this graph using Depth-First Search.
-
Constructor Details
-
LineageGraph
public LineageGraph()
-
-
Method Details
-
addLink
Adds a lineage link (e.g., Parent to Child, Predecessor to Successor).- Parameters:
from- the source individualto- the target individual- Throws:
NullPointerException- if from or to is null
-
getDescendants
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
-