2using System.Xml.Serialization;
11[XmlType(TypeName =
"mathematicalObjective")]
47 ArgumentNullException.ThrowIfNull(
65 [XmlAttribute(
"name")]
75 [XmlAttribute(
"sense")]
85 [XmlElement(
"expression")]
95 [XmlElement(
"description")]
111 if (
string.IsNullOrWhiteSpace(
114 throw new InvalidOperationException(
115 "A mathematical objective name is required.");
121 throw new InvalidOperationException(
122 "A mathematical objective sense is required.");
125 ArgumentNullException.ThrowIfNull(
Represents a linear expression composed of variable terms and a constant value.
MathematicalObjective()
Initializes an empty mathematical objective.
string Name
Gets or sets the objective name.
MathematicalObjective Clone()
Creates an independent copy of this objective.
string Description
Gets or sets an optional description of the objective.
ObjectiveSense Sense
Gets or sets the optimization direction.
void EnsureValid()
Validates the mathematical objective.
MathematicalObjective(string name, ObjectiveSense sense, LinearExpression expression)
Initializes a mathematical objective.
LinearExpression Expression
Gets or sets the linear objective expression.
ObjectiveSense
Identifies the optimization direction of a mathematical objective.