2using System.Collections.Generic;
3using LotSizingDataModel.Solution;
52 LotSizingSolution solution)
54 ArgumentNullException.ThrowIfNull(
57 ArgumentNullException.ThrowIfNull(
60 EnsureConfigurationIsValid();
62 double effectiveZeroTolerance =
65 IReadOnlyList<MathematicalVariableValue> values =
69 effectiveZeroTolerance);
115 LotSizingSolution solution,
133 LotSizingSolution solution,
134 IReadOnlyList<MathematicalVariableValue> values)
153 LotSizingSolution solution,
154 IReadOnlyList<MathematicalVariableValue> values)
158 private void EnsureConfigurationIsValid()
160 if (
string.IsNullOrWhiteSpace(
163 throw new InvalidOperationException(
164 "A mathematical decision-mapper category is " +
174 throw new InvalidOperationException(
175 "The mathematical decision-mapper zero tolerance " +
176 "must be finite and non-negative.");
Stores the value returned by a solver for one mathematical decision variable.
string DomainKey
Gets or sets the business-domain key associated with the mathematical variable.
Provides a reusable base implementation for mathematical decision mappers handling one domain-key cat...
string Category
Gets the mathematical domain-key category handled by this mapper.
virtual void AfterMap(MathematicalSolutionMappingContext context, LotSizingSolution solution, IReadOnlyList< MathematicalVariableValue > values)
Executes optional finalization after all values have been mapped.
virtual double ZeroTolerance
Gets the absolute tolerance below which a solver value is considered equal to zero.
void MapValue(MathematicalSolutionMappingContext context, LotSizingSolution solution, MathematicalDomainKey domainKey, MathematicalVariableValue variableValue)
Maps one mathematical-variable value selected by the active mapping options.
void Map(MathematicalSolutionMappingContext context, LotSizingSolution solution)
Maps the decision values handled by this mapper into a lot-sizing solution.
virtual void BeforeMap(MathematicalSolutionMappingContext context, LotSizingSolution solution, IReadOnlyList< MathematicalVariableValue > values)
Executes optional initialization before values are mapped.
Represents a parsed mathematical-model business-domain key.
static MathematicalDomainKey Parse(string domainKey)
Parses a canonical mathematical domain key.
Provides the shared state and lookup services required while mapping a mathematical solver result bac...
MathematicalSolutionMappingOptions Options
Gets the normalized mapping options used by this context.
IReadOnlyList< MathematicalVariableValue > GetValuesByCategory(string category, bool includeZeroValues, double zeroTolerance=1.0e-9)
Returns solver values whose domain-key category matches the supplied category.
double ZeroTolerance
Gets or sets the absolute tolerance below which a solver value is considered equal to zero.
bool IncludeZeroValues
Gets or sets a value indicating whether solver values considered equal to zero must also be mapped.
Defines a mapper responsible for one family of lot-sizing decisions identified by a mathematical doma...