fixed_resolution_algo

Accept linear size complexity to maintain fixed spacing between strata.

The fixed resolution policy ensures estimates of MRCA rank will have uncertainty bounds less than or equal a fixed, absolute user-specified cap that is independent of the number of strata deposited on either column. Thus, MRCA rank estimate uncertainty scales as O(1) with respect to the greater number of strata deposited on either column.

Under the fixed resolution policy, the number of strata retained (i.e., space complexity) scales as O(n) with respect to the number of strata deposited.

Classes

CalcMrcaUncertaintyAbsExact

Functor to provide member function implementation in Policy class.

CalcMrcaUncertaintyAbsUpperBound

Functor to provide member function implementation in Policy class.

CalcMrcaUncertaintyAbsUpperBoundAtPessimalRank

CalcMrcaUncertaintyAbsUpperBoundPessimalRank

Functor to provide member function implementation in Policy class.

CalcMrcaUncertaintyRelExact

CalcMrcaUncertaintyRelUpperBound

Functor to provide member function implementation in Policy class.

CalcMrcaUncertaintyRelUpperBoundAtPessimalRank

CalcMrcaUncertaintyRelUpperBoundPessimalRank

Functor to provide member function implementation in Policy class.

CalcNumStrataRetainedExact

Functor to provide member function implementation in Policy class.

CalcNumStrataRetainedUpperBound

Functor to provide member function implementation in Policy class.

CalcRankAtColumnIndex

Functor to provide member function implementation in Policy class.

GenDropRanks

Functor to implement the fixed resolution stratum retention policy, for use with HereditaryStratigraphicColumn.

IterRetainedRanks

Functor to provide member function implementation in Policy class.

Policy

Instantiate policy implementation for particular policy specification parameters.

PolicySpec

Contains all policy parameters, if any.

class CalcMrcaUncertaintyAbsExact

Functor to provide member function implementation in Policy class.

__call__(policy: PolicyCouplerBase, 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

Functor to provide member function implementation in Policy class.

__call__(policy: PolicyCouplerBase, first_num_strata_deposited: int, second_num_strata_deposited: int, actual_rank_of_mrca: int) int[source]

At most, how much absolute uncertainty to estimate rank of MRCA? Inclusive.

__init__(policy_spec: PolicySpec | None) None[source]
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

Functor to provide member function implementation in Policy class.

__call__(policy: PolicyCouplerBase, first_num_strata_deposited: int, second_num_strata_deposited: int, actual_rank_of_mrca: int) float[source]

At most, how much relative uncertainty to estimate rank of MRCA? Inclusive.

__init__(policy_spec: PolicySpec | None) None[source]
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, 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, 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, index: int, num_strata_deposited: int) 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 fixed resolution stratum retention policy, for use with HereditaryStratigraphicColumn.

This functor enacts the fixed 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, 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

fixed_resolution_algo:

For details on the rationale, implementation, and guarantees of the fixed 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, 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.

static GetAlgoIdentifier() str[source]

Get programatic name for underlying retention algorithm.

static GetAlgoTitle() str[source]

Get human-readable name for underlying retention algorithm.

GetEvalCtor() str[source]
GetFixedResolution() int[source]
__init__(fixed_resolution: int)[source]

Construct the policy spec.

Parameters

fixed_resolutionint

The rank interval strata should be retained at. The uncertainty of MRCA estimates provided under the fixed resolution policy will always be strictly less than this cap.

__repr__() str[source]

Return repr(self).

__str__() str[source]

Return str(self).