constraint_directive.hpp file
Typed metadata directive attached to a UserConstraint.
A ConstraintDirective is the typed-schema replacement for the legacy name-regex / expression-substring classification that lived in the plexos2gtopt converter (_RegRange_, Gas_MaxOpDay\d+_, count("reserve_provision(") >= 2…) and the hardcoded soft-penalty ladder (_RESERVE_PROVISION_SUM_PENALTY = 1000, _FUEL_OFFTAKE_PENALTY, …) that decided the policy in Python. By moving the classification onto the constraint itself, the policy is auditable in the emitted JSON, can be overridden per-bundle without code changes, and the converter side collapses to "tag the directive at construction time and forget about it".
Step 1 of the AMPL/PAMPL modernization plan (2026-05-30): scaffold only — the directive is OPTIONAL on every UserConstraint; behaviour is unchanged when absent. Each subsequent migration site (RegRange, Gas_MaxOpDay, MinProvision) ships independently.
The PAMPL surface syntax @regrange(penalty=1000) is reserved for Step 1b — JSON-emitting converters (the only consumer today) can populate the sibling field directly.
Namespaces
- namespace gtopt
Classes
- struct gtopt::ConstraintDirective