gtopt::PeakInjectionRule class final

Peak-injection bias rule: seed storage / hydro injection units to inject (discharge / generate) during peak hours. For each PeakInjectionInfo unit, on every block flagged is_peak, set the unit's status (u) column ON (1.0) when the rounded candidate has it OFF/ambiguous (< 0.5).

CONSERVATIVE POLICY — this rule only ever flips a status binary toward ON, and only at peak blocks: it never turns a committed unit OFF and never touches off-peak blocks. So it cannot override a decisive LP-relaxation signal to keep a unit committed; it only nudges idle-but-available storage to be online when the system is most stressed. The MIP then validates and re-optimizes the seed, so a wrong nudge costs at most a little branch-and-cut work, never correctness. ON BY DEFAULT — the SystemLP::resolve hook populates ctx.injections unless mip_start.peak_injection is explicitly set false; an empty ctx.injections ⇒ no-op, exactly like MinUpDownRule skips units without run-length limits.

Base classes

class DomainRule

Public functions

auto apply(std::span<double> values, const DomainRuleContext& ctx) const -> int override
auto name() const -> std::string_view override noexcept

Function documentation

int gtopt::PeakInjectionRule::apply(std::span<double> values, const DomainRuleContext& ctx) const override

Returns the number of column values flipped (0 = the rule found nothing to fix).

Adjust values in place;