Changeset 5867 for branches/VRP/HeuristicLab.Problems.VehicleRouting
- Timestamp:
- 03/29/11 15:40:01 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs
r5202 r5867 149 149 validSolution = new VRPSolution(problemInstance, best.Clone() as IVRPEncoding, new DoubleValue(qualities[i].Value)); 150 150 BestValidSolutionParameter.ActualValue = validSolution; 151 results.Add(new Result("Best valid VRP Solution", validSolution)); 151 if (results.ContainsKey("Best valid VRP Solution")) 152 results["Best valid VRP Solution"].Value = validSolution; 153 else 154 results.Add(new Result("Best valid VRP Solution", validSolution)); 152 155 } 153 156 } else { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/VRPSolution.cs
r5127 r5867 36 36 public sealed class VRPSolution : Item { 37 37 public override Image ItemImage { 38 get { return HeuristicLab.Common.Resources.VS 2008ImageLibrary.Image; }38 get { return HeuristicLab.Common.Resources.VSImageLibrary.Image; } 39 39 } 40 40 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs
r4752 r5867 58 58 IAtomicOperation op = this.ExecutionContext.CreateOperation( 59 59 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 60 op.Operator.Execute((IExecutionContext)op );60 op.Operator.Execute((IExecutionContext)op, CancellationToken); 61 61 62 62 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaPermutationManipulator.cs
r4752 r5867 56 56 IAtomicOperation op = this.ExecutionContext.CreateOperation( 57 57 InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope); 58 op.Operator.Execute((IExecutionContext)op );58 op.Operator.Execute((IExecutionContext)op, CancellationToken); 59 59 } 60 60 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMove.cs
r4752 r5867 33 33 public class AlbaIntraRouteInversionMove : TwoIndexMove, IVRPMove { 34 34 public IVRPEncoding Individual { get { return Permutation as AlbaEncoding; } } 35 35 36 [StorableConstructor] 37 protected AlbaIntraRouteInversionMove(bool deserializing) : base(deserializing) { } 38 39 protected AlbaIntraRouteInversionMove(AlbaIntraRouteInversionMove original, Cloner cloner) 40 : base(original, cloner) { 41 } 42 36 43 public AlbaIntraRouteInversionMove() 37 44 : base() { … … 43 50 44 51 public AlbaIntraRouteInversionMove(int index1, int index2, AlbaEncoding permutation) 45 : base(index1, index2, permutation.Clone() as AlbaEncoding) { 52 : base(index1, index2, null) { 53 this.Permutation = permutation.Clone() as AlbaEncoding; 46 54 } 47 55 48 56 public override IDeepCloneable Clone(Cloner cloner) { 49 57 return new AlbaIntraRouteInversionMove(this, cloner); 50 }51 52 protected AlbaIntraRouteInversionMove(AlbaIntraRouteInversionMove original, Cloner cloner)53 : base(original, cloner) {54 if (Permutation != null)55 this.Permutation = cloner.Clone(original.Permutation);56 58 } 57 59 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionMutliMoveGenerator.cs
r4752 r5867 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Common; 32 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 34 35 [Item("AlbaStochasticIntraRouteInversionMultiMoveGenerator", "Generates multiple random intra route inversion moves from a given VRP encoding. It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")] 35 36 [StorableClass] 36 public sealed class AlbaStochasticIntraRouteInversionMultiMoveGenerator : AlbaIntraRouteInversionMoveGenerator, IStochasticOperator, IMultiMoveGenerator, IAlbaIntraRouteInversionMoveOperator { 37 public sealed class AlbaStochasticIntraRouteInversionMultiMoveGenerator : AlbaIntraRouteInversionMoveGenerator, IStochasticOperator, 38 IMultiMoveGenerator, IAlbaIntraRouteInversionMoveOperator, IMultiVRPMoveGenerator { 37 39 public ILookupParameter<IRandom> RandomParameter { 38 40 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionSingleMoveGenerator.cs
r4752 r5867 35 35 [StorableClass] 36 36 public sealed class AlbaStochasticIntraRouteInversionSingleMoveGenerator : AlbaIntraRouteInversionMoveGenerator, 37 IStochasticOperator, ISingleMoveGenerator, IAlbaIntraRouteInversionMoveOperator , IMultiVRPMoveGenerator{37 IStochasticOperator, ISingleMoveGenerator, IAlbaIntraRouteInversionMoveOperator { 38 38 #region IMultiVRPMoveOperator Members 39 39 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeMutliMoveGenerator.cs
r4752 r5867 30 30 using HeuristicLab.Problems.VehicleRouting.Interfaces; 31 31 using HeuristicLab.Common; 32 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 34 35 [Item("AlbaStochasticLambdaInterchangeMultiMoveGenerator", "Generates multiple random lambda interchange moves from a given VRP encoding. It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")] 35 36 [StorableClass] 36 public sealed class AlbaStochasticLambdaInterchangeMultiMoveGenerator : AlbaLambdaInterchangeMoveGenerator, IStochasticOperator, IMultiMoveGenerator, IAlbaLambdaInterchangeMoveOperator { 37 public sealed class AlbaStochasticLambdaInterchangeMultiMoveGenerator : AlbaLambdaInterchangeMoveGenerator, IStochasticOperator, 38 IMultiMoveGenerator, IAlbaLambdaInterchangeMoveOperator, IMultiVRPMoveGenerator { 37 39 public ILookupParameter<IRandom> RandomParameter { 38 40 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeSingleMoveGenerator.cs
r5201 r5867 35 35 [StorableClass] 36 36 public sealed class AlbaStochasticLambdaInterchangeSingleMoveGenerator : AlbaLambdaInterchangeMoveGenerator, 37 IStochasticOperator, ISingleMoveGenerator, IAlbaLambdaInterchangeMoveOperator , IMultiVRPMoveGenerator{37 IStochasticOperator, ISingleMoveGenerator, IAlbaLambdaInterchangeMoveOperator { 38 38 #region IMultiVRPMoveOperator Members 39 39 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaStochasticTranslocationSingleMoveGenerator.cs
r5130 r5867 34 34 [Item("AlbaStochasticTranslocationSingleMoveGenerator", "An operator which generates a single translocation move for a VRP representation. It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")] 35 35 [StorableClass] 36 public sealed class AlbaStochasticTranslocationSingleMoveGenerator : AlbaMoveGenerator, IAlbaTranslocationMoveOperator , IMultiVRPMoveGenerator{36 public sealed class AlbaStochasticTranslocationSingleMoveGenerator : AlbaMoveGenerator, IAlbaTranslocationMoveOperator { 37 37 [Storable] 38 38 private TranslocationMoveGenerator generator = new StochasticTranslocationSingleMoveGenerator(); … … 80 80 generator.PermutationParameter.ActualName = VRPToursParameter.ActualName; 81 81 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(generator); 82 op.Operator.Execute((IExecutionContext)op );82 op.Operator.Execute((IExecutionContext)op, CancellationToken); 83 83 84 84 foreach (IScope scope in this.ExecutionContext.Scope.SubScopes) { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r4752 r5867 101 101 PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName; 102 102 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter); 103 op.Operator.Execute((IExecutionContext)op );103 op.Operator.Execute((IExecutionContext)op, CancellationToken); 104 104 105 105 return next; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs
r5130 r5867 78 78 private AlbaTranslocationMoveHardTabuCriterion(AlbaTranslocationMoveHardTabuCriterion original, Cloner cloner) 79 79 : base(original, cloner) { 80 tabuChecker = cloner.Clone(original.tabuChecker); 80 81 } 81 82 … … 87 88 PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName; 88 89 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter); 89 op.Operator.Execute((IExecutionContext)op );90 op.Operator.Execute((IExecutionContext)op, CancellationToken); 90 91 91 92 return next; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs
r5130 r5867 61 61 private AlbaTranslocationMoveMaker(AlbaTranslocationMoveMaker original, Cloner cloner) 62 62 : base(original, cloner) { 63 moveMaker = cloner.Clone(original.moveMaker); 63 64 } 64 65 … … 71 72 moveMaker.PermutationParameter.ActualName = VRPToursParameter.ActualName; 72 73 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(moveMaker); 73 op.Operator.Execute((IExecutionContext)op );74 op.Operator.Execute((IExecutionContext)op, CancellationToken); 74 75 } 75 76 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs
r5130 r5867 78 78 private AlbaTranslocationMoveSoftTabuCriterion(AlbaTranslocationMoveSoftTabuCriterion original, Cloner cloner) 79 79 : base(original, cloner) { 80 tabuChecker = cloner.Clone(original.tabuChecker); 80 81 } 81 82 … … 87 88 PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName; 88 89 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter); 89 op.Operator.Execute((IExecutionContext)op );90 op.Operator.Execute((IExecutionContext)op, CancellationToken); 90 91 91 92 return next; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs
r5130 r5867 78 78 private AlbaTranslocationMoveTabuMaker(AlbaTranslocationMoveTabuMaker original, Cloner cloner) 79 79 : base(original, cloner) { 80 moveTabuMaker = cloner.Clone(original.moveTabuMaker); 80 81 } 81 82 … … 87 88 PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName; 88 89 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter); 89 op.Operator.Execute((IExecutionContext)op );90 op.Operator.Execute((IExecutionContext)op, CancellationToken); 90 91 91 92 return next; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs
r4752 r5867 58 58 moveEvaluator.VRPMoveParameter.ActualName = VRPMoveParameter.Name; 59 59 IAtomicOperation op = this.ExecutionContext.CreateOperation(moveEvaluator); 60 op.Operator.Execute((IExecutionContext)op );60 op.Operator.Execute((IExecutionContext)op, CancellationToken); 61 61 } 62 62 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r4752 r5867 60 60 moveMaker.VRPMoveParameter.ActualName = VRPMoveParameter.Name; 61 61 IAtomicOperation op = this.ExecutionContext.CreateOperation(moveMaker); 62 op.Operator.Execute((IExecutionContext)op );62 op.Operator.Execute((IExecutionContext)op, CancellationToken); 63 63 } 64 64 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveEvaluator.cs
r5127 r5867 64 64 //helper method to evaluate an updated individual 65 65 protected void UpdateEvaluation(IVRPEncoding updatedTours) { 66 IVRPEvaluator evaluator = ProblemInstance.EvaluatorParameter.Value.Clone() as IVRPEvaluator; 67 68 Dictionary<IParameter, string> originalName = 69 new Dictionary<IParameter, string>(); 70 71 foreach (IParameter parameter in evaluator.Parameters) { 72 if (parameter is ILookupParameter 73 && parameter != evaluator.ProblemInstanceParameter 74 && parameter != evaluator.VRPToursParameter) { 75 originalName[parameter] = (parameter as ILookupParameter).ActualName; 76 77 (parameter as ILookupParameter).ActualName = 78 MovePrefix + 79 (parameter as ILookupParameter).ActualName; 80 } 81 } 66 IVRPEvaluator evaluator = ProblemInstance.MoveEvaluator; 82 67 83 68 try { … … 86 71 87 72 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(evaluator); 88 op.Operator.Execute((IExecutionContext)op );73 op.Operator.Execute((IExecutionContext)op, CancellationToken); 89 74 } 90 75 finally { 91 foreach (IParameter parameter in originalName.Keys) {92 (parameter as ILookupParameter).ActualName = originalName[parameter];93 }94 95 76 this.ExecutionContext.Scope.Variables.Remove(evaluator.VRPToursParameter.ActualName); 96 77 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs
r5127 r5867 34 34 public abstract class TourEncoding : Item, IVRPEncoding { 35 35 public override Image ItemImage { 36 get { return HeuristicLab.Common.Resources.VS 2008ImageLibrary.Class; }36 get { return HeuristicLab.Common.Resources.VSImageLibrary.Class; } 37 37 } 38 38 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs
r4752 r5867 44 44 : base(original, cloner) { 45 45 } 46 46 47 47 protected override void Manipulate(IRandom random, PotvinEncoding individual) { 48 48 int selectedIndex = SelectRandomTourBiasedByLength(random, individual); 49 Tour route1 = 50 individual.Tours[selectedIndex]; 49 Tour route1 = individual.Tours[selectedIndex]; 51 50 52 for (int customer1Position = 0; customer1Position < route1.Stops.Count; customer1Position++) { 51 bool performed = false; 52 int customer1Position = 0; 53 while (customer1Position < route1.Stops.Count) { 54 performed = false; 55 53 56 foreach (Tour tour in individual.Tours) { 54 57 if (tour != route1) { … … 60 63 tour.Stops[customer2Position] = customer1; 61 64 if (ProblemInstance.Feasible(tour)) { 62 int route , place;65 int routeIdx, place; 63 66 if (FindInsertionPlace(individual, 64 customer2, selectedIndex, out route , out place)) {65 individual.Tours[route].Stops.Insert(place, customer2);66 67 customer2, selectedIndex, out routeIdx, out place)) { 68 individual.Tours[routeIdx].Stops.Insert(place, customer2); 69 route1.Stops.RemoveAt(customer1Position); 67 70 68 71 if (route1.Stops.Count == 0) 69 72 individual.Tours.Remove(route1); 70 73 71 74 //two-level exchange has been performed 72 return; 75 performed = true; 76 break; 73 77 } else { 74 78 tour.Stops[customer2Position] = customer2; … … 79 83 } 80 84 } 85 86 if (performed) 87 break; 81 88 } 89 90 if (!performed) 91 customer1Position++; 82 92 } 83 93 } -
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 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
r4752 r5867 58 58 IAtomicOperation op = this.ExecutionContext.CreateOperation( 59 59 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 60 op.Operator.Execute((IExecutionContext)op );60 op.Operator.Execute((IExecutionContext)op, CancellationToken); 61 61 62 62 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsPermutationManipulator.cs
r4752 r5867 56 56 IAtomicOperation op = this.ExecutionContext.CreateOperation( 57 57 InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope); 58 op.Operator.Execute((IExecutionContext)op );58 op.Operator.Execute((IExecutionContext)op, CancellationToken); 59 59 } 60 60 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuPermutationCrossover.cs
r4752 r5867 58 58 IAtomicOperation op = this.ExecutionContext.CreateOperation( 59 59 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 60 op.Operator.Execute((IExecutionContext)op );60 op.Operator.Execute((IExecutionContext)op, CancellationToken); 61 61 62 62 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Manipulators/ZhuPermutationManipulator.cs
r4752 r5867 56 56 IAtomicOperation op = this.ExecutionContext.CreateOperation( 57 57 InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope); 58 op.Operator.Execute((IExecutionContext)op );58 op.Operator.Execute((IExecutionContext)op, CancellationToken); 59 59 } 60 60 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r5127 r5867 18 18 <UpgradeBackupLocation> 19 19 </UpgradeBackupLocation> 20 <TargetFrameworkVersion>v 3.5</TargetFrameworkVersion>20 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 21 21 <PublishUrl>publish\</PublishUrl> 22 22 <Install>true</Install> … … 34 34 <UseApplicationTrust>false</UseApplicationTrust> 35 35 <BootstrapperEnabled>true</BootstrapperEnabled> 36 <TargetFrameworkProfile /> 36 37 </PropertyGroup> 37 38 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs
r4860 r5867 31 31 public interface IVRPProblemInstance: IItem { 32 32 IValueParameter<IVRPEvaluator> EvaluatorParameter { get; } 33 IVRPEvaluator MoveEvaluator { get; } 33 34 IValueParameter<IVRPCreator> SolutionCreatorParameter { get; } 34 35 IValueParameter<DoubleValue> BestKnownQualityParameter { get; } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r5127 r5867 32 32 using HeuristicLab.PluginInfrastructure; 33 33 using HeuristicLab.Common; 34 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 34 35 35 36 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { … … 39 40 public IValueParameter<IVRPEvaluator> EvaluatorParameter { 40 41 get { return (ValueParameter<IVRPEvaluator>)Parameters["Evaluator"]; } 42 } 43 44 IVRPEvaluator moveEvaluator; 45 46 public IVRPEvaluator MoveEvaluator { 47 get { 48 if (EvaluatorParameter.Value == null) 49 return null; 50 else { 51 if (moveEvaluator == null) { 52 moveEvaluator = EvaluatorParameter.Value.Clone() as IVRPEvaluator; 53 54 foreach (IParameter parameter in moveEvaluator.Parameters) { 55 if (parameter is ILookupParameter 56 && parameter != moveEvaluator.ProblemInstanceParameter 57 && parameter != moveEvaluator.VRPToursParameter) { 58 (parameter as ILookupParameter).ActualName = 59 VRPMoveEvaluator.MovePrefix + 60 (parameter as ILookupParameter).ActualName; 61 } 62 } 63 } 64 65 return moveEvaluator; 66 } 67 } 41 68 } 42 69 … … 253 280 254 281 private void AttachEventHandlers() { 282 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 255 283 BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged); 256 284 DistanceFactorParameter.ValueChanged += new EventHandler(DistanceFactorParameter_ValueChanged); … … 268 296 269 297 #region Event handlers 298 void EvaluatorParameter_ValueChanged(object sender, EventArgs e) { 299 moveEvaluator = null; 300 } 301 270 302 void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) { 271 303 EvalBestKnownSolution(); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r4860 r5867 41 41 [Creatable("Problems")] 42 42 [StorableClass] 43 public sealed class VehicleRoutingProblem : ParameterizedNamedItem, ISingleObjective Problem, IStorableContent {43 public sealed class VehicleRoutingProblem : ParameterizedNamedItem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent { 44 44 public string Filename { get; set; } 45 45 46 46 public override Image ItemImage { 47 get { return HeuristicLab.Common.Resources.VS 2008ImageLibrary.Type; }47 get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; } 48 48 } 49 49 … … 52 52 get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; } 53 53 } 54 IParameter ISingleObjective Problem.MaximizationParameter {54 IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter { 55 55 get { return MaximizationParameter; } 56 56 } … … 61 61 get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 62 62 } 63 IParameter ISingleObjective Problem.BestKnownQualityParameter {63 IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter { 64 64 get { return BestKnownQualityParameter; } 65 65 } … … 70 70 get { return (IValueParameter<IVRPCreator>)Parameters["SolutionCreator"]; } 71 71 } 72 IParameter I Problem.SolutionCreatorParameter {72 IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter { 73 73 get { return SolutionCreatorParameter; } 74 74 } … … 76 76 get { return (IValueParameter<IVRPEvaluator>)Parameters["Evaluator"]; } 77 77 } 78 IParameter I Problem.EvaluatorParameter {78 IParameter IHeuristicOptimizationProblem.EvaluatorParameter { 79 79 get { return EvaluatorParameter; } 80 80 } … … 96 96 } 97 97 98 IEvaluator I Problem.Evaluator {98 IEvaluator IHeuristicOptimizationProblem.Evaluator { 99 99 get { return this.Evaluator; } 100 100 }
Note: See TracChangeset
for help on using the changeset viewer.