- Timestamp:
- 05/07/19 15:30:17 (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/HeuristicLab.ExactOptimization/3.3
- Property svn:ignore
-
old new 12 12 *.nuget.props 13 13 *.nuget.targets 14 Plugin.cs
-
- Property svn:ignore
-
trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/IncrementalLinearSolver.cs
r16736 r16910 88 88 public override void Reset() { 89 89 base.Reset(); 90 stopwatch.Reset();91 90 executionTime = TimeSpan.Zero; 92 91 } … … 114 113 return; 115 114 116 stopwatch. Start();115 stopwatch.Restart(); 117 116 Solve(problemDefinition, results, IntermediateTimeLimit); 118 117 stopwatch.Stop(); -
trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/LinearSolver.cs
r16736 r16910 47 47 protected IFixedValueParameter<TextValue> solverSpecificParametersParam; 48 48 49 public static string LogDirectory { get; } 50 51 static LinearSolver() { 52 var solver = new Solver("", Solver.OptimizationProblemType.CbcMixedIntegerProgramming); 53 LogDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 54 Directory.CreateDirectory(LogDirectory); 55 solver.InitLogging(Assembly.GetExecutingAssembly().Location, LogDirectory); 56 } 57 49 58 public LinearSolver() { 50 59 Parameters.Add(problemTypeParam = … … 165 174 166 175 if (!solver.SetSolverSpecificParametersAsString(SolverSpecificParameters)) 167 throw new ArgumentException("Solver specific parameters could not be set."); 176 throw new ArgumentException("Solver specific parameters could not be set. " + 177 $"For details, see the log files in '{LogDirectory}'."); 168 178 169 179 resultStatus = (ResultStatus)solver.Solve(parameters); … … 225 235 solver = new Solver(Name, optimizationProblemType, libraryName ?? string.Empty); 226 236 } catch { 227 throw new InvalidOperationException($"Could not create {optimizationProblemType}.");237 solver = null; 228 238 } 229 239 230 240 if (solver == null) 231 throw new InvalidOperationException($"Could not create {optimizationProblemType}."); 241 throw new InvalidOperationException($"Could not create {optimizationProblemType}. " + 242 $"For details, see the log files in '{LogDirectory}'."); 232 243 233 244 solver.SuppressOutput(); -
trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Algorithms/Solvers/GlopSolver.cs
r16736 r16910 34 34 35 35 public GlopSolver() { 36 problemTypeParam.Value = (EnumValue<ProblemType>) problemTypeParam.Value.AsReadOnly();36 problemTypeParam.Value = (EnumValue<ProblemType>)new EnumValue<ProblemType>(ProblemType.LinearProgramming).AsReadOnly(); 37 37 SolverSpecificParameters = 38 38 "# for file format, see Protocol Buffers text format (https://developers.google.com/protocol-buffers/docs/overview#whynotxml)" + Environment.NewLine + -
trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Problems/FileBasedLinearProblemDefinition.cs
r16736 r16910 23 23 using System.IO; 24 24 using Google.OrTools.LinearSolver; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Common.Resources; … … 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 33 33 namespace HeuristicLab.ExactOptimization.LinearProgramming { … … 50 50 "Google OR-Tools Protocol Buffers Files (*.bin;*.prototxt)|*.bin;*.prototxt|" + 51 51 "All Files (*.*)|*.*"; 52 fileNameParam.Value. PathChanged += (o, e) => {52 fileNameParam.Value.StringValue.ValueChanged += (o, e) => { 53 53 if (File.Exists(FileName)) { 54 54 fileContent = File.ReadAllBytes(FileName); -
trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Problems/LinearProblem.cs
r16736 r16910 26 26 using System.Reflection; 27 27 using Google.OrTools.LinearSolver; 28 using HEAL.Attic; 28 29 using HeuristicLab.Common; 29 30 using HeuristicLab.Core; … … 31 32 using HeuristicLab.Optimization; 32 33 using HeuristicLab.Parameters; 33 using HEAL.Attic;34 34 35 35 namespace HeuristicLab.ExactOptimization.LinearProgramming { … … 44 44 public LinearProblem() { 45 45 Parameters.Remove(Parameters["Operators"]); 46 Parameters.Add(problemDefinitionParam = new ValueParameter<ILinearProblemDefinition>("Model", 47 new ProgrammableLinearProblemDefinition() , false));46 Parameters.Add(problemDefinitionParam = new ValueParameter<ILinearProblemDefinition>("Model", "The linear programming problem", 47 new ProgrammableLinearProblemDefinition()) { GetsCollected = false }); 48 48 } 49 49 … … 137 137 138 138 if (!exportSuccessful) 139 throw new InvalidDataException("Model could not be exported."); 139 throw new InvalidOperationException($"Model could not be exported. " + 140 $"For details, see the log files in '{LinearSolver.LogDirectory}'."); 140 141 } 141 142
Note: See TracChangeset
for help on using the changeset viewer.