Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14646


Ignore:
Timestamp:
02/03/17 15:19:53 (7 years ago)
Author:
abeham
Message:

#2205: Added version of FLP that minimizes opening costs only

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  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Diagnostics;
    2523using System.IO;
    2624using System.Linq;
     
    3937
    4038namespace HeuristicLab.Problems.FacilityLocation.CplexSolver {
     39  public enum FlpVariant { FLP, FLP_2 }
     40
    4141  [Item("FLP CPLEX Solver", "Solves facility location problem (FLP) instances using CPLEX.")]
    4242  [Creatable(CreatableAttribute.Categories.SingleSolutionAlgorithms)]
     
    5858    [Storable]
    5959    private IFixedValueParameter<TimeSpanValue> maximumRuntimeParameter;
    60 
    61     private bool supportsPause;
    62 
    6360    public IFixedValueParameter<TimeSpanValue> MaximumRuntimeParameter {
    6461      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; }
    6578    }
    6679
     
    7083      : base(original, cloner) {
    7184      maximumRuntimeParameter = cloner.Clone(original.maximumRuntimeParameter);
     85      flpVariantParameter = cloner.Clone(original.flpVariantParameter);
    7286    }
    7387    public FLPCplexSolver() {
    7488      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)));
    7590      Problem = new FacilityLocationProblem();
    7691    }
     
    85100
    86101
    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"));
    88103      var modelStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(model);
    89104
  • branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3/FLP_2.mod

    r14641 r14646  
    1616
    1717minimize
    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] ) );
    1919
    2020
  • branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation.CplexSolver/3.3/HeuristicLab.Problems.FacilityLocation.CplexSolver-3.3.csproj

    r14633 r14646  
    127127    </ProjectReference>
    128128  </ItemGroup>
     129  <ItemGroup>
     130    <EmbeddedResource Include="FLP_2.mod" />
     131  </ItemGroup>
    129132  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    130133  <PropertyGroup>
Note: See TracChangeset for help on using the changeset viewer.