gtopt/user_constraint_lp.hpp file

LP element for user-defined constraints.

Declares UserConstraintLP, an LP element class (similar to DemandLP) that wraps a single UserConstraint and participates in the standard LP element collection mechanism.

Collection registration

UserConstraintLP is registered as the LAST type in lp_element_types_t (see lp_element_types.hpp) so that user constraints are added to the LP after all other elements — user constraint expressions reference LP columns created by the earlier elements.

Dual-value output

add_to_output() writes dual (shadow-price) values for the constraint rows to output/UserConstraint/constraint_dual.{csv,parquet}.

Dual scaling follows the ConstraintScaleType stored on the constraint:

  • Power (default) → scale_obj / (prob × discount × Δt)
  • Energy → same scaling as Power, unit $/MWh
  • Rawscale_obj / discount — discount factor only

Namespaces

namespace gtopt

Classes

class gtopt::UserConstraintLP
LP element wrapping a single user-defined constraint.