Class DynasticCalculator
java.lang.Object
org.episteme.natural.biology.DynasticCalculator
Calculates consanguinity coefficients, inbreeding, and models dynastic succession.
Provides tools for genealogical analysis of historical dynasties.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a person within a dynastic lineage.static enumGender for dynastic succession priority logic. -
Method Summary
Modifier and TypeMethodDescriptionstatic RealCalculates the Wright's coefficient of inbreeding (F) for a person.static RealcalculateRelationshipCoefficient(DynasticCalculator.DynasticPerson a, DynasticCalculator.DynasticPerson b) Calculates the coefficient of relationship (r) between two individuals.calculateSuccessionOrder(DynasticCalculator.DynasticPerson monarch, boolean malePriority) Calculates the order of succession based on primogeniture.
-
Method Details
-
calculateInbreedingCoefficient
Calculates the Wright's coefficient of inbreeding (F) for a person. Formula: F = Σ (1/2)^(n1+n2+1) × (1 + FA)- Parameters:
person- the person to calculate for- Returns:
- inbreeding coefficient as a
Realnumber - Throws:
NullPointerException- if person is null
-
calculateRelationshipCoefficient
public static Real calculateRelationshipCoefficient(DynasticCalculator.DynasticPerson a, DynasticCalculator.DynasticPerson b) Calculates the coefficient of relationship (r) between two individuals.- Parameters:
a- first personb- second person- Returns:
- relationship coefficient as a
Realnumber - Throws:
NullPointerException- if a or b is null
-
calculateSuccessionOrder
public static List<DynasticCalculator.DynasticPerson> calculateSuccessionOrder(DynasticCalculator.DynasticPerson monarch, boolean malePriority) Calculates the order of succession based on primogeniture.- Parameters:
monarch- current holder of the titlemalePriority- if true, males take priority over females (Salic/Semi-Salic law)- Returns:
- unmodifiable ordered list of successors
- Throws:
NullPointerException- if monarch is null
-