gtopt::ApertureDropTracker class

Constructors, destructors, conversion operators

ApertureDropTracker(int warn_after = default_sddp_aperture_drop_warn_after) explicit noexcept

Public functions

auto drops_in_iteration(IterationIndex iteration_index) const -> int
auto persistent_count() const -> int
Number of (scene, phase, aperture) triples escalated as persistent.
auto record(SceneUid scene_uid, PhaseUid phase_uid, IterationIndex iteration_index, int n_solves, std::span<const ApertureDrop> drops) -> ApertureDropRecord
auto record(SceneUid scene_uid, PhaseUid phase_uid, IterationIndex iteration_index, std::span<const Uid> dropped_apertures) -> ApertureDropRecord
void reset()
Forget everything (start of a new solve).
auto scene_drops_in_iteration(SceneUid scene_uid, IterationIndex iteration_index) const -> int
auto summary(std::size_t top_n = aperture_summary_top_n) const -> ApertureSummary
End-of-solve statistics.
auto total_drops() const -> int
Total drops recorded over the tracker's lifetime.
auto warn_after() const -> int noexcept

Function documentation

int gtopt::ApertureDropTracker::drops_in_iteration(IterationIndex iteration_index) const

Number of aperture drops recorded for iteration_index, summed over every (scene, phase) cell.

ApertureDropRecord gtopt::ApertureDropTracker::record(SceneUid scene_uid, PhaseUid phase_uid, IterationIndex iteration_index, int n_solves, std::span<const ApertureDrop> drops)

Record one (scene, phase) cell of the backward pass of iteration_index: n_solves aperture LPs were solved and drops of them were dropped. A streak breaks implicitly when an iteration records no drop for the triple; recording the same triple twice in one iteration counts it once.

ApertureDropRecord gtopt::ApertureDropTracker::record(SceneUid scene_uid, PhaseUid phase_uid, IterationIndex iteration_index, std::span<const Uid> dropped_apertures)

Convenience overload: every listed aperture proven infeasible and n_solves = dropped_apertures.size() (unit tests).

int gtopt::ApertureDropTracker::scene_drops_in_iteration(SceneUid scene_uid, IterationIndex iteration_index) const

Number of aperture drops recorded for one scene at iteration_index.