- Timestamp:
- 03/29/11 15:40:01 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveEvaluator.cs
r5202 r5867 85 85 string key = AdditionFrequencyMemoryKeyParameter.Value.Value; 86 86 87 if (memory .ContainsKey(key)) {87 if (memory != null && memory.ContainsKey(key)) { 88 88 ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue> additionFrequency = 89 89 memory[key].Value as ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveMaker.cs
r5202 r5867 101 101 PotvinCustomerRelocationMove move = CustomerRelocationMoveParameter.ActualValue; 102 102 103 PotvinEncoding newSolution = move.Individual as PotvinEncoding;103 PotvinEncoding newSolution = move.Individual.Clone() as PotvinEncoding; 104 104 Apply(newSolution, move); 105 105 VRPToursParameter.ActualValue = newSolution; … … 125 125 string key = AdditionFrequencyMemoryKeyParameter.Value.Value; 126 126 127 if (!memory.ContainsKey(key)) { 128 memory.Add(new Variable(key, 129 new ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>())); 127 if (memory != null) { 128 if (!memory.ContainsKey(key)) { 129 memory.Add(new Variable(key, 130 new ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>())); 131 } 132 ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue> additionFrequency = 133 memory[key].Value as ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>; 134 135 PotvinCustomerRelocationMoveAttribute attr = new PotvinCustomerRelocationMoveAttribute(0, move.Tour, move.City); 136 if (!additionFrequency.ContainsKey(attr)) 137 additionFrequency[attr] = new IntValue(0); 138 139 additionFrequency[attr].Value++; 130 140 } 131 ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue> additionFrequency =132 memory[key].Value as ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>;133 134 PotvinCustomerRelocationMoveAttribute attr = new PotvinCustomerRelocationMoveAttribute(0, move.Tour, move.City);135 if (!additionFrequency.ContainsKey(attr))136 additionFrequency[attr] = new IntValue(0);137 138 additionFrequency[attr].Value++;139 141 } 140 142 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMultiMoveGenerator.cs
r5127 r5867 29 29 using HeuristicLab.Common; 30 30 using HeuristicLab.Data; 31 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin { 33 34 [Item("PotvinCustomerRelocationMultiMoveGenerator", "Generates customer relocation moves from a given VRP encoding.")] 34 35 [StorableClass] 35 public sealed class PotvinCustomerRelocationMultiMoveGenerator : PotvinCustomerRelocationMoveGenerator, IMultiMoveGenerator {36 public sealed class PotvinCustomerRelocationMultiMoveGenerator : PotvinCustomerRelocationMoveGenerator, IMultiMoveGenerator, IMultiVRPMoveGenerator { 36 37 public ILookupParameter<IRandom> RandomParameter { 37 38 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationSingleMoveGenerator.cs
r5127 r5867 35 35 [StorableClass] 36 36 public sealed class PotvinCustomerRelocationSingleMoveGenerator : PotvinCustomerRelocationMoveGenerator, 37 ISingleMoveGenerator , IMultiVRPMoveGenerator{37 ISingleMoveGenerator { 38 38 #region IMultiVRPMoveOperator Members 39 39
Note: See TracChangeset
for help on using the changeset viewer.