Changeset 16234 for branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming
- Timestamp:
- 10/18/18 13:55:09 (6 years ago)
- Location:
- branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/ISolver.cs
r16233 r16234 6 6 public interface ISolver : IParameterizedNamedItem { 7 7 LinearProgrammingType LinearProgrammingType { get; set; } 8 OptimizationProblemType OptimizationProblemType { get; }9 8 bool SupportsPause { get; } 10 9 bool SupportsStop { get; } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/IncrementalSolver.cs
r16233 r16234 66 66 public override void Solve(LinearProgrammingAlgorithm algorithm, CancellationToken cancellationToken) { 67 67 if (!Incrementality) { 68 base.Solve(algorithm );68 base.Solve(algorithm, cancellationToken); 69 69 return; 70 70 } … … 79 79 } 80 80 } 81 81 82 82 var iterations = (long)timeLimit.TotalMilliseconds / (long)QualityUpdateInterval.TotalMilliseconds; 83 83 var remaining = timeLimit - TimeSpan.FromMilliseconds(iterations * QualityUpdateInterval.TotalMilliseconds); -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/Solver.cs
r16233 r16234 38 38 } 39 39 40 p ublicvirtual OptimizationProblemType OptimizationProblemType { get; }40 protected virtual OptimizationProblemType OptimizationProblemType { get; } 41 41 public virtual bool SupportsPause => false; 42 42 public virtual bool SupportsStop => false; … … 53 53 54 54 public virtual void Solve(LinearProgrammingAlgorithm algorithm, CancellationToken cancellationToken) => 55 Solve(algorithm , CancellationToken.None);55 Solve(algorithm); 56 56 57 57 public virtual void Solve(LinearProgrammingAlgorithm algorithm) => … … 59 59 60 60 public virtual void Solve(LinearProgrammingAlgorithm algorithm, TimeSpan timeLimit, bool incrementality) { 61 var libraryName = string.Empty;62 if (this is ExternalSolver externalSolver)61 string libraryName = null; 62 if (this is IExternalSolver externalSolver) 63 63 libraryName = externalSolver.LibraryName; 64 64 -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/BopSolver.cs
r16233 r16234 13 13 } 14 14 15 public override OptimizationProblemType OptimizationProblemType => OptimizationProblemType.BOP_INTEGER_PROGRAMMING;16 15 public override bool SupportsPause => true; 16 17 17 public override bool SupportsStop => true; 18 19 protected override OptimizationProblemType OptimizationProblemType => 20 OptimizationProblemType.BOP_INTEGER_PROGRAMMING; 18 21 } 19 22 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/CoinOrSolver.cs
r16233 r16234 27 27 } 28 28 29 p ublicoverride OptimizationProblemType OptimizationProblemType =>29 protected override OptimizationProblemType OptimizationProblemType => 30 30 LinearProgrammingType == LinearProgrammingType.LinearProgramming 31 31 ? OptimizationProblemType.CLP_LINEAR_PROGRAMMING -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/CplexSolver.cs
r16233 r16234 13 13 public CplexSolver() { 14 14 Parameters.Add(libraryNameParam = new FixedValueParameter<FileValue>(nameof(LibraryName), 15 new FileValue { FileDialogFilter = FileDialogFilter, Value = "cplex1280.dll"}));15 new FileValue { FileDialogFilter = FileDialogFilter, Value = Properties.Settings.Default.CplexLibraryName })); 16 16 } 17 17 18 p ublicoverride OptimizationProblemType OptimizationProblemType =>18 protected override OptimizationProblemType OptimizationProblemType => 19 19 LinearProgrammingType == LinearProgrammingType.LinearProgramming 20 20 ? OptimizationProblemType.CPLEX_LINEAR_PROGRAMMING -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/GlopSolver.cs
r16233 r16234 14 14 } 15 15 16 public override OptimizationProblemType OptimizationProblemType => OptimizationProblemType.GLOP_LINEAR_PROGRAMMING;17 16 public override bool SupportsPause => true; 17 18 18 public override bool SupportsStop => true; 19 20 protected override OptimizationProblemType OptimizationProblemType => 21 OptimizationProblemType.GLOP_LINEAR_PROGRAMMING; 19 22 } 20 23 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/GlpkSolver.cs
r16233 r16234 13 13 public GlpkSolver() { 14 14 Parameters.Add(libraryNameParam = new FixedValueParameter<FileValue>(nameof(LibraryName), 15 new FileValue { FileDialogFilter = FileDialogFilter, Value = "glpk465.dll"}));15 new FileValue { FileDialogFilter = FileDialogFilter, Value = Properties.Settings.Default.GlpkLibraryName })); 16 16 17 17 programmingTypeParam.Value.ValueChanged += (sender, args) => { … … 31 31 } 32 32 33 p ublicoverride OptimizationProblemType OptimizationProblemType =>33 protected override OptimizationProblemType OptimizationProblemType => 34 34 LinearProgrammingType == LinearProgrammingType.LinearProgramming 35 35 ? OptimizationProblemType.GLPK_LINEAR_PROGRAMMING -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/GurobiSolver.cs
r16233 r16234 14 14 public GurobiSolver() { 15 15 Parameters.Add(libraryNameParam = new FixedValueParameter<FileValue>(nameof(LibraryName), 16 new FileValue { FileDialogFilter = FileDialogFilter, Value = "gurobi80.dll"}));16 new FileValue { FileDialogFilter = FileDialogFilter, Value = Properties.Settings.Default.GurobiLibraryName })); 17 17 } 18 18 … … 22 22 } 23 23 24 public override OptimizationProblemType OptimizationProblemType => 25 LinearProgrammingType == LinearProgrammingType.LinearProgramming 24 public override bool SupportsPause => true; 25 26 public override bool SupportsStop => true; 27 28 protected override OptimizationProblemType OptimizationProblemType => 29 LinearProgrammingType == LinearProgrammingType.LinearProgramming 26 30 ? OptimizationProblemType.GUROBI_LINEAR_PROGRAMMING 27 31 : OptimizationProblemType.GUROBI_MIXED_INTEGER_PROGRAMMING; 28 29 public override bool SupportsPause => true;30 public override bool SupportsStop => true;31 32 } 32 33 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/ScipSolver.cs
r16233 r16234 13 13 public ScipSolver() { 14 14 Parameters.Add(libraryNameParam = new FixedValueParameter<FileValue>(nameof(LibraryName), 15 new FileValue { FileDialogFilter = FileDialogFilter, Value = "scip.dll"}));15 new FileValue { FileDialogFilter = FileDialogFilter, Value = Properties.Settings.Default.ScipLibraryName })); 16 16 programmingTypeParam.Value = 17 17 (EnumValue<LinearProgrammingType>)new EnumValue<LinearProgrammingType>(LinearProgrammingType … … 19 19 } 20 20 21 public override OptimizationProblemType OptimizationProblemType => 22 OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING; 21 public override bool SupportsPause => true; 23 22 24 public override bool SupportsPause => true;25 23 public override bool SupportsStop => true; 24 25 protected override OptimizationProblemType OptimizationProblemType => 26 OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING; 26 27 } 27 28 }
Note: See TracChangeset
for help on using the changeset viewer.