gtopt/user_constraint.hpp file

User-defined constraint data structure for LP formulation.

This module defines the UserConstraint struct, which stores a user-defined linear constraint expression. The expression string follows an AMPL-inspired syntax that references gtopt elements (generators, demands, lines, batteries) and their LP variables, with optional domain restrictions over scenarios, stages, and blocks.

Expression syntax (AMPL-inspired)

generator("TORO").generation + generator("uid:23").generation <= 300,
    for(stage in {4,5,6}, block in 1..30)

See constraint_parser.hpp for the full grammar and ConstraintExpr AST.

Namespaces

namespace gtopt

Classes

struct gtopt::UserConstraint
Stores a user-defined linear constraint expression.