SeedCommitmentRule class final
#include <gtopt/domain_rules.hpp>
External-commitment seed rule: overwrite each commitment unit's status (u) with a value from an externally-supplied SeedCommitmentMap, matched by the semantic (generator uid, block uid) key. Units / blocks absent from the seed are left at their rounded-relaxation value, so a partial seed (only the elements that exist in both the source solution and this case) is fine — the "existing elements" semantics. Registered FIRST in the pipeline so the downstream rules repair FROM the seed: CommitmentLogicRule regenerates consistent v/w and MinUpDownRule mends run-lengths. A strategy (previous- day PLEXOS / gtopt, nearest-historical, ML) is just a producer of the map; this rule is the single generic consumer.
Base classes
- class DomainRule
Constructors, destructors, conversion operators
- SeedCommitmentRule(SeedCommitmentMap seed) explicit
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:: SeedCommitmentRule:: 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;