2using System.Diagnostics;
4using System.Threading.Tasks;
5using LotSizingDataModel.Instance;
39 public async ValueTask<MathematicalModelBuildResult>
BuildAsync(
40 LotSizingInstance instance,
43 CancellationToken cancellationToken =
default)
45 ArgumentNullException.ThrowIfNull(instance);
46 ArgumentNullException.ThrowIfNull(registry);
47 ArgumentNullException.ThrowIfNull(options);
62 cancellationToken.ThrowIfCancellationRequested();
65 _selectionService.Select(
78 "No compatible mathematical formulation " +
83 cancellationToken.ThrowIfCancellationRequested();
90 cancellationToken.ThrowIfCancellationRequested();
92 ArgumentNullException.ThrowIfNull(model);
114 $
"Mathematical model '{model.Name}' was built " +
115 $
"with {model.VariableCount} variables and " +
116 $
"{model.EnabledConstraintCount} enabled " +
121 catch (OperationCanceledException)
128 "Mathematical model construction was " +
133 "The cancellation token was signalled during " +
134 "formulation selection or model construction.");
138 catch (Exception exception)
149 exception.ToString());