Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/19 15:30:17 (6 years ago)
Author:
abeham
Message:

#2931: merged to trunk

  • Fixed references in plugins
  • Fixed output path
  • Removed app.config from views plugin
  • Reverted changes to PathValue and FileValue and their respective views
Location:
trunk
Files:
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/HeuristicLab.ExactOptimization/3.3

    • Property svn:ignore
      •  

        old new  
        1212*.nuget.props
        1313*.nuget.targets
         14Plugin.cs
  • trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/IncrementalLinearSolver.cs

    r16736 r16910  
    8888    public override void Reset() {
    8989      base.Reset();
    90       stopwatch.Reset();
    9190      executionTime = TimeSpan.Zero;
    9291    }
     
    114113          return;
    115114
    116         stopwatch.Start();
     115        stopwatch.Restart();
    117116        Solve(problemDefinition, results, IntermediateTimeLimit);
    118117        stopwatch.Stop();
  • trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/LinearSolver.cs

    r16736 r16910  
    4747    protected IFixedValueParameter<TextValue> solverSpecificParametersParam;
    4848
     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
    4958    public LinearSolver() {
    5059      Parameters.Add(problemTypeParam =
     
    165174
    166175        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}'.");
    168178
    169179        resultStatus = (ResultStatus)solver.Solve(parameters);
     
    225235        solver = new Solver(Name, optimizationProblemType, libraryName ?? string.Empty);
    226236      } catch {
    227         throw new InvalidOperationException($"Could not create {optimizationProblemType}.");
     237        solver = null;
    228238      }
    229239
    230240      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}'.");
    232243
    233244      solver.SuppressOutput();
  • trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Algorithms/Solvers/GlopSolver.cs

    r16736 r16910  
    3434
    3535    public GlopSolver() {
    36       problemTypeParam.Value = (EnumValue<ProblemType>)problemTypeParam.Value.AsReadOnly();
     36      problemTypeParam.Value = (EnumValue<ProblemType>)new EnumValue<ProblemType>(ProblemType.LinearProgramming).AsReadOnly();
    3737      SolverSpecificParameters =
    3838        "# 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  
    2323using System.IO;
    2424using Google.OrTools.LinearSolver;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Common.Resources;
     
    2930using HeuristicLab.Optimization;
    3031using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3232
    3333namespace HeuristicLab.ExactOptimization.LinearProgramming {
     
    5050        "Google OR-Tools Protocol Buffers Files (*.bin;*.prototxt)|*.bin;*.prototxt|" +
    5151        "All Files (*.*)|*.*";
    52       fileNameParam.Value.PathChanged += (o, e) => {
     52      fileNameParam.Value.StringValue.ValueChanged += (o, e) => {
    5353        if (File.Exists(FileName)) {
    5454          fileContent = File.ReadAllBytes(FileName);
  • trunk/HeuristicLab.ExactOptimization/3.3/LinearProgramming/Problems/LinearProblem.cs

    r16736 r16910  
    2626using System.Reflection;
    2727using Google.OrTools.LinearSolver;
     28using HEAL.Attic;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
     
    3132using HeuristicLab.Optimization;
    3233using HeuristicLab.Parameters;
    33 using HEAL.Attic;
    3434
    3535namespace HeuristicLab.ExactOptimization.LinearProgramming {
     
    4444    public LinearProblem() {
    4545      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 });
    4848    }
    4949
     
    137137
    138138      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}'.");
    140141    }
    141142
Note: See TracChangeset for help on using the changeset viewer.