14 private int _nextVariableId =
17 private int _nextConstraintId =
32 if (
string.IsNullOrWhiteSpace(
35 throw new ArgumentException(
36 "A mathematical model name is required.",
67 description?.Trim() ??
89 ArgumentNullException.ThrowIfNull(
127 double lowerBound = 0.0,
128 double upperBound =
double.PositiveInfinity,
129 string domainKey =
"",
130 string description =
"")
145 description?.Trim() ??
185 double rightHandSide,
186 string domainKey =
"",
187 string description =
"")
189 ArgumentNullException.ThrowIfNull(
205 description?.Trim() ??
209 _model.AddConstraint(
LinearConstraint AddConstraint(string name, LinearExpression leftHandSide, MathematicalConstraintSense sense, double rightHandSide, string domainKey="", string description="")
Creates and adds a linear constraint.
MathematicalVariable AddVariable(string name, MathematicalVariableType variableType, double lowerBound=0.0, double upperBound=double.PositiveInfinity, string domainKey="", string description="")
Creates and adds a mathematical variable.
MathematicalModelBuilder SetDescription(string description)
Sets the model description.
MathematicalModel Model
Gets the model currently being built.
MathematicalModelBuilder SetObjective(MathematicalObjective objective)
Sets the mathematical objective.
MathematicalModel Build(bool clone=true)
Builds and validates the mathematical model.
MathematicalModelBuilder(string modelName)
Initializes a mathematical-model builder.
Represents one linear constraint in a mathematical optimization model.
Represents a linear expression composed of variable terms and a constant value.
Represents a solver-independent mathematical optimization model.
void EnsureValid()
Validates the complete mathematical model.
Represents the objective function of a mathematical optimization model.
void EnsureValid()
Validates the mathematical objective.
Represents one decision variable in a mathematical optimization model.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.
MathematicalVariableType
Identifies the domain of a mathematical decision variable.