Changeset 17717 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba
- Timestamp:
- 08/05/20 04:37:37 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncodedSolution.cs
r17714 r17717 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; … … 138 139 public static AlbaEncodedSolution ConvertFrom(IVRPEncodedSolution encoding, IVRPProblemInstance instance) { 139 140 List<Tour> tours = encoding.GetTours(); 140 141 int cities = 0; 142 foreach (Tour tour in tours) { 143 cities += tour.Stops.Count; 144 } 141 var cities = tours.Sum(x => x.Stops.Count); 145 142 146 143 int emptyVehicles = instance.Vehicles.Value - tours.Count; … … 171 168 } 172 169 173 AlbaEncodedSolution solution = new AlbaEncodedSolution(new Permutation(PermutationTypes.RelativeUndirected, new IntArray(array)), instance); 174 175 return solution; 170 return new AlbaEncodedSolution(new Permutation(PermutationTypes.RelativeUndirected, new IntArray(array)), instance); 176 171 } 177 172 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaCrossover.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/IAlbaOperator.cs
r17226 r17717 20 20 #endregion 21 21 22 using HeuristicLab.Problems.VehicleRouting.Variants;23 22 using HEAL.Attic; 23 using HeuristicLab.Problems.VehicleRouting.Interfaces; 24 24 25 25 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 26 26 [StorableType("E4EADC47-5FEC-429D-B713-795171F8C85B")] 27 public interface IAlbaOperator : 28 ISingleDepotOperator, IHeterogenousCapacitatedOperator, IMultiDepotOperator, ITimeWindowedOperator {27 public interface IAlbaOperator : IGeneralVRPOperator { 28 // the Alba encoding is agnostic to constraints of the VRP 29 29 } 30 30 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/LocalImprovement/AlbaLambdaInterchangeLocalImprovementOperator.cs
r17704 r17717 111 111 public override IOperation InstrumentedApply() { 112 112 int maxIterations = MaximumIterationsParameter.ActualValue.Value; 113 AlbaEncodedSolution solution = null;113 var solution = VRPToursParameter.ActualValue as AlbaEncodedSolution; 114 114 115 if (VRPToursParameter.ActualValue is AlbaEncodedSolution) 116 solution = VRPToursParameter.ActualValue as AlbaEncodedSolution; 117 else 115 if (solution == null) 118 116 VRPToursParameter.ActualValue = solution = AlbaEncodedSolution.ConvertFrom(VRPToursParameter.ActualValue, ProblemInstance); 119 117 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaCustomerInsertionManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 using HEAL.Attic;25 25 26 26 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaManipulator.cs
r17698 r17717 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 using HEAL.Attic;27 27 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 28 28 using HeuristicLab.Problems.VehicleRouting.Interfaces;
Note: See TracChangeset
for help on using the changeset viewer.