LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
MathematicalModelBuildOptions.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
3
5
6/// <summary>
7/// Defines the options used to select a formulation and build a
8/// solver-independent mathematical model.
9/// </summary>
10[Serializable]
11[XmlType(TypeName = "mathematicalModelBuildOptions")]
13{
14 /// <summary>
15 /// Initializes default mathematical-model build options.
16 /// </summary>
18 {
20 string.Empty;
21
23 true;
24
26 true;
27
29 false;
30 }
31
32 /// <summary>
33 /// Gets or sets the requested formulation identifier.
34 /// </summary>
35 /// <remarks>
36 /// An empty value enables automatic formulation selection.
37 /// </remarks>
38 [XmlAttribute("requestedFormulationId")]
40 {
41 get;
42 set;
43 }
44
45 /// <summary>
46 /// Gets or sets a value indicating whether another
47 /// compatible formulation may be selected when the requested
48 /// formulation is unavailable or incompatible.
49 /// </summary>
50 [XmlAttribute("allowFallback")]
51 public bool AllowFallback
52 {
53 get;
54 set;
55 }
56
57 /// <summary>
58 /// Gets or sets a value indicating whether the generated
59 /// mathematical model must be validated before it is
60 /// returned.
61 /// </summary>
62 [XmlAttribute("validateGeneratedModel")]
64 {
65 get;
66 set;
67 }
68
69 /// <summary>
70 /// Gets or sets a value indicating whether an independent
71 /// clone of the generated model must be returned.
72 /// </summary>
73 /// <remarks>
74 /// Cloning can protect a cached formulation model from later
75 /// modifications, but it requires additional memory and
76 /// processing time.
77 /// </remarks>
78 [XmlAttribute("cloneGeneratedModel")]
80 {
81 get;
82 set;
83 }
84
85 /// <summary>
86 /// Validates and normalizes the build options.
87 /// </summary>
88 public void EnsureValid()
89 {
91 RequestedFormulationId?.Trim() ??
92 string.Empty;
93 }
94
95 /// <summary>
96 /// Creates an independent copy of the build options.
97 /// </summary>
98 /// <returns>
99 /// Cloned mathematical-model build options.
100 /// </returns>
118}
MathematicalModelBuildOptions()
Initializes default mathematical-model build options.
bool CloneGeneratedModel
Gets or sets a value indicating whether an independent clone of the generated model must be returned.
bool ValidateGeneratedModel
Gets or sets a value indicating whether the generated mathematical model must be validated before it ...
string RequestedFormulationId
Gets or sets the requested formulation identifier.
MathematicalModelBuildOptions Clone()
Creates an independent copy of the build options.
bool AllowFallback
Gets or sets a value indicating whether another compatible formulation may be selected when the reque...