- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting (added) merged: 4686-4687,4689-4693,4696-4697
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/DefaultRepresentationCreator.cs
r4183 r4722 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 22 24 using HeuristicLab.Core; 23 using HeuristicLab.Data;24 using HeuristicLab.Operators;25 using HeuristicLab.Parameters;26 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Collections.Generic;28 using HeuristicLab.Problems.VehicleRouting.Encodings;29 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;30 26 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 31 27 … … 38 34 [StorableConstructor] 39 35 protected DefaultRepresentationCreator(bool deserializing) : base(deserializing) { } 36 protected DefaultRepresentationCreator(DefaultRepresentationCreator original, Cloner cloner) : base(original, cloner) { } 40 37 41 38 public DefaultRepresentationCreator() : base() { } … … 46 43 47 44 return base.Apply(); 48 } 45 } 49 46 } 50 47 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/MultiVRPSolutionCreator.cs
r4352 r4722 23 23 using System.Linq; 24 24 using HeuristicLab.Collections; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Operators; 27 29 using HeuristicLab.Optimization; … … 29 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 32 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Data;32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 78 79 79 80 [StorableConstructor] 80 private MultiVRPSolutionCreator(bool deserializing) : base(deserializing) { } 81 protected MultiVRPSolutionCreator(bool deserializing) : base(deserializing) { } 82 protected MultiVRPSolutionCreator(MultiVRPSolutionCreator original, Cloner cloner) : base(original, cloner) { } 83 public override IDeepCloneable Clone(Cloner cloner) { 84 return new MultiVRPSolutionCreator(this, cloner); 85 } 86 81 87 public MultiVRPSolutionCreator() 82 88 : base() { 83 89 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The new VRP tours.")); 84 90 85 86 87 88 89 90 91 92 93 94 91 Parameters.Add(new ValueLookupParameter<IntValue>("Cities", "The city count.")); 92 Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates of the cities.")); 93 Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities.")); 94 Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false.")); 95 Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles.")); 96 Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle.")); 97 Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer.")); 98 Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer.")); 99 Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer.")); 100 Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer.")); 95 101 96 97 98 102 foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(IVRPCreator)).OrderBy(op => op.Name)) { 103 if (!typeof(MultiOperator<IVRPCreator>).IsAssignableFrom(type)) 104 Operators.Add((IVRPCreator)Activator.CreateInstance(type), true); 99 105 } 100 106 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/PushForwardInsertionCreator.cs
r4352 r4722 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.PermutationEncoding;27 27 using HeuristicLab.Optimization; 28 28 using HeuristicLab.Parameters; … … 60 60 [StorableConstructor] 61 61 private PushForwardCreator(bool deserializing) : base(deserializing) { } 62 private PushForwardCreator(PushForwardCreator original, Cloner cloner) : base(original, cloner) { } 63 public override IDeepCloneable Clone(Cloner cloner) { 64 return new PushForwardCreator(this, cloner); 65 } 62 66 63 67 public PushForwardCreator() -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/RandomCreator.cs
r4183 r4722 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 using HeuristicLab.Encodings.PermutationEncoding;27 25 using HeuristicLab.Optimization; 28 26 using HeuristicLab.Parameters; … … 41 39 [StorableConstructor] 42 40 private RandomCreator(bool deserializing) : base(deserializing) { } 41 private RandomCreator(RandomCreator original, Cloner cloner) : base(original, cloner) { } 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new RandomCreator(this, cloner); 44 } 43 45 44 46 public RandomCreator() -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r4352 r4722 23 23 using System.Linq; 24 24 using HeuristicLab.Collections; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Operators; 27 29 using HeuristicLab.Optimization; … … 29 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 32 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Data;32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 82 83 83 84 [StorableConstructor] 84 private MultiVRPSolutionCrossover(bool deserializing) : base(deserializing) { } 85 protected MultiVRPSolutionCrossover(bool deserializing) : base(deserializing) { } 86 protected MultiVRPSolutionCrossover(MultiVRPSolutionCrossover original, Cloner cloner) : base(original, cloner) { } 87 public override IDeepCloneable Clone(Cloner cloner) { 88 return new MultiVRPSolutionCrossover(this, cloner); 89 } 85 90 public MultiVRPSolutionCrossover() 86 91 : base() { 87 92 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncoding>("Parents", "The parent permutations which should be crossed.")); 88 93 ParentsParameter.ActualName = "VRPTours"; 89 94 Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover.")); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/RandomParentCloneCrossover.cs
r4352 r4722 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 22 using HeuristicLab.Common; 26 23 using HeuristicLab.Core; 27 24 using HeuristicLab.Optimization; … … 39 36 [StorableConstructor] 40 37 private RandomParentCloneCrossover(bool deserializing) : base(deserializing) { } 38 private RandomParentCloneCrossover(RandomParentCloneCrossover original, Cloner cloner) : base(original, cloner) { } 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new RandomParentCloneCrossover(this, cloner); 41 } 42 41 43 42 44 public RandomParentCloneCrossover() … … 54 56 Parameters.Remove("ServiceTime"); 55 57 } 56 58 57 59 public override IOperation Apply() { 58 60 if (RandomParameter.ActualValue.Next() < 0.5) -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs
r4352 r4722 23 23 using System.Linq; 24 24 using HeuristicLab.Collections; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Operators; 27 29 using HeuristicLab.Optimization; … … 29 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 32 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Data;32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 78 79 79 80 [StorableConstructor] 80 private MultiVRPSolutionManipulator(bool deserializing) : base(deserializing) { } 81 protected MultiVRPSolutionManipulator(bool deserializing) : base(deserializing) { } 82 protected MultiVRPSolutionManipulator(MultiVRPSolutionManipulator original, Cloner cloner) : base(original, cloner) { } 83 public override IDeepCloneable Clone(Cloner cloner) { 84 return new MultiVRPSolutionManipulator(this, cloner); 85 } 81 86 public MultiVRPSolutionManipulator() 82 87 : base() { … … 97 102 if (!typeof(MultiOperator<IVRPManipulator>).IsAssignableFrom(type)) { 98 103 IVRPManipulator op = (IVRPManipulator)Activator.CreateInstance(type); 99 bool operatorChecked = true; 100 if (op is HeuristicLab.Problems.VehicleRouting.Encodings.Potvin.PotvinLocalSearchManipulator ||104 bool operatorChecked = true; 105 if (op is HeuristicLab.Problems.VehicleRouting.Encodings.Potvin.PotvinLocalSearchManipulator || 101 106 op is HeuristicLab.Problems.VehicleRouting.Encodings.Prins.PrinsLSManipulator) 102 107 operatorChecked = false; -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/Interfaces/IMultiVRPMoveGenerator.cs
r4205 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 using HeuristicLab.Encodings.PermutationEncoding;24 22 using HeuristicLab.Optimization; 25 23 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/Interfaces/IMultiVRPMoveOperator.cs
r4205 r4722 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding;24 using HeuristicLab.Optimization;25 23 26 24 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/Interfaces/IVRPMove.cs
r4352 r4722 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding;24 using HeuristicLab.Optimization;25 23 using HeuristicLab.Data; 26 24 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs
r4352 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 using HeuristicLab.Encodings.PermutationEncoding;24 24 using HeuristicLab.Parameters; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 36 36 [StorableConstructor] 37 37 private MultiVRPMoveEvaluator(bool deserializing) : base(deserializing) { } 38 private MultiVRPMoveEvaluator(MultiVRPMoveEvaluator original, Cloner cloner) : base(original, cloner) { } 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new MultiVRPMoveEvaluator(this, cloner); 41 } 38 42 39 43 public MultiVRPMoveEvaluator() 40 44 : base() { 41 45 Parameters.Add(new LookupParameter<IVRPMove>("VRPMove", "The generated moves.")); 42 46 } 43 47 … … 53 57 CapacityParameter.ActualValue, 54 58 CoordinatesParameter.ActualValue, 55 FleetUsageFactor.ActualValue, 56 TimeFactor.ActualValue, 57 DistanceFactor.ActualValue, 58 OverloadPenalty.ActualValue, 59 FleetUsageFactor.ActualValue, 60 TimeFactor.ActualValue, 61 DistanceFactor.ActualValue, 62 OverloadPenalty.ActualValue, 59 63 TardinessPenalty.ActualValue, 60 64 DistanceMatrixParameter, -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs
r4352 r4722 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Collections; 26 using HeuristicLab.Common; 25 27 using HeuristicLab.Core; 28 using HeuristicLab.Data; 26 29 using HeuristicLab.Operators; 27 30 using HeuristicLab.Optimization; … … 29 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 33 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.Data;32 using System.Collections.Generic;33 34 34 35 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { 35 36 [Item("MultiVRPMoveGenerator", "Randomly selects and applies its move generators.")] 36 37 [StorableClass] 37 public class MultiVRPMoveGenerator : CheckedMultiOperator<IMultiVRPMoveGenerator>, IMultiVRPMoveOperator, 38 public class MultiVRPMoveGenerator : CheckedMultiOperator<IMultiVRPMoveGenerator>, IMultiVRPMoveOperator, 38 39 IStochasticOperator, IMultiMoveGenerator { 39 40 public override bool CanChangeName { … … 97 98 98 99 [StorableConstructor] 99 private MultiVRPMoveGenerator(bool deserializing) : base(deserializing) { } 100 protected MultiVRPMoveGenerator(bool deserializing) : base(deserializing) { } 101 protected MultiVRPMoveGenerator(MultiVRPMoveGenerator original, Cloner cloner) : base(original, cloner) { } 102 public override IDeepCloneable Clone(Cloner cloner) { 103 return new MultiVRPMoveGenerator(this, cloner); 104 } 100 105 public MultiVRPMoveGenerator() 101 106 : base() { -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r4416 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; 24 using HeuristicLab.Operators;25 25 using HeuristicLab.Optimization; 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using System.Collections.Generic;29 28 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { 31 30 [Item("MultiVRPMoveMaker", "Peforms multiple moves on a given VRP encoding and updates the quality.")] 32 31 [StorableClass] … … 81 80 82 81 [StorableConstructor] 83 private LambdaInterchangeMoveMaker(bool deserializing) : base(deserializing) { } 82 protected LambdaInterchangeMoveMaker(bool deserializing) : base(deserializing) { } 83 protected LambdaInterchangeMoveMaker(LambdaInterchangeMoveMaker original, Cloner cloner) : base(original, cloner) { } 84 public override IDeepCloneable Clone(Cloner cloner) { 85 return new LambdaInterchangeMoveMaker(this, cloner); 86 } 84 87 85 88 public LambdaInterchangeMoveMaker() … … 112 115 DoubleValue moveQuality = MoveQualityParameter.ActualValue; 113 116 DoubleValue quality = QualityParameter.ActualValue; 114 117 115 118 //perform move 116 119 VRPToursParameter.ActualValue = move.MakeMove(); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/PermutationEncoding.cs
r4352 r4722 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 22 24 using HeuristicLab.Common; 23 25 using HeuristicLab.Core; … … 25 27 using HeuristicLab.Encodings.PermutationEncoding; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Collections.Generic;28 using HeuristicLab.Problems.VehicleRouting.Encodings.General;29 using System;30 29 31 30 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 48 47 : base() { 49 48 } 49 protected PermutationEncoding(PermutationEncoding original, Cloner cloner) 50 : base(original, cloner) { 51 } 52 50 53 51 54 public int IndexOf(int city) { -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/TourEncoding.cs
r4352 r4722 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using System.Drawing; 22 24 using HeuristicLab.Common; 23 25 using HeuristicLab.Core; 24 26 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.PermutationEncoding;26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using System.Drawing;28 using System.Collections.Generic;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 35 34 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Class; } 36 35 } 37 36 38 37 #region IVRPEncoding Members 39 38 public virtual List<Tour> GetTours(ILookupParameter<DoubleMatrix> distanceMatrix = null, int maxVehicles = int.MaxValue) { … … 51 50 52 51 public int Cities { 53 get 54 { 52 get { 55 53 int cities = 0; 56 54 … … 75 73 : base() { 76 74 } 75 protected TourEncoding(TourEncoding original, Cloner cloner) 76 : base(original, cloner) { 77 } 77 78 78 79 public static void ConvertFrom(IVRPEncoding encoding, TourEncoding solution, ILookupParameter<DoubleMatrix> distanceMatrix) { … … 82 83 public static void ConvertFrom(List<int> route, TourEncoding solution) { 83 84 solution.Tours = new ItemList<Tour>(); 84 85 85 86 Tour tour = new Tour(); 86 87 for (int i = 0; i < route.Count; i++) {
Note: See TracChangeset
for help on using the changeset viewer.