Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solver.cs @ 16172

Last change on this file since 16172 was 16172, checked in by ddorfmei, 6 years ago

#2931:

  • created LinearProgrammingAlgorithm
    • created definitions for all LP/MIP solvers supported by OR-Tools
  • created LinearProgrammingProblem
    • created classes required for scripting: LinearProgrammingProblemDefinition, LinearProgrammingProblemDefinitionScript, CompiledLinearProgrammingProblemDefinition
    • created views: LinearProgrammingProblemView, LinearProgrammingProblemDefinitionScriptView
  • updated OR-Tools version in ExtLibs to 6.9
File size: 1.7 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Parameters;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6
7namespace 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}
Note: See TracBrowser for help on using the repository browser.