3using System.Threading.Tasks;
4using LotSizingDataModel.Instance;
28 public abstract string Name
51 LotSizingInstance instance);
75 LotSizingInstance instance,
76 CancellationToken cancellationToken =
default)
78 ArgumentNullException.ThrowIfNull(
81 EnsureMetadataIsValid();
83 cancellationToken.ThrowIfCancellationRequested();
88 throw new InvalidOperationException(
89 $
"Formulation '{FormulationId}' does not support " +
90 "the supplied lot-sizing instance.");
98 context.SetDescription(
106 cancellationToken.ThrowIfCancellationRequested();
113 cancellationToken.ThrowIfCancellationRequested();
120 cancellationToken.ThrowIfCancellationRequested();
144 LotSizingInstance instance)
146 ArgumentNullException.ThrowIfNull(
168 LotSizingInstance instance,
170 CancellationToken cancellationToken);
188 LotSizingInstance instance,
190 CancellationToken cancellationToken);
208 LotSizingInstance instance,
210 CancellationToken cancellationToken);
223 LotSizingInstance instance,
226 ArgumentNullException.ThrowIfNull(
229 ArgumentNullException.ThrowIfNull(
235 private void EnsureMetadataIsValid()
237 if (
string.IsNullOrWhiteSpace(
240 throw new InvalidOperationException(
241 "A formulation identifier is required.");
244 if (
string.IsNullOrWhiteSpace(
247 throw new InvalidOperationException(
248 "A formulation name is required.");
Provides the shared state required while constructing a solver-independent mathematical model.
Represents a solver-independent mathematical optimization model.
void EnsureValid()
Validates the complete mathematical model.