Ignore:
Timestamp:
12/12/18 14:23:45 (8 months ago)
Author:
ddorfmei
Message:

#2931:

  • upgraded Google OR-Tools to version 6.10
  • added TextValue and TextValueView to be able to display and edit a multiline string
  • added parameter to set solver specific parameters for supported solvers
  • added support for the Protocol Buffers representation of models (import/export)
  • added import of MPS models
  • added pause/stop functionality to CplexSolver and GlpkSolver
  • refactored wrapper (LinearSolver and related enums)
  • added new algorithm category Exact for LinearProgrammingAlgorithm
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/ScipSolver.cs

    r16288 r16373  
    2020#endregion
    2121
     22using System;
     23using System.Threading;
    2224using HeuristicLab.Common;
    2325using HeuristicLab.Core;
     
    3133  [Item("SCIP", "SCIP (http://scip.zib.de/) must be installed and licenced.")]
    3234  [StorableClass]
    33   public class ScipSolver : ExternalSolver {
     35  public class ScipSolver : ExternalIncrementalSolver {
     36
     37    private TimeSpan timeLimit = TimeSpan.Zero;
    3438
    3539    public ScipSolver() {
    3640      Parameters.Add(libraryNameParam = new FixedValueParameter<FileValue>(nameof(LibraryName),
    3741        new FileValue { FileDialogFilter = FileDialogFilter, Value = Properties.Settings.Default.ScipLibraryName }));
    38       programmingTypeParam.Value =
    39         (EnumValue<LinearProgrammingType>)new EnumValue<LinearProgrammingType>(LinearProgrammingType
    40           .MixedIntegerProgramming).AsReadOnly();
     42      problemTypeParam.Value =
     43        (EnumValue<ProblemType>)new EnumValue<ProblemType>(ProblemType.MixedIntegerProgramming).AsReadOnly();
     44      SolverSpecificParameters.Value =
     45        "# for file format and parameters, see https://scip.zib.de/doc/html/PARAMETERS.php" + Environment.NewLine +
     46        "# example:" + Environment.NewLine +
     47        "# branching/random/seed = 10" + Environment.NewLine;
    4148    }
    4249
     
    5057    }
    5158
    52     public override bool SupportsPause => true;
     59    protected override OptimizationProblemType OptimizationProblemType =>
     60      OptimizationProblemType.ScipMixedIntegerProgramming;
     61    protected override TimeSpan TimeLimit => timeLimit += QualityUpdateInterval;
    5362
    54     public override bool SupportsStop => true;
    55 
    56     protected override OptimizationProblemType OptimizationProblemType =>
    57       OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING;
     63    public override void Solve(LinearProgrammingAlgorithm algorithm, CancellationToken cancellationToken) {
     64      timeLimit = TimeSpan.Zero;
     65      base.Solve(algorithm, cancellationToken);
     66    }
    5867  }
    5968}
Note: See TracChangeset for help on using the changeset viewer.