#region License Information /* HeuristicLab * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.IntegerVectorEncoding; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Problems.FacilityLocation { [Item("Facility Location Solution", "Solution to the facility layout problem")] [StorableClass] public class FacilityLocationSolution : ParameterizedNamedItem { [Storable] private DoubleArray openingCosts; public DoubleArray OpeningCosts { get { return openingCosts; } set { openingCosts = value; } } [Storable] private DoubleArray depotCapacities; public DoubleArray DepotCapacities { get { return depotCapacities; } set { depotCapacities = value; } } [Storable] private DoubleArray customerDemands; public DoubleArray CustomerDemands { get { return customerDemands; } set { customerDemands = value; } } [Storable] private ValueTypeMatrix deliveryCosts; public ValueTypeMatrix DeliveryCosts { get { return deliveryCosts; } set { deliveryCosts = value; } } [Storable] private IValueParameter customerToDepotAssignmentParameter; public IValueParameter CustomerToDepotAssignmentParameter { get { return customerToDepotAssignmentParameter; } } [Storable] private IValueParameter fitnessValueParameter; public IValueParameter FitnessValueParameter { get { return fitnessValueParameter; } } [Storable] private IValueParameter totalOpeningCostsParameter; public IValueParameter TotalOpeningCostsParameter { get { return totalOpeningCostsParameter; } } [Storable] private IValueParameter totalDeliveryCostsParameter; public IValueParameter TotalDeliveryCostsParameter { get { return totalDeliveryCostsParameter; } } [Storable] private IValueParameter totalOverbookedCapacityParameter; public IValueParameter TotalOverbookedCapacityParameter { get { return totalOverbookedCapacityParameter; } } [StorableConstructor] protected FacilityLocationSolution(bool deserializing) : base(deserializing) { } protected FacilityLocationSolution(FacilityLocationSolution original, Cloner cloner) : base(original, cloner) { openingCosts = cloner.Clone(original.openingCosts); depotCapacities = cloner.Clone(original.depotCapacities); customerDemands = cloner.Clone(original.customerDemands); deliveryCosts = cloner.Clone(original.deliveryCosts); customerToDepotAssignmentParameter = cloner.Clone(original.customerToDepotAssignmentParameter); fitnessValueParameter = cloner.Clone(original.fitnessValueParameter); totalOpeningCostsParameter = cloner.Clone(original.totalOpeningCostsParameter); totalDeliveryCostsParameter = cloner.Clone(original.totalDeliveryCostsParameter); totalOverbookedCapacityParameter = cloner.Clone(original.totalOverbookedCapacityParameter); } public FacilityLocationSolution() { Parameters.Add(customerToDepotAssignmentParameter = new ValueParameter("Customer-Depot Assignment", "The assignment vector that assigns each customer to one depot.")); Parameters.Add(fitnessValueParameter = new ValueParameter("Fitness Value", "The fitness value of the solution.")); Parameters.Add(totalOpeningCostsParameter = new ValueParameter("Total Opening Costs", "The sum of all opening costs.")); Parameters.Add(totalDeliveryCostsParameter = new ValueParameter("Total Delivery Costs", "The sum of all delivery costs.")); Parameters.Add(totalOverbookedCapacityParameter = new ValueParameter("Total Overbooked Capacity", "The total amount of capacity that would additionally be required to fulfill all the customer demands.")); } public override IDeepCloneable Clone(Cloner cloner) { return new FacilityLocationSolution(this, cloner); } } }