Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OptimizationNetworks/HeuristicLab.Problems.FacilityLocation/3.3/FacilityLocationSolution.cs @ 14877

Last change on this file since 14877 was 14587, checked in by abeham, 8 years ago

#2205: Added FLP (facility location problem) for use within a network that solves the location routing problem (LRP)

File size: 5.0 KB
RevLine 
[14587]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
25using HeuristicLab.Encodings.IntegerVectorEncoding;
26using HeuristicLab.Parameters;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28
29namespace HeuristicLab.Problems.FacilityLocation {
30  [Item("Facility Location Solution", "Solution to the facility layout problem")]
31  [StorableClass]
32  public class FacilityLocationSolution : ParameterizedNamedItem {
33   
34    [Storable]
35    private DoubleArray openingCosts;
36    public DoubleArray OpeningCosts {
37      get { return openingCosts; }
38      set { openingCosts = value; }
39    }
40
41    [Storable]
42    private DoubleArray depotCapacities;
43    public DoubleArray DepotCapacities {
44      get { return depotCapacities; }
45      set { depotCapacities = value; }
46    }
47
48    [Storable]
49    private DoubleArray customerDemands;
50    public DoubleArray CustomerDemands {
51      get { return customerDemands; }
52      set { customerDemands = value; }
53    }
54
55    [Storable]
56    private ValueTypeMatrix<double> deliveryCosts;
57    public ValueTypeMatrix<double> DeliveryCosts {
58      get { return deliveryCosts; }
59      set { deliveryCosts = value; }
60    }
61
62    [Storable]
63    private IValueParameter<IntegerVector> customerToDepotAssignmentParameter;
64    public IValueParameter<IntegerVector> CustomerToDepotAssignmentParameter {
65      get { return customerToDepotAssignmentParameter; }
66    }
67
68    [Storable]
69    private IValueParameter<DoubleValue> fitnessValueParameter;
70    public IValueParameter<DoubleValue> FitnessValueParameter {
71      get { return fitnessValueParameter; }
72    }
73
74    [Storable]
75    private IValueParameter<DoubleValue> totalOpeningCostsParameter;
76    public IValueParameter<DoubleValue> TotalOpeningCostsParameter {
77      get { return totalOpeningCostsParameter; }
78    }
79
80    [Storable]
81    private IValueParameter<DoubleValue> totalDeliveryCostsParameter;
82    public IValueParameter<DoubleValue> TotalDeliveryCostsParameter {
83      get { return totalDeliveryCostsParameter; }
84    }
85
86    [Storable]
87    private IValueParameter<DoubleValue> totalOverbookedCapacityParameter;
88    public IValueParameter<DoubleValue> TotalOverbookedCapacityParameter {
89      get { return totalOverbookedCapacityParameter; }
90    }
91
92    [StorableConstructor]
93    protected FacilityLocationSolution(bool deserializing) : base(deserializing) { }
94    protected FacilityLocationSolution(FacilityLocationSolution original, Cloner cloner)
95      : base(original, cloner) {
96      openingCosts = cloner.Clone(original.openingCosts);
97      depotCapacities = cloner.Clone(original.depotCapacities);
98      customerDemands = cloner.Clone(original.customerDemands);
99      deliveryCosts = cloner.Clone(original.deliveryCosts);
100      customerToDepotAssignmentParameter = cloner.Clone(original.customerToDepotAssignmentParameter);
101      fitnessValueParameter = cloner.Clone(original.fitnessValueParameter);
102      totalOpeningCostsParameter = cloner.Clone(original.totalOpeningCostsParameter);
103      totalDeliveryCostsParameter = cloner.Clone(original.totalDeliveryCostsParameter);
104      totalOverbookedCapacityParameter = cloner.Clone(original.totalOverbookedCapacityParameter);
105    }
106    public FacilityLocationSolution() {
107      Parameters.Add(customerToDepotAssignmentParameter = new ValueParameter<IntegerVector>("Customer-Depot Assignment", "The assignment vector that assigns each customer to one depot."));
108      Parameters.Add(fitnessValueParameter = new ValueParameter<DoubleValue>("Fitness Value", "The fitness value of the solution."));
109      Parameters.Add(totalOpeningCostsParameter = new ValueParameter<DoubleValue>("Total Opening Costs", "The sum of all opening costs."));
110      Parameters.Add(totalDeliveryCostsParameter = new ValueParameter<DoubleValue>("Total Delivery Costs", "The sum of all delivery costs."));
111      Parameters.Add(totalOverbookedCapacityParameter = new ValueParameter<DoubleValue>("Total Overbooked Capacity", "The total amount of capacity that would additionally be required to fulfill all the customer demands."));
112    }
113
114    public override IDeepCloneable Clone(Cloner cloner) {
115      return new FacilityLocationSolution(this, cloner);
116    }
117  }
118}
Note: See TracBrowser for help on using the repository browser.