Changeset 14646 for branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver
- Timestamp:
- 02/03/17 15:19:53 (8 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3/FLPCplexSolver.cs
r14642 r14646 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Diagnostics;25 23 using System.IO; 26 24 using System.Linq; … … 39 37 40 38 namespace HeuristicLab.Problems.FacilityLocation.CplexSolver { 39 public enum FlpVariant { FLP, FLP_2 } 40 41 41 [Item("FLP CPLEX Solver", "Solves facility location problem (FLP) instances using CPLEX.")] 42 42 [Creatable(CreatableAttribute.Categories.SingleSolutionAlgorithms)] … … 58 58 [Storable] 59 59 private IFixedValueParameter<TimeSpanValue> maximumRuntimeParameter; 60 61 private bool supportsPause;62 63 60 public IFixedValueParameter<TimeSpanValue> MaximumRuntimeParameter { 64 61 get { return maximumRuntimeParameter; } 62 } 63 64 public TimeSpan MaximumRuntime { 65 get { return maximumRuntimeParameter.Value.Value; } 66 set { maximumRuntimeParameter.Value.Value = value; } 67 } 68 69 [Storable] 70 private IFixedValueParameter<EnumValue<FlpVariant>> flpVariantParameter; 71 public IFixedValueParameter<EnumValue<FlpVariant>> FlpVariantParameter { 72 get { return flpVariantParameter; } 73 } 74 75 public FlpVariant FlpVariant { 76 get { return flpVariantParameter.Value.Value; } 77 set { flpVariantParameter.Value.Value = value; } 65 78 } 66 79 … … 70 83 : base(original, cloner) { 71 84 maximumRuntimeParameter = cloner.Clone(original.maximumRuntimeParameter); 85 flpVariantParameter = cloner.Clone(original.flpVariantParameter); 72 86 } 73 87 public FLPCplexSolver() { 74 88 Parameters.Add(maximumRuntimeParameter = new FixedValueParameter<TimeSpanValue>("Maximum Runtime", "Specifies how long CPLEX should be allowed to run.", new TimeSpanValue(TimeSpan.FromSeconds(60)))); 89 Parameters.Add(flpVariantParameter = new FixedValueParameter<EnumValue<FlpVariant>>("FLP Variant", "Which FLP variant should be run.", new EnumValue<FlpVariant>(FlpVariant.FLP))); 75 90 Problem = new FacilityLocationProblem(); 76 91 } … … 85 100 86 101 87 var model = Assembly.GetExecutingAssembly().GetManifestResourceNames().SingleOrDefault(x => x.EndsWith(@". FLP.mod"));102 var model = Assembly.GetExecutingAssembly().GetManifestResourceNames().SingleOrDefault(x => x.EndsWith(@"." + FlpVariant.ToString() + ".mod")); 88 103 var modelStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(model); 89 104 -
branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3/FLP_2.mod
r14641 r14646 16 16 17 17 minimize 18 ( sum ( i in 0..(I-1) , j in 0..(J-1) ) ( c[i][j] * x[i][j] ) + sum ( i in 0..(I-1)) ( f[i] * y[i] ) );18 ( sum ( i in 0..(I-1) ) ( f[i] * y[i] ) ); 19 19 20 20 -
branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3/HeuristicLab.Problems.FacilityLocation.CplexSolver-3.3.csproj
r14633 r14646 127 127 </ProjectReference> 128 128 </ItemGroup> 129 <ItemGroup> 130 <EmbeddedResource Include="FLP_2.mod" /> 131 </ItemGroup> 129 132 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 130 133 <PropertyGroup>
Note: See TracChangeset
for help on using the changeset viewer.