- Timestamp:
- 01/29/19 17:45:06 (6 years ago)
- Location:
- branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3
- Files:
-
- 2 added
- 6 deleted
- 26 edited
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/HeuristicLab.ExactOptimization-3.3.csproj
r16581 r16582 9 9 <OutputType>Library</OutputType> 10 10 <AppDesignerFolder>Properties</AppDesignerFolder> 11 <RootNamespace>HeuristicLab. MathematicalOptimization</RootNamespace>12 <AssemblyName>HeuristicLab. MathematicalOptimization-3.3</AssemblyName>11 <RootNamespace>HeuristicLab.ExactOptimization</RootNamespace> 12 <AssemblyName>HeuristicLab.ExactOptimization-3.3</AssemblyName> 13 13 <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> … … 125 125 </ItemGroup> 126 126 <ItemGroup> 127 <Compile Include="LinearProgramming\Algorithms\ResultStatus.cs" /> 127 128 <Compile Include="LinearProgramming\Algorithms\Solvers\BopSolver.cs" /> 128 129 <Compile Include="LinearProgramming\Algorithms\Solvers\CoinOrSolver.cs" /> … … 137 138 <Compile Include="LinearProgramming\Algorithms\Solvers\ScipSolver.cs" /> 138 139 <Compile Include="LinearProgramming\Problems\CompiledProblemDefinition.cs" /> 139 <Compile Include="LinearProgramming\Problems\FileBasedLinearProgrammingProblemDefinition.cs" /> 140 <Compile Include="LinearProgramming\Problems\LinearProgrammingProblem.cs" /> 141 <Compile Include="LinearProgramming\Algorithms\BasisStatus.cs" /> 140 <Compile Include="LinearProgramming\Problems\FileBasedLinearProblemDefinition.cs" /> 141 <Compile Include="LinearProgramming\Problems\LinearProblem.cs" /> 142 142 <Compile Include="LinearProgramming\Algorithms\Solvers\CplexSolver.cs" /> 143 143 <Compile Include="LinearProgramming\Algorithms\Solvers\GurobiSolver.cs" /> 144 144 <Compile Include="LinearProgramming\Algorithms\Solvers\Base\ILinearSolver.cs" /> 145 <Compile Include="LinearProgramming\Algorithms\IncrementalityValues.cs" /> 146 <Compile Include="LinearProgramming\Algorithms\IntegerParam.cs" /> 147 <Compile Include="LinearProgramming\Algorithms\LpAlgorithmValues.cs" /> 148 <Compile Include="LinearProgramming\Problems\ILinearProgrammingProblemDefinition.cs" /> 145 <Compile Include="LinearProgramming\Problems\ILinearProblemDefinition.cs" /> 149 146 <Compile Include="LinearProgramming\Algorithms\LinearProgrammingAlgorithm.cs" /> 150 147 <Compile Include="LinearProgramming\Algorithms\LinearSolverExtensions.cs" /> 151 <Compile Include="LinearProgramming\Algorithms\OptimizationProblemType.cs" />152 148 <Compile Include="LinearProgramming\Algorithms\Solvers\Base\LinearSolver.cs" /> 153 <Compile Include="LinearProgramming\ Algorithms\DoubleParam.cs" />149 <Compile Include="LinearProgramming\Problems\ProgrammableLinearProblemDefinition.cs" /> 154 150 <Compile Include="LinearProgramming\Algorithms\ProtoWriteFormat.cs" /> 155 <Compile Include="LinearProgramming\Algorithms\ResultStatus.cs" /> 156 <Compile Include="LinearProgramming\Problems\ProgrammableLinearProgrammingProblemDefinition.cs" /> 157 <Resource Include="LinearProgramming\Templates\CompiledLinearProgrammingProblemDefinition.cs" /> 151 <Compile Include="LinearProgramming\Algorithms\SolverResponseStatus.cs" /> 152 <Resource Include="LinearProgramming\Templates\CompiledLinearProblemDefinition.cs" /> 158 153 <Compile Include="LinearProgramming\Templates\ScriptTemplates.Designer.cs"> 159 154 <AutoGen>True</AutoGen> … … 161 156 <DependentUpon>ScriptTemplates.resx</DependentUpon> 162 157 </Compile> 163 <Compile Include="LinearProgramming\Algorithms\SolverResponseStatus.cs" />164 158 <Compile Include="Properties\AssemblyInfo.cs" /> 165 159 <Compile Include="Properties\Settings.Designer.cs"> … … 185 179 <EmbeddedResource Include="LinearProgramming\Templates\ScriptTemplates.resx"> 186 180 <Generator>ResXFileCodeGenerator</Generator> 181 <SubType>Designer</SubType> 187 182 <LastGenOutput>ScriptTemplates.Designer.cs</LastGenOutput> 188 <SubType>Designer</SubType>189 183 </EmbeddedResource> 190 184 </ItemGroup> … … 214 208 <Name>HeuristicLab.Data-3.3</Name> 215 209 </ProjectReference> 210 <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj"> 211 <Project>{DBECB8B0-B166-4133-BAF1-ED67C3FD7FCA}</Project> 212 <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name> 213 </ProjectReference> 216 214 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 217 215 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> … … 233 231 <Project>{EE07BFF8-B23D-41F5-8AD7-AC9598D7A2C9}</Project> 234 232 <Name>HeuristicLab.Problems.Programmable-3.3</Name> 233 </ProjectReference> 234 <ProjectReference Include="..\..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj"> 235 <Project>{D767C38D-8014-46B0-9A32-03A3AECCE34A}</Project> 236 <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name> 235 237 </ProjectReference> 236 238 <ProjectReference Include="..\..\HeuristicLab.Scripting\3.3\HeuristicLab.Scripting-3.3.csproj"> -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/LinearProgrammingAlgorithm.cs
r16405 r16582 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 32 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {33 34 [Item(" Linear/Mixed Integer Programming (LP/MIP)", "Linear/mixed integer programming implemented in several solvers. " +35 "See also https://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/ Howto/LinearMixedIntegerProgramming")] // TODO: update link32 namespace HeuristicLab.ExactOptimization.LinearProgramming { 33 34 [Item("Mixed-Integer Linear Programming (LP, MIP)", "Linear/mixed integer programming implemented in several solvers. " + 35 "See also https://dev.heuristiclab.com/trac.fcgi/wiki/Documentation/Reference/ExactOptimization")] 36 36 [Creatable(CreatableAttribute.Categories.ExactAlgorithms)] 37 37 [StorableClass] 38 public class LinearProgrammingAlgorithm : BasicAlgorithm {38 public sealed class LinearProgrammingAlgorithm : BasicAlgorithm { 39 39 40 40 [Storable] … … 42 42 43 43 [Storable] 44 private readonly IFixedValueParameter<FileValue> exportModelParam;45 46 [Storable]47 private readonly IFixedValueParameter<EnumValue<LpAlgorithmValues>> lpAlgorithmParam;48 49 [Storable]50 44 private readonly IFixedValueParameter<BoolValue> presolveParam; 51 45 … … 64 58 [Storable] 65 59 private IConstrainedValueParameter<ILinearSolver> linearSolverParam; 60 61 #region Problem Properties 62 63 public new LinearProblem Problem { 64 get => (LinearProblem)base.Problem; 65 set => base.Problem = value; 66 } 67 68 public override Type ProblemType { get; } = typeof(LinearProblem); 69 70 #endregion 71 #region Parameter Properties 72 73 public IFixedValueParameter<DoubleValue> DualToleranceParameter => dualToleranceParam; 74 public IConstrainedValueParameter<ILinearSolver> LinearSolverParameter => linearSolverParam; 75 public IFixedValueParameter<BoolValue> PresolveParameter => presolveParam; 76 public IFixedValueParameter<DoubleValue> PrimalToleranceParameter => primalToleranceParam; 77 public IFixedValueParameter<PercentValue> RelativeGapToleranceParameter => relativeGapToleranceParam; 78 public IFixedValueParameter<BoolValue> ScalingParameter => scalingParam; 79 public IFixedValueParameter<TimeSpanValue> TimeLimitParameter => timeLimitParam; 80 81 #endregion 82 #region Properties 83 84 public double DualTolerance { 85 get => dualToleranceParam.Value.Value; 86 set => dualToleranceParam.Value.Value = value; 87 } 88 89 public ILinearSolver LinearSolver { 90 get => linearSolverParam.Value; 91 set => linearSolverParam.Value = value; 92 } 93 94 public bool Presolve { 95 get => presolveParam.Value.Value; 96 set => presolveParam.Value.Value = value; 97 } 98 99 public double PrimalTolerance { 100 get => primalToleranceParam.Value.Value; 101 set => primalToleranceParam.Value.Value = value; 102 } 103 104 public double RelativeGapTolerance { 105 get => relativeGapToleranceParam.Value.Value; 106 set => relativeGapToleranceParam.Value.Value = value; 107 } 108 109 public bool Scaling { 110 get => scalingParam.Value.Value; 111 set => scalingParam.Value.Value = value; 112 } 113 114 public override bool SupportsPause => LinearSolver.SupportsPause; 115 public override bool SupportsStop => LinearSolver.SupportsStop; 116 117 public TimeSpan TimeLimit { 118 get => timeLimitParam.Value.Value; 119 set => timeLimitParam.Value.Value = value; 120 } 121 122 #endregion 66 123 67 124 public LinearProgrammingAlgorithm() { … … 70 127 71 128 ILinearSolver defaultSolver; 72 linearSolverParam.ValidValues.Add(new BopSolver());73 129 linearSolverParam.ValidValues.Add(defaultSolver = new CoinOrSolver()); 74 130 linearSolverParam.ValidValues.Add(new CplexSolver()); 75 131 linearSolverParam.ValidValues.Add(new GlopSolver()); 76 linearSolverParam.ValidValues.Add(new GlpkSolver());77 132 linearSolverParam.ValidValues.Add(new GurobiSolver()); 78 133 linearSolverParam.ValidValues.Add(new ScipSolver()); … … 80 135 81 136 Parameters.Add(relativeGapToleranceParam = new FixedValueParameter<PercentValue>(nameof(RelativeGapTolerance), 82 "Limit for relative MIP gap.", new PercentValue( MPSolverParameters.kDefaultRelativeMipGap)));137 "Limit for relative MIP gap.", new PercentValue(SolverParameters.DefaultRelativeMipGap))); 83 138 Parameters.Add(timeLimitParam = new FixedValueParameter<TimeSpanValue>(nameof(TimeLimit), 84 "Limit for runtime. Set to zero for unlimited runtime.", new TimeSpanValue())); 139 "Limit for runtime. Set to zero for unlimited runtime.", 140 new TimeSpanValue(new TimeSpan(0, 1, 0)))); 85 141 Parameters.Add(presolveParam = 86 new FixedValueParameter<BoolValue>(nameof(Presolve), "Advanced usage: presolve mode.", new BoolValue())); 87 Parameters.Add(lpAlgorithmParam = new FixedValueParameter<EnumValue<LpAlgorithmValues>>(nameof(LpAlgorithm), 88 "Algorithm to solve linear programs.", new EnumValue<LpAlgorithmValues>(LpAlgorithmValues.DualSimplex))); 142 new FixedValueParameter<BoolValue>(nameof(Presolve), "Advanced usage: presolve mode.", 143 new BoolValue(SolverParameters.DefaultPresolve == SolverParameters.PresolveValues.PresolveOn)) { Hidden = true }); 89 144 Parameters.Add(dualToleranceParam = new FixedValueParameter<DoubleValue>(nameof(DualTolerance), 90 145 "Advanced usage: tolerance for dual feasibility of basic solutions.", 91 new DoubleValue( MPSolverParameters.kDefaultDualTolerance)));146 new DoubleValue(SolverParameters.DefaultDualTolerance)) { Hidden = true }); 92 147 Parameters.Add(primalToleranceParam = new FixedValueParameter<DoubleValue>(nameof(PrimalTolerance), 93 148 "Advanced usage: tolerance for primal feasibility of basic solutions. " + 94 149 "This does not control the integer feasibility tolerance of integer " + 95 150 "solutions for MIP or the tolerance used during presolve.", 96 new DoubleValue( MPSolverParameters.kDefaultPrimalTolerance)));151 new DoubleValue(SolverParameters.DefaultPrimalTolerance)) { Hidden = true }); 97 152 Parameters.Add(scalingParam = new FixedValueParameter<BoolValue>(nameof(Scaling), 98 "Advanced usage: enable or disable matrix scaling.", new BoolValue())); 99 Parameters.Add(exportModelParam = 100 new FixedValueParameter<FileValue>(nameof(ExportModel), 101 "Path of the file the model should be exported to. Run the algorithm to export the model.", 102 new FileValue { 103 SaveFile = true, 104 FileDialogFilter = "CPLEX LP File (*.lp)|*.lp|" + 105 "Mathematical Programming System File (*.mps)|*.mps|" + 106 "Google OR-Tools Protocol Buffers Text File (*.prototxt)|*.prototxt|" + 107 "Google OR-Tools Protocol Buffers Binary File (*.bin)|*.bin" 108 })); 109 110 Problem = new LinearProgrammingProblem(); 153 "Advanced usage: enable or disable matrix scaling.", new BoolValue()) { Hidden = true }); 154 155 Problem = new LinearProblem(); 111 156 } 112 157 113 158 [StorableConstructor] 114 pr otectedLinearProgrammingAlgorithm(bool deserializing)159 private LinearProgrammingAlgorithm(bool deserializing) 115 160 : base(deserializing) { 116 161 } 117 162 118 pr otectedLinearProgrammingAlgorithm(LinearProgrammingAlgorithm original, Cloner cloner)163 private LinearProgrammingAlgorithm(LinearProgrammingAlgorithm original, Cloner cloner) 119 164 : base(original, cloner) { 120 165 linearSolverParam = cloner.Clone(original.linearSolverParam); … … 122 167 timeLimitParam = cloner.Clone(original.timeLimitParam); 123 168 presolveParam = cloner.Clone(original.presolveParam); 124 lpAlgorithmParam = cloner.Clone(original.lpAlgorithmParam);125 169 dualToleranceParam = cloner.Clone(original.dualToleranceParam); 126 170 primalToleranceParam = cloner.Clone(original.primalToleranceParam); 127 171 scalingParam = cloner.Clone(original.scalingParam); 128 exportModelParam = cloner.Clone(original.exportModelParam);129 }130 131 public double DualTolerance {132 get => dualToleranceParam.Value.Value;133 set => dualToleranceParam.Value.Value = value;134 }135 136 public string ExportModel {137 get => exportModelParam.Value.Value;138 set => exportModelParam.Value.Value = value;139 }140 141 public ILinearSolver LinearSolver {142 get => linearSolverParam.Value;143 set => linearSolverParam.Value = value;144 }145 146 public IConstrainedValueParameter<ILinearSolver> LinearSolverParameter {147 get => linearSolverParam;148 set => linearSolverParam = value;149 }150 151 public LpAlgorithmValues LpAlgorithm {152 get => lpAlgorithmParam.Value.Value;153 set => lpAlgorithmParam.Value.Value = value;154 }155 156 public bool Presolve {157 get => presolveParam.Value.Value;158 set => presolveParam.Value.Value = value;159 }160 161 public double PrimalTolerance {162 get => primalToleranceParam.Value.Value;163 set => primalToleranceParam.Value.Value = value;164 }165 166 public new LinearProgrammingProblem Problem {167 get => (LinearProgrammingProblem)base.Problem;168 set => base.Problem = value;169 }170 171 public override Type ProblemType { get; } = typeof(LinearProgrammingProblem);172 173 public double RelativeGapTolerance {174 get => relativeGapToleranceParam.Value.Value;175 set => relativeGapToleranceParam.Value.Value = value;176 }177 178 public override ResultCollection Results { get; } = new ResultCollection();179 180 public bool Scaling {181 get => scalingParam.Value.Value;182 set => scalingParam.Value.Value = value;183 }184 185 public override bool SupportsPause => LinearSolver.SupportsPause;186 187 public override bool SupportsStop => LinearSolver.SupportsStop;188 189 public TimeSpan TimeLimit {190 get => timeLimitParam.Value.Value;191 set => timeLimitParam.Value.Value = value;192 172 } 193 173 … … 216 196 LinearSolver.PrimalTolerance = PrimalTolerance; 217 197 LinearSolver.DualTolerance = DualTolerance; 218 LinearSolver.LpAlgorithm = LpAlgorithm;219 198 LinearSolver.Presolve = Presolve; 220 199 LinearSolver.RelativeGapTolerance = RelativeGapTolerance; 221 200 LinearSolver.Scaling = Scaling; 222 201 LinearSolver.TimeLimit = TimeLimit; 223 LinearSolver.ExportModel = ExportModel; 224 var executionTime = ExecutionTime; 225 ExecutionTimeChanged += (sender, args) => executionTime = ExecutionTime; 226 LinearSolver.Solve(Problem.ProblemDefinition, ref executionTime, Results, cancellationToken); 202 LinearSolver.Solve(Problem.ProblemDefinition, Results, cancellationToken); 227 203 } 228 204 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/LinearSolverExtensions.cs
r16417 r16582 22 22 using Google.OrTools.LinearSolver; 23 23 24 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {24 namespace HeuristicLab.ExactOptimization.LinearProgramming { 25 25 26 26 public static class LinearSolverExtensions { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/ProblemType.cs
r16405 r16582 20 20 #endregion 21 21 22 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {22 namespace HeuristicLab.ExactOptimization.LinearProgramming { 23 23 24 24 public enum ProblemType { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/ProtoWriteFormat.cs
r16405 r16582 20 20 #endregion 21 21 22 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {22 namespace HeuristicLab.ExactOptimization.LinearProgramming { 23 23 24 24 public enum ProtoWriteFormat { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/SolverResponseStatus.cs
r16405 r16582 20 20 #endregion 21 21 22 namespace HeuristicLab.MathematicalOptimization.LinearProgramming { 22 using Google.OrTools.LinearSolver; 23 24 namespace HeuristicLab.ExactOptimization.LinearProgramming { 23 25 24 26 public enum SolverResponseStatus { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/ExternalIncrementalLinearSolver.cs
r16405 r16582 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {28 namespace HeuristicLab.ExactOptimization.LinearProgramming { 29 29 30 30 [StorableClass] … … 53 53 } 54 54 55 protected override Solver CreateSolver(OptimizationProblemType optimizationProblemType, 55 public IFixedValueParameter<FileValue> LibraryNameParameter => libraryNameParam; 56 57 protected override Solver CreateSolver(Solver.OptimizationProblemType optimizationProblemType, 56 58 string libraryName = null) => base.CreateSolver(optimizationProblemType, LibraryName); 57 59 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/ExternalLinearSolver.cs
r16405 r16582 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {28 namespace HeuristicLab.ExactOptimization.LinearProgramming { 29 29 30 30 [StorableClass] … … 53 53 } 54 54 55 protected override Solver CreateSolver(OptimizationProblemType optimizationProblemType, 55 public IFixedValueParameter<FileValue> LibraryNameParameter => libraryNameParam; 56 57 protected override Solver CreateSolver(Solver.OptimizationProblemType optimizationProblemType, 56 58 string libraryName = null) => base.CreateSolver(optimizationProblemType, LibraryName); 57 59 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/IExternalLinearSolver.cs
r16405 r16582 20 20 #endregion 21 21 22 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {22 namespace HeuristicLab.ExactOptimization.LinearProgramming { 23 23 24 24 public interface IExternalLinearSolver : ILinearSolver { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/IIncrementalLinearSolver.cs
r16405 r16582 22 22 using System; 23 23 24 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {24 namespace HeuristicLab.ExactOptimization.LinearProgramming { 25 25 26 26 public interface IIncrementalLinearSolver : ILinearSolver { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/ILinearSolver.cs
r16405 r16582 25 25 using HeuristicLab.Optimization; 26 26 27 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {27 namespace HeuristicLab.ExactOptimization.LinearProgramming { 28 28 29 29 public interface ILinearSolver : IParameterizedNamedItem { 30 30 double DualTolerance { get; set; } 31 32 string ExportModel { get; set; }33 34 bool Incrementality { get; set; }35 36 LpAlgorithmValues LpAlgorithm { get; set; }37 31 38 32 bool Presolve { get; set; } … … 56 50 void Reset(); 57 51 58 void Solve(ILinearPro grammingProblemDefinition problemDefintion, ref TimeSpan executionTime, ResultCollection results);52 void Solve(ILinearProblemDefinition problemDefintion, ResultCollection results); 59 53 60 void Solve(ILinearPro grammingProblemDefinition problemDefintion, ref TimeSpan executionTime,54 void Solve(ILinearProblemDefinition problemDefintion, 61 55 ResultCollection results, CancellationToken cancellationToken); 62 56 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/IncrementalLinearSolver.cs
r16405 r16582 21 21 22 22 using System; 23 using System.Diagnostics; 23 24 using System.Linq; 24 25 using System.Threading; … … 31 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 33 33 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {34 namespace HeuristicLab.ExactOptimization.LinearProgramming { 34 35 35 36 [StorableClass] 36 37 public class IncrementalLinearSolver : LinearSolver, IIncrementalLinearSolver { 37 [Storable] protected readonly IValueParameter<TimeSpanValue> qualityUpdateIntervalParam;38 38 39 private IndexedDataRow<double> bpcRow; 39 [Storable] 40 protected readonly IValueParameter<TimeSpanValue> qualityUpdateIntervalParam; 40 41 41 private IndexedDataRow<double> qpcRow;42 private readonly Stopwatch stopwatch = new Stopwatch(); 42 43 43 [Storable] private IndexedDataTable<double> qualityPerClock; 44 [Storable] 45 private TimeSpan executionTime = TimeSpan.Zero; 46 47 [Storable] 48 private IndexedDataTable<double> qualityPerClock; 44 49 45 50 public IncrementalLinearSolver() { … … 77 82 } 78 83 84 public IValueParameter<TimeSpanValue> QualityUpdateIntervalParameter => qualityUpdateIntervalParam; 85 79 86 public virtual bool SupportsQualityUpdate => true; 87 80 88 protected virtual TimeSpan IntermediateTimeLimit => QualityUpdateInterval; 81 89 82 public override void Solve(ILinearProgrammingProblemDefinition problemDefinition, ref TimeSpan executionTime, 90 public override void Reset() { 91 base.Reset(); 92 stopwatch.Reset(); 93 executionTime = TimeSpan.Zero; 94 } 95 96 public override void Solve(ILinearProblemDefinition problemDefinition, 83 97 ResultCollection results, CancellationToken cancellationToken) { 84 98 if (!SupportsQualityUpdate || QualityUpdateInterval == TimeSpan.Zero) { 85 base.Solve(problemDefinition, re f executionTime, results, cancellationToken);99 base.Solve(problemDefinition, results, cancellationToken); 86 100 return; 87 101 } … … 102 116 return; 103 117 118 stopwatch.Start(); 104 119 Solve(problemDefinition, results, IntermediateTimeLimit); 120 stopwatch.Stop(); 121 executionTime += stopwatch.Elapsed; 105 122 UpdateQuality(results, executionTime); 106 123 … … 120 137 121 138 private void UpdateQuality(ResultCollection results, TimeSpan executionTime) { 139 IndexedDataRow<double> qpcRow; 140 IndexedDataRow<double> bpcRow; 141 122 142 if (!results.Exists(r => r.Name == "QualityPerClock")) { 123 143 qualityPerClock = new IndexedDataTable<double>("Quality per Clock"); 124 144 qpcRow = new IndexedDataRow<double>("Objective Value"); 125 145 bpcRow = new IndexedDataRow<double>("Bound"); 146 qualityPerClock.Rows.Add(qpcRow); 147 qualityPerClock.Rows.Add(bpcRow); 126 148 results.AddOrUpdateResult("QualityPerClock", qualityPerClock); 149 } else { 150 qpcRow = qualityPerClock.Rows["Objective Value"]; 151 bpcRow = qualityPerClock.Rows["Bound"]; 127 152 } 128 153 … … 133 158 134 159 var objective = ((DoubleValue)results["BestObjectiveValue"].Value).Value; 135 var bound = solver.IsM IP() ? ((DoubleValue)results["BestObjectiveBound"].Value).Value : double.NaN;160 var bound = solver.IsMip() ? ((DoubleValue)results["BestObjectiveBound"].Value).Value : double.NaN; 136 161 var time = executionTime.TotalSeconds; 137 162 … … 140 165 qpcRow.Values.Add(Tuple.Create(time, objective)); 141 166 qpcRow.Values.Add(Tuple.Create(time, objective)); 142 qualityPerClock.Rows.Add(qpcRow);143 167 results.AddOrUpdateResult("BestObjectiveValueFoundAt", new TimeSpanValue(TimeSpan.FromSeconds(time))); 144 168 } … … 152 176 } 153 177 154 if (!solver.IsM IP())178 if (!solver.IsMip()) 155 179 return; 156 180 … … 159 183 bpcRow.Values.Add(Tuple.Create(time, bound)); 160 184 bpcRow.Values.Add(Tuple.Create(time, bound)); 161 qualityPerClock.Rows.Add(bpcRow);162 185 } 163 186 } else { -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/Base/LinearSolver.cs
r16405 r16582 34 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 35 35 36 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {36 namespace HeuristicLab.ExactOptimization.LinearProgramming { 37 37 38 38 [StorableClass] … … 49 49 public LinearSolver() { 50 50 Parameters.Add(problemTypeParam = 51 new ValueParameter<EnumValue<ProblemType>>(nameof(ProblemType), new EnumValue<ProblemType>())); 51 new ValueParameter<EnumValue<ProblemType>>(nameof(ProblemType), 52 new EnumValue<ProblemType>(ProblemType.MixedIntegerProgramming))); 52 53 Parameters.Add(solverSpecificParametersParam = 53 54 new FixedValueParameter<TextValue>(nameof(SolverSpecificParameters), new TextValue())); … … 65 66 } 66 67 67 public double DualTolerance { get; set; } = MPSolverParameters.kDefaultDualTolerance; 68 69 public string ExportModel { get; set; } 68 public double DualTolerance { get; set; } = SolverParameters.DefaultDualTolerance; 70 69 71 70 public bool Incrementality { get; set; } = 72 MPSolverParameters.kDefaultIncrementality == MPSolverParameters.INCREMENTALITY_ON; 73 74 public LpAlgorithmValues LpAlgorithm { get; set; } 75 76 public bool Presolve { get; set; } = MPSolverParameters.kDefaultPresolve == MPSolverParameters.PRESOLVE_ON; 77 78 public double PrimalTolerance { get; set; } = MPSolverParameters.kDefaultPrimalTolerance; 71 SolverParameters.DefaultIncrementality == SolverParameters.IncrementalityValues.IncrementalityOn; 72 73 public SolverParameters.LpAlgorithmValues LpAlgorithm { get; set; } 74 protected virtual Solver.OptimizationProblemType OptimizationProblemType { get; } 75 public bool Presolve { get; set; } = SolverParameters.DefaultPresolve == SolverParameters.PresolveValues.PresolveOn; 76 public double PrimalTolerance { get; set; } = SolverParameters.DefaultPrimalTolerance; 79 77 80 78 public ProblemType ProblemType { … … 83 81 } 84 82 85 public double RelativeGapTolerance { get; set; } = MPSolverParameters.kDefaultRelativeMipGap;86 83 public IValueParameter<EnumValue<ProblemType>> ProblemTypeParameter => problemTypeParam; 84 public double RelativeGapTolerance { get; set; } = SolverParameters.DefaultRelativeMipGap; 87 85 public bool Scaling { get; set; } 88 86 … … 92 90 } 93 91 92 public IFixedValueParameter<TextValue> SolverSpecificParametersParameter => solverSpecificParametersParam; 94 93 public virtual bool SupportsPause => true; 95 94 public virtual bool SupportsStop => true; 96 95 public virtual TimeSpan TimeLimit { get; set; } = TimeSpan.Zero; 97 protected virtual OptimizationProblemType OptimizationProblemType { get; }98 96 99 97 public override IDeepCloneable Clone(Cloner cloner) => new LinearSolver(this, cloner); … … 118 116 119 117 public bool ExportAsProto(string fileName, ProtoWriteFormat writeFormat = ProtoWriteFormat.ProtoBinary) => 120 solver != null && solver.ExportModelAsProtoFormat(fileName, (int)writeFormat); 121 122 public SolverResponseStatus ImportFromMps(string fileName, bool? fixedFormat) => solver == null 123 ? SolverResponseStatus.Abnormal 124 : (SolverResponseStatus)solver.ImportModelFromMpsFormat(fileName, fixedFormat.HasValue, fixedFormat ?? false); 125 126 public SolverResponseStatus ImportFromProto(string fileName) => solver == null 127 ? SolverResponseStatus.Abnormal 128 : (SolverResponseStatus)solver.ImportModelFromProtoFormat(fileName); 118 solver != null && solver.ExportModelAsProtoFormat(fileName, (Google.OrTools.LinearSolver.ProtoWriteFormat)writeFormat); 119 120 public MPSolverResponseStatus ImportFromMps(string fileName, bool? fixedFormat) => 121 solver?.ImportModelFromMpsFormat(fileName, fixedFormat.HasValue, fixedFormat ?? false) ?? 122 (MPSolverResponseStatus)SolverResponseStatus.Abnormal; 123 124 public MPSolverResponseStatus ImportFromProto(string fileName) => 125 solver?.ImportModelFromProtoFormat(fileName) ?? (MPSolverResponseStatus)SolverResponseStatus.Abnormal; 129 126 130 127 public bool InterruptSolve() => solver?.InterruptSolve() ?? false; … … 135 132 } 136 133 137 public virtual void Solve(ILinearPro grammingProblemDefinition problemDefintion, ref TimeSpan executionTime,134 public virtual void Solve(ILinearProblemDefinition problemDefintion, 138 135 ResultCollection results, CancellationToken cancellationToken) => 139 Solve(problemDefintion, re f executionTime, results);140 141 public virtual void Solve(ILinearPro grammingProblemDefinition problemDefinition, ref TimeSpan executionTime,136 Solve(problemDefintion, results); 137 138 public virtual void Solve(ILinearProblemDefinition problemDefinition, 142 139 ResultCollection results) => 143 140 Solve(problemDefinition, results, TimeLimit); 144 141 145 public virtual void Solve(ILinearPro grammingProblemDefinition problemDefinition, ResultCollection results,142 public virtual void Solve(ILinearProblemDefinition problemDefinition, ResultCollection results, 146 143 TimeSpan timeLimit) { 147 144 if (solver == null) { … … 158 155 ResultStatus resultStatus; 159 156 160 using (var parameters = new MPSolverParameters()) { 161 parameters.SetDoubleParam(MPSolverParameters.RELATIVE_MIP_GAP, RelativeGapTolerance); 162 parameters.SetDoubleParam(MPSolverParameters.PRIMAL_TOLERANCE, PrimalTolerance); 163 parameters.SetDoubleParam(MPSolverParameters.DUAL_TOLERANCE, DualTolerance); 164 parameters.SetIntegerParam(MPSolverParameters.PRESOLVE, 165 Presolve ? MPSolverParameters.PRESOLVE_ON : MPSolverParameters.PRESOLVE_OFF); 166 parameters.SetIntegerParam(MPSolverParameters.LP_ALGORITHM, (int)LpAlgorithm); 167 parameters.SetIntegerParam(MPSolverParameters.INCREMENTALITY, 168 Incrementality ? MPSolverParameters.INCREMENTALITY_ON : MPSolverParameters.INCREMENTALITY_OFF); 169 parameters.SetIntegerParam(MPSolverParameters.SCALING, 170 Scaling ? MPSolverParameters.SCALING_ON : MPSolverParameters.SCALING_OFF); 157 using (var parameters = new SolverParameters()) { 158 parameters.SetDoubleParam(SolverParameters.DoubleParam.RelativeMipGap, RelativeGapTolerance); 159 parameters.SetDoubleParam(SolverParameters.DoubleParam.PrimalTolerance, PrimalTolerance); 160 parameters.SetDoubleParam(SolverParameters.DoubleParam.DualTolerance, DualTolerance); 161 parameters.SetIntegerParam(SolverParameters.IntegerParam.Presolve, 162 (int)(Presolve ? SolverParameters.PresolveValues.PresolveOn : SolverParameters.PresolveValues.PresolveOff)); 163 parameters.SetIntegerParam(SolverParameters.IntegerParam.Incrementality, 164 (int)(Incrementality ? SolverParameters.IncrementalityValues.IncrementalityOn : SolverParameters.IncrementalityValues.IncrementalityOff)); 165 parameters.SetIntegerParam(SolverParameters.IntegerParam.Scaling, 166 (int)(Scaling ? SolverParameters.ScalingValues.ScalingOn : SolverParameters.ScalingValues.ScalingOff)); 171 167 172 168 if (!solver.SetSolverSpecificParametersAsString(SolverSpecificParameters)) 173 169 throw new ArgumentException("Solver specific parameters could not be set."); 174 170 175 if (!string.IsNullOrWhiteSpace(ExportModel)) {176 var fileInfo = new FileInfo(ExportModel);177 178 if (!fileInfo.Directory?.Exists ?? false) {179 Directory.CreateDirectory(fileInfo.Directory.FullName);180 }181 182 bool exportSuccessful;183 switch (fileInfo.Extension) {184 case ".lp":185 exportSuccessful = ExportAsLp(ExportModel);186 break;187 188 case ".mps":189 exportSuccessful = ExportAsMps(ExportModel);190 break;191 192 case ".prototxt":193 exportSuccessful = ExportAsProto(ExportModel, ProtoWriteFormat.ProtoText);194 break;195 196 case ".bin": // remove file extension as it is added by OR-Tools197 exportSuccessful = ExportAsProto(Path.ChangeExtension(ExportModel, null));198 break;199 200 default:201 throw new NotSupportedException("File format selected to export model is not supported.");202 }203 }204 205 // TODO: show warning if file export didn't work (if exportSuccessful is false)206 207 171 resultStatus = (ResultStatus)solver.Solve(parameters); 208 172 } … … 211 175 212 176 problemDefinition.Analyze(solver, results); 213 results.AddOrUpdateResult("ResultStatus", new EnumValue<ResultStatus>(resultStatus)); 214 results.AddOrUpdateResult("BestObjectiveValue", new DoubleValue(objectiveValue ?? double.NaN)); 215 216 if (solver.IsMIP()) { 177 178 if (solver.IsMip()) { 217 179 var objectiveBound = solver.Objective()?.BestBound(); 218 180 var absoluteGap = objectiveValue.HasValue && objectiveBound.HasValue … … 224 186 : (double?)null; 225 187 188 if (resultStatus == ResultStatus.Optimal && absoluteGap.HasValue && !absoluteGap.Value.IsAlmost(0)) { 189 resultStatus = ResultStatus.OptimalWithinTolerance; 190 } 191 226 192 results.AddOrUpdateResult("BestObjectiveBound", new DoubleValue(objectiveBound ?? double.NaN)); 227 193 results.AddOrUpdateResult("AbsoluteGap", new DoubleValue(absoluteGap ?? double.NaN)); … … 229 195 } 230 196 197 results.AddOrUpdateResult("ResultStatus", new EnumValue<ResultStatus>(resultStatus)); 198 results.AddOrUpdateResult("BestObjectiveValue", new DoubleValue(objectiveValue ?? double.NaN)); 199 231 200 results.AddOrUpdateResult("NumberOfConstraints", new IntValue(solver.NumConstraints())); 232 201 results.AddOrUpdateResult("NumberOfVariables", new IntValue(solver.NumVariables())); 233 202 234 if (solver.IsM IP() && solver.Nodes() >= 0) {203 if (solver.IsMip() && solver.Nodes() >= 0) { 235 204 results.AddOrUpdateResult(nameof(solver.Nodes), new DoubleValue(solver.Nodes())); 236 205 } … … 243 212 } 244 213 245 protected virtual Solver CreateSolver( OptimizationProblemType optimizationProblemType, string libraryName = null) {214 protected virtual Solver CreateSolver(Solver.OptimizationProblemType optimizationProblemType, string libraryName = null) { 246 215 if (!string.IsNullOrEmpty(libraryName) && !File.Exists(libraryName)) { 247 216 var paths = new List<string> { … … 256 225 257 226 try { 258 solver = new Solver(Name, (int)optimizationProblemType, libraryName ?? string.Empty);227 solver = new Solver(Name, optimizationProblemType, libraryName ?? string.Empty); 259 228 } catch { 260 229 throw new InvalidOperationException($"Could not create {optimizationProblemType}."); -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/BopSolver.cs
r16405 r16582 21 21 22 22 using System; 23 using Google.OrTools.LinearSolver; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 29 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {30 namespace HeuristicLab.ExactOptimization.LinearProgramming { 30 31 31 32 [Item("BOP", "BOP (https://developers.google.com/optimization/reference/bop/bop_solver/) can be used out of the box.")] … … 52 53 } 53 54 54 protected override OptimizationProblemType OptimizationProblemType => 55 OptimizationProblemType.BopIntegerProgramming; 55 protected override Solver.OptimizationProblemType OptimizationProblemType => 56 Solver.OptimizationProblemType.BopIntegerProgramming; 57 58 public override IDeepCloneable Clone(Cloner cloner) => new BopSolver(this, cloner); 56 59 } 57 60 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/CoinOrSolver.cs
r16405 r16582 20 20 #endregion 21 21 22 using System;22 using Google.OrTools.LinearSolver; 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Optimization;26 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 26 28 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {27 namespace HeuristicLab.ExactOptimization.LinearProgramming { 29 28 30 29 [Item("Clp/Cbc", "Clp (https://projects.coin-or.org/Clp) and Cbc (https://projects.coin-or.org/Cbc) can be used out of the box.")] … … 51 50 public override bool SupportsStop => false; 52 51 53 protected override OptimizationProblemType OptimizationProblemType =>52 protected override Solver.OptimizationProblemType OptimizationProblemType => 54 53 ProblemType == ProblemType.LinearProgramming 55 ? OptimizationProblemType.ClpLinearProgramming56 : OptimizationProblemType.CbcMixedIntegerProgramming;54 ? Solver.OptimizationProblemType.ClpLinearProgramming 55 : Solver.OptimizationProblemType.CbcMixedIntegerProgramming; 57 56 58 public override void Solve(ILinearProgrammingProblemDefinition problemDefinition, ResultCollection results, TimeSpan timeLimit) { 59 // TODO: warning that solver cannot be stopped or paused 60 base.Solve(problemDefinition, results, timeLimit); 61 } 57 public override IDeepCloneable Clone(Cloner cloner) => new CoinOrSolver(this, cloner); 62 58 } 63 59 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/CplexSolver.cs
r16405 r16582 21 21 22 22 using System; 23 using Google.OrTools.LinearSolver; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 29 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {30 namespace HeuristicLab.ExactOptimization.LinearProgramming { 30 31 31 32 [Item("CPLEX", "CPLEX (https://www.ibm.com/analytics/cplex-optimizer) must be installed and licenced.")] … … 40 41 "# for file format, see https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/FileFormats/topics/PRM.html" + Environment.NewLine + 41 42 "# for parameters, see https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/introListTopical.html" + Environment.NewLine + 42 "# example:" + Environment.NewLine + 43 "# CPXPARAM_RandomSeed 10" + Environment.NewLine; 43 "# examples:" + Environment.NewLine + 44 "# CPXPARAM_RandomSeed 10" + Environment.NewLine + 45 "# CPXPARAM_LPMethod 4 # Barrier (LP)" + Environment.NewLine + 46 "# CPXPARAM_MIP_Strategy_SubAlgorithm 4 # Barrier (MIP)" + Environment.NewLine + 47 "# CPXPARAM_MIP_Strategy_Search 2 # Apply dynamic search (MIP)" + Environment.NewLine; 44 48 } 45 49 … … 53 57 } 54 58 55 protected override OptimizationProblemType OptimizationProblemType =>59 protected override Solver.OptimizationProblemType OptimizationProblemType => 56 60 ProblemType == ProblemType.LinearProgramming 57 ? OptimizationProblemType.CplexLinearProgramming 58 : OptimizationProblemType.CplexMixedIntegerProgramming; 61 ? Solver.OptimizationProblemType.CplexLinearProgramming 62 : Solver.OptimizationProblemType.CplexMixedIntegerProgramming; 63 64 public override IDeepCloneable Clone(Cloner cloner) => new CplexSolver(this, cloner); 59 65 } 60 66 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/GlopSolver.cs
r16405 r16582 21 21 22 22 using System; 23 using Google.OrTools.LinearSolver; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 28 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {29 namespace HeuristicLab.ExactOptimization.LinearProgramming { 29 30 30 31 [Item("Glop", "Glop (https://developers.google.com/optimization/lp/glop) can be used out of the box.")] … … 37 38 "# for file format, see Protocol Buffers text format (https://developers.google.com/protocol-buffers/docs/overview#whynotxml)" + Environment.NewLine + 38 39 "# for parameters, see https://github.com/google/or-tools/blob/v6.10/ortools/glop/parameters.proto" + Environment.NewLine + 39 "# example:" + Environment.NewLine + 40 "# random_seed: 10" + Environment.NewLine; 40 "# examples:" + Environment.NewLine + 41 "# random_seed: 10" + Environment.NewLine + 42 "# use_dual_simplex: true (LP)" + Environment.NewLine; 41 43 } 42 44 … … 50 52 } 51 53 52 protected override OptimizationProblemType OptimizationProblemType => 53 OptimizationProblemType.GlopLinearProgramming; 54 protected override Solver.OptimizationProblemType OptimizationProblemType => 55 Solver.OptimizationProblemType.GlopLinearProgramming; 56 57 public override IDeepCloneable Clone(Cloner cloner) => new GlopSolver(this, cloner); 54 58 } 55 59 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/GlpkSolver.cs
r16405 r16582 20 20 #endregion 21 21 22 using Google.OrTools.LinearSolver; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 28 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {29 namespace HeuristicLab.ExactOptimization.LinearProgramming { 29 30 30 31 [Item("GLPK", "GLPK (https://www.gnu.org/software/glpk/) can be used out of the box.")] … … 49 50 public override bool SupportsPause => false; 50 51 51 protected override OptimizationProblemType OptimizationProblemType =>52 protected override Solver.OptimizationProblemType OptimizationProblemType => 52 53 ProblemType == ProblemType.LinearProgramming 53 ? OptimizationProblemType.GlpkLinearProgramming 54 : OptimizationProblemType.GlpkMixedIntegerProgramming; 54 ? Solver.OptimizationProblemType.GlpkLinearProgramming 55 : Solver.OptimizationProblemType.GlpkMixedIntegerProgramming; 56 57 public override IDeepCloneable Clone(Cloner cloner) => new GlpkSolver(this, cloner); 55 58 } 56 59 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/GurobiSolver.cs
r16405 r16582 21 21 22 22 using System; 23 using Google.OrTools.LinearSolver; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 29 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {30 namespace HeuristicLab.ExactOptimization.LinearProgramming { 30 31 31 32 [Item("Gurobi", "Gurobi (http://www.gurobi.com/) must be installed and licenced.")] … … 39 40 "# for file format, see http://www.gurobi.com/documentation/8.1/refman/prm_format.html" + Environment.NewLine + 40 41 "# for parameters, see http://www.gurobi.com/documentation/8.1/refman/parameters.html" + Environment.NewLine + 41 "# example:" + Environment.NewLine + 42 "# Seed 10" + Environment.NewLine; 42 "# examples:" + Environment.NewLine + 43 "# Seed 10" + Environment.NewLine + 44 "# Method 2 # Barrier (LP, root node of MIP)" + Environment.NewLine + 45 "# NodeMethod 2 # Barrier (MIP)" + Environment.NewLine; 43 46 } 44 47 … … 53 56 } 54 57 55 protected override OptimizationProblemType OptimizationProblemType =>58 protected override Solver.OptimizationProblemType OptimizationProblemType => 56 59 ProblemType == ProblemType.LinearProgramming 57 ? OptimizationProblemType.GurobiLinearProgramming 58 : OptimizationProblemType.GurobiMixedIntegerProgramming; 60 ? Solver.OptimizationProblemType.GurobiLinearProgramming 61 : Solver.OptimizationProblemType.GurobiMixedIntegerProgramming; 62 63 public override IDeepCloneable Clone(Cloner cloner) => new GurobiSolver(this, cloner); 59 64 } 60 65 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Algorithms/Solvers/ScipSolver.cs
r16405 r16582 22 22 using System; 23 23 using System.Threading; 24 using Google.OrTools.LinearSolver; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 29 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 31 31 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {32 namespace HeuristicLab.ExactOptimization.LinearProgramming { 32 33 33 34 [Item("SCIP", "SCIP (http://scip.zib.de/) must be installed and licenced.")] … … 43 44 SolverSpecificParameters = 44 45 "# for file format and parameters, see https://scip.zib.de/doc/html/PARAMETERS.php" + Environment.NewLine + 45 "# example:" + Environment.NewLine + 46 "# branching/random/seed = 10" + Environment.NewLine; 46 "# examples:" + Environment.NewLine + 47 "# branching/random/seed = 10" + Environment.NewLine + 48 "# lp/initalgorithm = b # Barrier (root node of MIP)" + Environment.NewLine + 49 "# lp/resolvealgorithm = b # Barrier (MIP)" + Environment.NewLine; 47 50 } 48 51 … … 56 59 } 57 60 61 protected override Solver.OptimizationProblemType OptimizationProblemType => 62 Solver.OptimizationProblemType.ScipMixedIntegerProgramming; 63 58 64 protected override TimeSpan IntermediateTimeLimit => timeLimit += QualityUpdateInterval; 59 65 60 protected override OptimizationProblemType OptimizationProblemType => 61 OptimizationProblemType.ScipMixedIntegerProgramming; 66 public override IDeepCloneable Clone(Cloner cloner) => new ScipSolver(this, cloner); 62 67 63 public override void Solve(ILinearPro grammingProblemDefinition problemDefintion, ref TimeSpan executionTime, ResultCollection results, CancellationToken cancellationToken) {68 public override void Solve(ILinearProblemDefinition problemDefintion, ResultCollection results, CancellationToken cancellationToken) { 64 69 timeLimit = TimeSpan.Zero; 65 base.Solve(problemDefintion, re f executionTime, results, cancellationToken);70 base.Solve(problemDefintion, results, cancellationToken); 66 71 } 67 72 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Problems/CompiledProblemDefinition.cs
r16405 r16582 20 20 #endregion 21 21 22 namespace HeuristicLab.MathematicalOptimization.LinearProgramming { 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 23 24 24 public abstract class CompiledProblemDefinition { 25 namespace HeuristicLab.ExactOptimization.LinearProgramming { 26 27 public class CompiledProblemDefinition : Item { 28 29 public CompiledProblemDefinition() { 30 } 31 32 protected CompiledProblemDefinition(CompiledProblemDefinition original, Cloner cloner) : base(original, cloner) { 33 } 34 25 35 public dynamic vars { get; set; } 26 36 27 public abstract void Initialize(); 37 public override IDeepCloneable Clone(Cloner cloner) => 38 new CompiledProblemDefinition(this, cloner); 39 40 public virtual void Initialize() { 41 } 28 42 } 29 43 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Problems/FileBasedLinearProblemDefinition.cs
r16581 r16582 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 32 33 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {33 namespace HeuristicLab.ExactOptimization.LinearProgramming { 34 34 35 [Item(" File-Based Linear/Mixed Integer Programming Problem Definition", "File that defines the model for linear/mixed integer programming problem.")]35 [Item("Linear Problem Definition File (MPS, OR-Tools Protocol Buffers Files)", "File that defines the model for linear/mixed integer programming problem.")] 36 36 [StorableClass] 37 public sealed class FileBasedLinearPro grammingProblemDefinition : ParameterizedNamedItem, ILinearProgrammingProblemDefinition {37 public sealed class FileBasedLinearProblemDefinition : ParameterizedNamedItem, ILinearProblemDefinition { 38 38 39 39 [Storable] … … 43 43 private byte[] fileContent; 44 44 45 public FileBasedLinearPro grammingProblemDefinition() {45 public FileBasedLinearProblemDefinition() { 46 46 Parameters.Add(fileNameParam = new FixedValueParameter<FileValue>(nameof(FileName), new FileValue())); 47 47 fileNameParam.Value.FileDialogFilter = … … 57 57 } 58 58 59 private FileBasedLinearPro grammingProblemDefinition(FileBasedLinearProgrammingProblemDefinition original, Cloner cloner)59 private FileBasedLinearProblemDefinition(FileBasedLinearProblemDefinition original, Cloner cloner) 60 60 : base(original, cloner) { 61 61 fileNameParam = cloner.Clone(original.fileNameParam); … … 63 63 64 64 [StorableConstructor] 65 private FileBasedLinearPro grammingProblemDefinition(bool deserializing) : base(deserializing) { }65 private FileBasedLinearProblemDefinition(bool deserializing) : base(deserializing) { } 66 66 67 67 public new static Image StaticItemImage => VSImageLibrary.File; … … 80 80 var fileInfo = new FileInfo(FileName); 81 81 var tempFileName = Path.GetTempFileName(); 82 File.WriteAllBytes(tempFileName, fileContent);83 82 84 var status = (SolverResponseStatus)(fileInfo.Extension == ".mps" 85 ? solver.ImportModelFromMpsFormat(tempFileName) 86 : solver.ImportModelFromProtoFormat(tempFileName)); 83 try { 84 File.WriteAllBytes(tempFileName, fileContent); 87 85 88 if (status == SolverResponseStatus.Abnormal) 89 throw new FileFormatException($"'{FileName}' is not a valid MPS or Google OR-Tools Protocol Buffers file."); 86 var status = (SolverResponseStatus)(fileInfo.Extension == ".mps" 87 ? solver.ImportModelFromMpsFormat(tempFileName) 88 : solver.ImportModelFromProtoFormat(tempFileName)); 90 89 91 File.Delete(tempFileName); 90 if (status == SolverResponseStatus.Abnormal) 91 throw new FileFormatException($"'{FileName}' is not a valid MPS or Google OR-Tools Protocol Buffers file."); 92 } finally { 93 File.Delete(tempFileName); 94 } 92 95 } 93 96 94 public override IDeepCloneable Clone(Cloner cloner) => new FileBasedLinearPro grammingProblemDefinition(this, cloner);97 public override IDeepCloneable Clone(Cloner cloner) => new FileBasedLinearProblemDefinition(this, cloner); 95 98 } 96 99 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Problems/ILinearProblemDefinition.cs
r16581 r16582 21 21 22 22 using Google.OrTools.LinearSolver; 23 using HeuristicLab.Co mmon;23 using HeuristicLab.Core; 24 24 using HeuristicLab.Optimization; 25 25 26 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {26 namespace HeuristicLab.ExactOptimization.LinearProgramming { 27 27 28 public interface ILinearPro grammingProblemDefinition : IContent{28 public interface ILinearProblemDefinition : IItem { 29 29 30 30 void Analyze(Solver solver, ResultCollection results); -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Problems/LinearProblem.cs
r16581 r16582 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.IO; 25 using System.Linq; 26 using System.Reflection; 27 using Google.OrTools.LinearSolver; 23 28 using HeuristicLab.Common; 24 29 using HeuristicLab.Core; 30 using HeuristicLab.Data; 25 31 using HeuristicLab.Optimization; 32 using HeuristicLab.Parameters; 26 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 34 28 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {35 namespace HeuristicLab.ExactOptimization.LinearProgramming { 29 36 30 [Item(" Linear/Mixed Integer Programming Problem (LP/MIP)", "Represents a linear/mixed integer problem.")]37 [Item("Mixed-Integer Linear Programming Problem (LP, MIP)", "Represents a linear/mixed integer problem.")] 31 38 [StorableClass] 32 public sealed class LinearProgrammingProblem : Problem { 39 public sealed class LinearProblem : Problem, IStorableContent { 40 33 41 [Storable] 34 private ILinearProgrammingProblemDefinition problemDefinition;42 private readonly IValueParameter<ILinearProblemDefinition> problemDefinitionParam; 35 43 36 public LinearPro grammingProblem() {44 public LinearProblem() { 37 45 Parameters.Remove(Parameters["Operators"]); 46 Parameters.Add(problemDefinitionParam = new ValueParameter<ILinearProblemDefinition>("Model", 47 new ProgrammableLinearProblemDefinition(), false)); 38 48 } 39 49 40 private LinearPro grammingProblem(LinearProgrammingProblem original, Cloner cloner)50 private LinearProblem(LinearProblem original, Cloner cloner) 41 51 : base(original, cloner) { 52 problemDefinitionParam = cloner.Clone(original.problemDefinitionParam); 42 53 } 43 54 44 55 [StorableConstructor] 45 private LinearPro grammingProblem(bool deserializing) : base(deserializing) {56 private LinearProblem(bool deserializing) : base(deserializing) { 46 57 } 47 58 48 59 public event EventHandler ProblemDefinitionChanged; 49 60 50 public ILinearProgrammingProblemDefinition ProblemDefinition { 51 get => problemDefinition; 61 public string Filename { get; set; } 62 63 public ILinearProblemDefinition ProblemDefinition { 64 get => problemDefinitionParam.Value; 52 65 set { 53 if (problemDefinition == value)66 if (problemDefinitionParam.Value == value) 54 67 return; 55 problemDefinition = value;68 problemDefinitionParam.Value = value; 56 69 ProblemDefinitionChanged?.Invoke(this, EventArgs.Empty); 57 70 } 58 71 } 59 72 60 public override IDeepCloneable Clone(Cloner cloner) => new LinearProgrammingProblem(this, cloner); 73 public IValueParameter<ILinearProblemDefinition> ProblemDefinitionParameter => problemDefinitionParam; 74 75 public override IDeepCloneable Clone(Cloner cloner) => new LinearProblem(this, cloner); 76 77 public override void CollectParameterValues(IDictionary<string, IItem> values) { 78 base.CollectParameterValues(values); 79 80 if (ProblemDefinition == null) return; 81 82 values.Add("Model Type", new StringValue( 83 (ProblemDefinition.GetType().GetCustomAttributes().Single(a => a is ItemAttribute) as ItemAttribute).Name)); 84 85 if (ProblemDefinition is ProgrammableLinearProblemDefinition model) { 86 values.Add("Model Name", new StringValue(model.Name)); 87 } 88 } 89 90 public void ExportModel(string fileName) { 91 if (string.IsNullOrWhiteSpace(fileName)) 92 throw new ArgumentNullException(nameof(fileName)); 93 if (ProblemDefinition == null) 94 throw new ArgumentNullException(nameof(ProblemDefinition)); 95 96 var fileInfo = new FileInfo(fileName); 97 98 if (!fileInfo.Directory?.Exists ?? false) { 99 Directory.CreateDirectory(fileInfo.Directory.FullName); 100 } 101 102 var solver = new Solver(ProblemDefinition.ItemName, Solver.OptimizationProblemType.CbcMixedIntegerProgramming); 103 104 ProblemDefinition.BuildModel(solver); 105 106 var exportSuccessful = false; 107 switch (fileInfo.Extension) { 108 case ".lp": 109 var lpFormat = solver.ExportModelAsLpFormat(false); 110 if (!string.IsNullOrEmpty(lpFormat)) { 111 File.WriteAllText(fileName, lpFormat); 112 exportSuccessful = true; 113 } 114 break; 115 116 case ".mps": 117 var mpsFormat = solver.ExportModelAsMpsFormat(false, false); 118 if (!string.IsNullOrEmpty(mpsFormat)) { 119 File.WriteAllText(fileName, mpsFormat); 120 exportSuccessful = true; 121 } 122 break; 123 124 case ".prototxt": 125 exportSuccessful = solver.ExportModelAsProtoFormat(fileName, 126 (Google.OrTools.LinearSolver.ProtoWriteFormat)ProtoWriteFormat.ProtoText); 127 break; 128 129 case ".bin": // remove file extension as it is added by OR-Tools 130 fileName = Path.ChangeExtension(fileName, null); 131 exportSuccessful = solver.ExportModelAsProtoFormat(fileName, 132 (Google.OrTools.LinearSolver.ProtoWriteFormat)ProtoWriteFormat.ProtoBinary); 133 break; 134 135 default: 136 throw new NotSupportedException($"File format {fileInfo.Extension} to export model is not supported."); 137 } 138 139 if (!exportSuccessful) 140 throw new InvalidDataException("Model could not be exported."); 141 } 61 142 62 143 [StorableHook(HookType.AfterDeserialization)] 63 144 private void AfterDeserialization() { 64 145 } 65 66 private void OnProblemDefinitionChanged() {67 OnOperatorsChanged();68 OnReset();69 }70 146 } 71 147 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Problems/ProgrammableLinearProblemDefinition.cs
r16581 r16582 26 26 using HeuristicLab.Common; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.ExactOptimization.LinearProgramming.Templates; 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 32 using HeuristicLab.Scripting; 32 33 33 namespace HeuristicLab. MathematicalOptimization.LinearProgramming {34 namespace HeuristicLab.ExactOptimization.LinearProgramming { 34 35 35 [Item("Programmable Linear /Mixed Integer Programming Problem Definition",36 "Script that defines the model and evaluates the solutionfor a linear/mixed integer programming problem.")]36 [Item("Programmable Linear Problem Definition (LP, MIP)", 37 "Script that defines the model for a linear/mixed integer programming problem.")] 37 38 [StorableClass] 38 public sealed class ProgrammableLinearPro grammingProblemDefinition : Script, ILinearProgrammingProblemDefinition,39 public sealed class ProgrammableLinearProblemDefinition : Script, ILinearProblemDefinition, 39 40 IStorableContent { 40 41 private readonly object compileLock = new object(); 41 42 42 [Storable] private readonly VariableStore variableStore; 43 [Storable] 44 private readonly VariableStore variableStore; 43 45 44 [Storable] private bool codeChanged; 46 [Storable] 47 private bool codeChanged; 45 48 46 private volatile ILinearPro grammingProblemDefinition compiledProblemDefinition;49 private volatile ILinearProblemDefinition compiledProblemDefinition; 47 50 48 public ProgrammableLinearPro grammingProblemDefinition()49 : base(ScriptTemplates.CompiledLinearPro grammingProblemDefinition) {50 Name = "Programmable Linear /Mixed Integer ProgrammingProblem Definition";51 public ProgrammableLinearProblemDefinition() 52 : base(ScriptTemplates.CompiledLinearProblemDefinition) { 53 Name = "Programmable Linear Problem Definition"; 51 54 variableStore = new VariableStore(); 52 55 } 53 56 54 57 [StorableConstructor] 55 private ProgrammableLinearPro grammingProblemDefinition(bool deserializing) : base(deserializing) {58 private ProgrammableLinearProblemDefinition(bool deserializing) : base(deserializing) { 56 59 } 57 60 58 private ProgrammableLinearPro grammingProblemDefinition(ProgrammableLinearProgrammingProblemDefinition original,61 private ProgrammableLinearProblemDefinition(ProgrammableLinearProblemDefinition original, 59 62 Cloner cloner) : base(original, cloner) { 60 63 variableStore = cloner.Clone(original.variableStore); … … 68 71 public VariableStore VariableStore => variableStore; 69 72 70 private ILinearPro grammingProblemDefinition CompiledProblemDefinition {73 private ILinearProblemDefinition CompiledProblemDefinition { 71 74 get { 72 75 // double checked locking pattern … … 85 88 } 86 89 87 private bool SuppressEvents { get; set; }88 89 90 public void Analyze(Solver solver, ResultCollection results) => CompiledProblemDefinition.Analyze(solver, results); 90 91 … … 92 93 93 94 public override IDeepCloneable Clone(Cloner cloner) { 94 return new ProgrammableLinearPro grammingProblemDefinition(this, cloner);95 return new ProgrammableLinearProblemDefinition(this, cloner); 95 96 } 96 97 … … 108 109 if (!types.Any(x => typeof(CompiledProblemDefinition).IsAssignableFrom(x))) 109 110 throw new ProblemDefinitionScriptException("The compiled code doesn't contain a problem definition." + Environment.NewLine + 110 "The problem definition must be a subclass of CompiledProblemDefinition.");111 $"The problem definition must be a subclass of {nameof(CompiledProblemDefinition)} and implement {nameof(ILinearProblemDefinition)}."); 111 112 if (types.Count(x => typeof(CompiledProblemDefinition).IsAssignableFrom(x)) > 1) 112 113 throw new ProblemDefinitionScriptException("The compiled code contains multiple problem definitions." + Environment.NewLine + 113 "Only one subclass of CompiledProblemDefinitionis allowed.");114 $"Only one subclass of {nameof(CompiledProblemDefinition)} is allowed."); 114 115 115 116 CompiledProblemDefinition inst; … … 133 134 134 135 try { 135 compiledProblemDefinition = (ILinearPro grammingProblemDefinition)inst;136 compiledProblemDefinition = (ILinearProblemDefinition)inst; 136 137 if (fireChanged) OnProblemDefinitionChanged(); 137 138 } catch (Exception e) { … … 139 140 throw new ProblemDefinitionScriptException( 140 141 "Using the problem definition in the problem failed." + Environment.NewLine + 141 "Examine this error message carefully (often there is an issue with the defined encoding).", e);142 "Examine this error message carefully.", e); 142 143 } 143 144 -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/CompiledLinearProblemDefinition.cs
r16581 r16582 6 6 using HeuristicLab.Core; 7 7 using HeuristicLab.Data; 8 using HeuristicLab.ExactOptimization.LinearProgramming; 8 9 using HeuristicLab.Optimization; 9 10 using Variable = Google.OrTools.LinearSolver.Variable; 10 11 11 namespace HeuristicLab.MathematicalOptimization.LinearProgramming { 12 public class CompiledLinearProblemDefinition : CompiledProblemDefinition, ILinearProblemDefinition { 13 private Variable x; 14 private Variable y; 12 15 13 public class CompiledLinearProgrammingProblemDefinition : CompiledProblemDefinition, ILinearProgrammingProblemDefinition { 14 private Variable x; 15 private Variable y; 16 public override void Initialize() { 17 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 18 // Add additional initialization code e.g. private variables that you need for evaluating 19 } 16 20 17 public override void Initialize() { 18 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 19 // Add additional initialization code e.g. private variables that you need for evaluating 20 } 21 public void BuildModel(Solver solver) { 22 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 23 // How to define a model using Google OR-Tools: https://developers.google.com/optimization/introduction/cs 24 // Example model taken from https://developers.google.com/optimization/mip/integer_opt 25 // Define the decision variables 26 x = solver.MakeIntVar(0, 3.5, "x"); 27 y = solver.MakeIntVar(0, double.PositiveInfinity, "y"); 28 // Define the constraints 29 solver.Add(x + 7 * y <= 17.5); 30 // Define the objective 31 solver.Maximize(x + 10 * y); 32 } 21 33 22 public void BuildModel(Solver solver) { 23 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 24 // How to define a model using Google OR-Tools: https://developers.google.com/optimization/introduction/cs 25 // Example model taken from https://developers.google.com/optimization/mip/integer_opt 26 // Define the decision variables 27 x = solver.MakeIntVar(0, 3.5, "x"); 28 y = solver.MakeIntVar(0, double.PositiveInfinity, "y"); 29 // Define the constraints 30 solver.Add(x + 7 * y <= 17.5); 31 // Define the objective 32 solver.Maximize(x + 10 * y); 33 } 34 public void Analyze(Solver solver, ResultCollection results) { 35 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 36 // Write or update results given the solution values of the decision variables 37 results.AddOrUpdateResult("x", new DoubleValue(x.SolutionValue())); 38 results.AddOrUpdateResult("y", new DoubleValue(y.SolutionValue())); 39 // The decision variables can also be retrieved from the solver 40 //results.AddOrUpdateResult("x", new DoubleValue(solver.LookupVariableOrNull("x").SolutionValue())); 41 //results.AddOrUpdateResult("y", new DoubleValue(solver.LookupVariableOrNull("y").SolutionValue())); 42 } 34 43 35 public void Analyze(Solver solver, ResultCollection results) { 36 // Use vars.yourVariable to access variables in the variable store i.e. yourVariable 37 // Write or update results given the solution values of the decision variables 38 results.AddOrUpdateResult("x", new DoubleValue(x.SolutionValue())); 39 results.AddOrUpdateResult("y", new DoubleValue(y.SolutionValue())); 40 // The decision variables can also be retrieved from the solver 41 //results.AddOrUpdateResult("x", new DoubleValue(solver.LookupVariableOrNull("x").SolutionValue())); 42 //results.AddOrUpdateResult("y", new DoubleValue(solver.LookupVariableOrNull("y").SolutionValue())); 43 } 44 45 // Implement further classes and methods 46 } 44 // Implement further classes and methods 47 45 } 48 46 -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/LinearProgramming/Templates/ScriptTemplates.resx
r16405 r16582 119 119 </resheader> 120 120 <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 121 <data name="CompiledLinearPro grammingProblemDefinition" type="System.Resources.ResXFileRef, System.Windows.Forms">122 <value>compiledlinearpro grammingproblemdefinition.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>121 <data name="CompiledLinearProblemDefinition" type="System.Resources.ResXFileRef, System.Windows.Forms"> 122 <value>compiledlinearproblemdefinition.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> 123 123 </data> 124 124 </root> -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/Plugin.cs.frame
r16405 r16582 22 22 using HeuristicLab.PluginInfrastructure; 23 23 24 namespace HeuristicLab. MathematicalOptimization {24 namespace HeuristicLab.ExactOptimization { 25 25 26 [Plugin("HeuristicLab. MathematicalOptimization", "Provides support for mathematicaloptimization based on Google OR-Tools. " +26 [Plugin("HeuristicLab.ExactOptimization", "Provides support for exact optimization based on Google OR-Tools. " + 27 27 "Requires the Microsoft Visual C++ 2017 Redistributable (x64) - 14.16.27012: https://aka.ms/vs/15/release/vc_redist.x64.exe", "3.3.15.$WCREV$")] 28 [PluginFile("HeuristicLab. MathematicalOptimization-3.3.dll", PluginFileType.Assembly)]28 [PluginFile("HeuristicLab.ExactOptimization-3.3.dll", PluginFileType.Assembly)] 29 29 [PluginDependency("HeuristicLab.Analysis", "3.3")] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] … … 39 39 [PluginDependency("HeuristicLab.Problems.Programmable", "3.3")] 40 40 [PluginDependency("HeuristicLab.Scripting", "3.3")] 41 public class HeuristicLab MathematicalOptimizationPlugin : PluginBase {41 public class HeuristicLabExactOptimizationPlugin : PluginBase { 42 42 } 43 43 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/Properties/AssemblyInfo.cs.frame
r16070 r16582 27 27 // set of attributes. Change these attribute values to modify the information 28 28 // associated with an assembly. 29 [assembly: AssemblyTitle("Heuristic lLab.MathematicalOptimization")]30 [assembly: AssemblyDescription("Provides support for mathematicaloptimization based on Google OR-Tools")]29 [assembly: AssemblyTitle("HeuristicLab.ExactOptimization")] 30 [assembly: AssemblyDescription("Provides support for exact optimization based on Google OR-Tools")] 31 31 [assembly: AssemblyConfiguration("")] 32 32 [assembly: AssemblyCompany("HEAL")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 8HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2019 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/Properties/Settings.Designer.cs
r16405 r16582 9 9 //------------------------------------------------------------------------------ 10 10 11 namespace HeuristicLab. MathematicalOptimization.Properties {11 namespace HeuristicLab.ExactOptimization.Properties { 12 12 13 13 -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/Properties/Settings.settings
r16405 r16582 1 1 <?xml version='1.0' encoding='utf-8'?> 2 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab. MathematicalOptimization.Properties" GeneratedClassName="Settings">2 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HeuristicLab.ExactOptimization.Properties" GeneratedClassName="Settings"> 3 3 <Profiles /> 4 4 <Settings> -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.MathematicalOptimization/3.3/app.config
r16405 r16582 3 3 <configSections> 4 4 <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 5 <section name="HeuristicLab. MathematicalOptimization.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />5 <section name="HeuristicLab.ExactOptimization.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> 6 6 </sectionGroup> 7 7 </configSections> 8 8 <userSettings> 9 <HeuristicLab. MathematicalOptimization.Properties.Settings>9 <HeuristicLab.ExactOptimization.Properties.Settings> 10 10 <setting name="ScipLibraryName" serializeAs="String"> 11 11 <value>scip.dll</value> … … 20 20 <value>gurobi81.dll</value> 21 21 </setting> 22 </HeuristicLab. MathematicalOptimization.Properties.Settings>22 </HeuristicLab.ExactOptimization.Properties.Settings> 23 23 </userSettings> 24 24 </configuration>
Note: See TracChangeset
for help on using the changeset viewer.