nominal_resolution_algo
Retain as few strata as possible.
The nominal resolution policy only retains the most ancient (i.e., very first) and most recent (i.e., last) strata. So, comparisons between two columns under this policy will only be able to detect whether they share any common ancestor and whether they are from the same organism (i.e., no generations have elapsed since the MRCA). Thus, MRCA rank estimate uncertainty scales as O(n) with respect to the greater number of strata deposited on either column.
Under the nominal resolution policy, the number of strata retained (i.e., space complexity) scales as O(1) with respect to the number of strata deposited.
Classes
Functor to provide member function implementation in Policy class. |
|
Functor to provide member function implementation in Policy class. |
|
Functor to provide member function implementation in Policy class. |
|
Functor to provide member function implementation in Policy class. |
|
Functor to provide member function implementation in Policy class. |
|
Functor to provide member function implementation in Policy class. |
|
Functor to implement the nominal resolution stratum retention policy, for use with HereditaryStratigraphicColumn. |
|
Functor to provide member function implementation in Policy class. |
|
Instantiate policy implementation for particular policy specification parameters. |
|
Contains all policy parameters, if any. |
- class CalcMrcaUncertaintyAbsExact
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase | None, first_num_strata_deposited: int, second_num_strata_deposited: int, actual_rank_of_mrca: int) int [source]
Exactly how much uncertainty to estimate rank of MRCA?
- __init__(policy_spec: PolicySpec | None) None [source]
- class CalcMrcaUncertaintyAbsUpperBound
- class CalcMrcaUncertaintyAbsUpperBoundAtPessimalRank
- class CalcMrcaUncertaintyAbsUpperBoundPessimalRank
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase, first_num_strata_deposited: int | None, second_num_strata_deposited: int | None) int [source]
Calculate rank for which upper bound on absolute MRCA uncertainty is pessimized.
- __init__(policy_spec: PolicySpec | None) None [source]
- class CalcMrcaUncertaintyRelExact
- class CalcMrcaUncertaintyRelUpperBound
- class CalcMrcaUncertaintyRelUpperBoundAtPessimalRank
- class CalcMrcaUncertaintyRelUpperBoundPessimalRank
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase, first_num_strata_deposited: int, second_num_strata_deposited: int) int [source]
Calculate rank for which upper bound on relative MRCA uncertainty is pessimized.
- __init__(policy_spec: PolicySpec | None) None [source]
- class CalcNumStrataRetainedExact
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase | None, num_strata_deposited: int) int [source]
Exactly how many strata are retained after n deposited?
- __init__(policy_spec: PolicySpec | None) None [source]
- class CalcNumStrataRetainedUpperBound
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase | None, num_strata_deposited: int) int [source]
At most, how many strata are retained after n deposited? Inclusive.
- __init__(policy_spec: PolicySpec | None = None) None [source]
- class CalcRankAtColumnIndex
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase | None, index: int, num_strata_deposited: int | None) int [source]
After n strata have been deposited, what will the rank of the stratum at column index k be?
Enables a HereditaryStratigraphicColumn using this predicate to optimize away storage of rank annotations on strata. Takes into the account the possibility for in-progress stratum depositions that haven’t been reflected in num_strata_deposited.
- __init__(policy_spec: PolicySpec | None) None [source]
- class GenDropRanks
Functor to implement the nominal resolution stratum retention policy, for use with HereditaryStratigraphicColumn.
This functor enacts the nominal resolution policy by specifying the set of strata ranks that should be purged from a hereditary stratigraphic column when the nth stratum is deposited.
- __call__(policy: PolicyCouplerBase | None, num_stratum_depositions_completed: int, retained_ranks: Iterable[int] | None) Iterator[int] [source]
Decide which strata within the stratagraphic column should be purged.
Every time a new stratum is deposited, this method is called to determine which strata should be purged. All strata at ranks yielded from this functor are immediately purged from the column, meaning that for a stratum to persist it must not be yielded by this functor each and every time a new stratum is deposited.
Parameters
- policy: Policy
Policy this functor enacts.
- num_stratum_depositions_completedint
The number of strata that have already been deposited, not including the latest stratum being deposited which prompted the current purge operation.
- retained_ranksiterator over int
An iterator over ranks of strata currently retained within the hereditary stratigraphic column. Not used in this functor.
Returns
- iterator over int
The ranks of strata that should be purged from the hereditary
stratigraphic column at this deposition step.
See Also
- nominal_resolution_algo:
For details on the rationale, implementation, and guarantees of the nominal resolution stratum retention policy.
- __init__(policy_spec: PolicySpec | None) None [source]
- class IterRetainedRanks
Functor to provide member function implementation in Policy class.
- __call__(policy: PolicyCouplerBase | None, num_strata_deposited: int) Iterator[int] [source]
Iterate over retained strata ranks at num_strata_deposited in ascending order.
- __init__(policy_spec: PolicySpec | None) None [source]
- class Policy
Instantiate policy implementation for particular policy specification parameters.
- GetEvalCtor() str
- GetSpec() PolicySpec
Get policy’s parameter specification.
- WithoutCalcRankAtColumnIndex() PolicyCoupler
Make a copy of this policy instance with CalcRankAtColumnIndex disabled.
Useful to prevent optimization-out of strata rank number storage in a stratum ordered store backing a hereditary stratigraphic column.
- __init__(*args, parameterizer: Callable[[Type], PolicySpecBase | None] | None = None, policy_spec: PolicySpecBase | None = None, **kwargs)
Construct a PolicyCoupler instance.
If policy_spec is not provided, all arguments are forwarded to policy spec initializer.
- __repr__() str
Return repr(self).
- __str__() str
Return str(self).
- policy_spec_t
alias of
PolicySpec
- CalcMrcaUncertaintyAbsUpperBound: Callable
- CalcMrcaUncertaintyAbsUpperBoundPessimalRank: Callable
- CalcMrcaUncertaintyAbsUpperBoundAtPessimalRank: Callable
- CalcMrcaUncertaintyRelUpperBound: Callable
- CalcMrcaUncertaintyRelUpperBoundAtPessimalRank: Callable
- CalcMrcaUncertaintyRelUpperBoundPessimalRank: Callable
- CalcNumStrataRetainedUpperBound: Callable
- CalcMrcaUncertaintyAbsExact: Callable | None
- CalcMrcaUncertaintyRelExact: Callable | None
- CalcNumStrataRetainedExact: Callable | None
- CalcRankAtColumnIndex: Callable | None
- IterRetainedRanks: Callable | None
- GenDropRanks: Callable
- class PolicySpec
Contains all policy parameters, if any.