2using System.Xml.Serialization;
11[XmlType(TypeName =
"mathematicalVariable")]
26 double.PositiveInfinity;
54 double lowerBound = 0.0,
55 double upperBound =
double.PositiveInfinity)
90 [XmlAttribute(
"name")]
100 [XmlAttribute(
"variableType")]
110 [XmlAttribute(
"lowerBound")]
120 [XmlAttribute(
"upperBound")]
131 [XmlElement(
"domainKey")]
142 [XmlElement(
"description")]
156 !
double.IsNegativeInfinity(
165 !
double.IsPositiveInfinity(
178 throw new InvalidOperationException(
179 "A mathematical variable identifier must be " +
180 "strictly positive.");
183 if (
string.IsNullOrWhiteSpace(
186 throw new InvalidOperationException(
187 "A mathematical variable name is required.");
193 throw new InvalidOperationException(
194 "A mathematical variable type is required.");
202 throw new InvalidOperationException(
203 "Mathematical variable bounds cannot be NaN.");
209 throw new InvalidOperationException(
210 "A mathematical variable lower bound cannot " +
211 "exceed its upper bound.");
219 throw new InvalidOperationException(
220 "A binary variable must have bounds within " +
234 throw new InvalidOperationException(
235 "An integer variable must have an integer " +
244 throw new InvalidOperationException(
245 "An integer variable must have an integer " +
MathematicalVariableType VariableType
Gets or sets the variable domain.
bool HasFiniteUpperBound
Gets a value indicating whether the variable has a finite upper bound.
string DomainKey
Gets or sets an optional domain key used to map the mathematical variable back to a lot-sizing decisi...
int Id
Gets or sets the unique variable identifier within the mathematical model.
double LowerBound
Gets or sets the variable lower bound.
MathematicalVariable(int id, string name, MathematicalVariableType variableType, double lowerBound=0.0, double upperBound=double.PositiveInfinity)
Initializes a mathematical variable.
bool HasFiniteLowerBound
Gets a value indicating whether the variable has a finite lower bound.
string Description
Gets or sets an optional description.
string Name
Gets or sets the variable name.
void EnsureValid()
Validates the mathematical variable.
MathematicalVariable()
Initializes an empty mathematical variable.
double UpperBound
Gets or sets the variable upper bound.
MathematicalVariableType
Identifies the domain of a mathematical decision variable.