1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Data;
|
---|
4 | using HeuristicLab.Parameters;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.MathematicalOptimization.LinearProgramming.Algorithms {
|
---|
8 |
|
---|
9 | public class Solver : ParameterizedNamedItem, ISolver {
|
---|
10 |
|
---|
11 | [Storable]
|
---|
12 | protected IFixedValueParameter<StringValue> libraryNameParam;
|
---|
13 |
|
---|
14 |
|
---|
15 | [Storable]
|
---|
16 | protected IFixedValueParameter<EnumValue<LinearProgrammingType>> programmingTypeParam;
|
---|
17 |
|
---|
18 | public Solver() {
|
---|
19 | // Parameters.Add(useMixedIntegerProgrammingParam = new FixedValueParameter<BoolValue>(nameof(UseMixedIntegerProgramming), (BoolValue)new BoolValue(false).AsReadOnly()));
|
---|
20 | Parameters.Add(programmingTypeParam = new FixedValueParameter<EnumValue<LinearProgrammingType>>(nameof(LinearProgrammingType), new EnumValue<LinearProgrammingType>()));
|
---|
21 | }
|
---|
22 |
|
---|
23 | [StorableConstructor]
|
---|
24 | protected Solver(bool deserializing)
|
---|
25 | : base(deserializing) { }
|
---|
26 |
|
---|
27 | protected Solver(Solver original, Cloner cloner)
|
---|
28 | : base(original, cloner) {
|
---|
29 | libraryNameParam = cloner.Clone(original.libraryNameParam);
|
---|
30 | programmingTypeParam = cloner.Clone(original.programmingTypeParam);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public string LibraryName {
|
---|
34 | get => libraryNameParam?.Value.Value;
|
---|
35 | set => libraryNameParam.Value.Value = value;
|
---|
36 | }
|
---|
37 |
|
---|
38 | public virtual OptimizationProblemType OptimizationProblemType { get; }
|
---|
39 |
|
---|
40 | public LinearProgrammingType LinearProgrammingType {
|
---|
41 | get => programmingTypeParam.Value.Value;
|
---|
42 | set => programmingTypeParam.Value.Value = value;
|
---|
43 | }
|
---|
44 |
|
---|
45 | public override IDeepCloneable Clone(Cloner cloner) => new Solver(this, cloner);
|
---|
46 | }
|
---|
47 | } |
---|