Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveMaker.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveMaker.cs (revision 4207)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveMaker.cs (revision 4208)
@@ -26,5 +26,5 @@
namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
- [Item("AlbaTranslocationMoveMaker", "An operator which makes translocation moves for the Alba representation.")]
+ [Item("PermutationTranslocationMoveMaker", "An operator which makes translocation moves for the Alba representation.")]
[StorableClass]
public abstract class AlbaMoveMaker : AlbaMoveOperator {
Index: unk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs (revision 4207)
+++ (revision )
@@ -1,59 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Core;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
-
-namespace HeuristicLab.Problems.VehicleRouting {
- [Item("AlbaTranslocationMoveEvaluator", "Evaluates a translocation or insertion move (3-opt) for a VRP representation.")]
- [StorableClass]
- public sealed class AlbaTranslocationMoveEvaluator : VRPMoveEvaluator, IAlbaTranslocationMoveOperator {
- public ILookupParameter TranslocationMoveParameter {
- get { return (ILookupParameter)Parameters["TranslocationMove"]; }
- set { Parameters["TranslocationMove"].ActualValue = value.ActualValue; }
- }
-
- [StorableConstructor]
- private AlbaTranslocationMoveEvaluator(bool deserializing) : base(deserializing) { }
-
- public AlbaTranslocationMoveEvaluator()
- : base() {
- Parameters.Add(new LookupParameter("TranslocationMove", "The move to evaluate."));
- }
-
- protected override TourEvaluation GetMoveQuality() {
- TranslocationMove move = TranslocationMoveParameter.ActualValue;
- //perform move
- AlbaEncoding newSolution = VRPToursParameter.ActualValue.Clone() as AlbaEncoding;
- TranslocationManipulator.Apply(newSolution, move.Index1, move.Index2, move.Index3);
-
- return VRPEvaluator.Evaluate(
- newSolution,
- DueTimeParameter.ActualValue, ServiceTimeParameter.ActualValue, ReadyTimeParameter.ActualValue,
- DemandParameter.ActualValue, CapacityParameter.ActualValue,
- FleetUsageFactor.ActualValue, TimeFactor.ActualValue, DistanceFactor.ActualValue, OverloadPenalty.ActualValue, TardinessPenalty.ActualValue,
- CoordinatesParameter.ActualValue, DistanceMatrixParameter, UseDistanceMatrixParameter.ActualValue);
- }
- }
-}
Index: unk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs (revision 4207)
+++ (revision )
@@ -1,91 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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 System.Collections.Generic;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
- [Item("AlbaTranslocationMoveGenerator", "An operator which generates translocation moves for a VRP representation.")]
- [StorableClass]
- public sealed class AlbaTranslocationMoveGenerator : PermutationMoveOperator, IAlbaTranslocationMoveOperator, IMultiMoveGenerator {
- public IValueLookupParameter TranslocationMoveGeneratorParameter {
- get { return (IValueLookupParameter)Parameters["TranslocationMoveGenerator"]; }
- }
-
- protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
- get { return TranslocationMoveGeneratorParameter.Value; }
- set {
- TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator;
- if (TranslocationMoveGeneratorParameter.Value is IMultiMoveGenerator) {
- ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name;
- }
- }
- }
-
- public ILookupParameter TranslocationMoveParameter {
- get {
- if (TranslocationMoveGeneratorParameter.Value != null)
- return TranslocationMoveGeneratorParameter.Value.TranslocationMoveParameter;
- else
- return null;
- }
- }
-
- public ILookupParameter PermutationParameter {
- get {
- if (TranslocationMoveGeneratorParameter.Value != null)
- return TranslocationMoveGeneratorParameter.Value.PermutationParameter;
- else
- return null;
- }
- }
-
- public IValueLookupParameter SampleSizeParameter {
- get { return (IValueLookupParameter)Parameters["SampleSize"]; }
- }
-
- [StorableConstructor]
- private AlbaTranslocationMoveGenerator(bool deserializing) : base(deserializing) { }
-
- public AlbaTranslocationMoveGenerator()
- : base() {
- Parameters.Add(new ValueLookupParameter("TranslocationMoveGenerator", "The move generator.",
- new StochasticTranslocationMultiMoveGenerator()));
- Parameters.Add(new ValueLookupParameter("SampleSize", "The number of moves to generate."));
-
- ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name;
- }
-
- public override IOperation Apply() {
- IOperation successor = base.Apply();
-
- Permutation permutation = VRPToursParameter.ActualValue as Permutation;
- string moveName = TranslocationMoveGeneratorParameter.ActualValue.TranslocationMoveParameter.Name;
-
- return successor;
- }
- }
-}
Index: unk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs (revision 4207)
+++ (revision )
@@ -1,66 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
- [Item("AlbaTranslocationMoveHardTabuCriterion", "An operator which checks if translocation moves are tabu using a hard criterion for a VRP representation.")]
- [StorableClass]
- public sealed class AlbaTranslocationMoveHardTabuCriterion : PermutationMoveOperator, IAlbaTranslocationMoveOperator, ITabuChecker {
- private TranslocationMoveHardTabuCriterion tabuChecker;
- protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
- get { return tabuChecker; }
- set { tabuChecker = value as TranslocationMoveHardTabuCriterion; }
- }
-
- public ILookupParameter TranslocationMoveParameter {
- get { return tabuChecker.TranslocationMoveParameter; }
- }
-
- public ILookupParameter PermutationParameter {
- get { return tabuChecker.PermutationParameter; }
- }
-
- public ILookupParameter MoveTabuParameter {
- get { return tabuChecker.MoveTabuParameter; }
- }
-
- public ILookupParameter MoveQualityParameter {
- get { return tabuChecker.MoveQualityParameter; }
- }
-
- public IValueLookupParameter MaximizationParameter {
- get { return tabuChecker.MaximizationParameter; }
- }
-
- [StorableConstructor]
- private AlbaTranslocationMoveHardTabuCriterion(bool deserializing) : base(deserializing) { }
-
- public AlbaTranslocationMoveHardTabuCriterion()
- : base() {
- tabuChecker = new TranslocationMoveHardTabuCriterion();
- }
- }
-}
Index: unk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs (revision 4207)
+++ (revision )
@@ -1,70 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
- [Item("AlbaTranslocationMoveMaker", "An operator which makes translocation moves for a VRP representation.")]
- [StorableClass]
- public sealed class AlbaTranslocationMoveMaker : AlbaMoveMaker, IAlbaTranslocationMoveOperator, IVRPMoveMaker {
- private TranslocationMoveMaker moveMaker;
-
- public ILookupParameter TranslocationMoveParameter {
- get { return moveMaker.TranslocationMoveParameter; }
- }
-
- public ILookupParameter QualityParameter {
- get { return moveMaker.QualityParameter; }
- }
-
- public ILookupParameter MoveQualityParameter {
- get { return moveMaker.MoveQualityParameter; }
- }
-
- public ILookupParameter PermutationParameter {
- get { return moveMaker.PermutationParameter; }
- }
-
- [StorableConstructor]
- private AlbaTranslocationMoveMaker(bool deserializing) : base(deserializing) { }
-
- public AlbaTranslocationMoveMaker()
- : base() {
- moveMaker = new TranslocationMoveMaker();
- }
-
- public override IOperation Apply() {
- IOperation next = base.Apply();
-
- IVRPEncoding solution = VRPToursParameter.ActualValue;
-
- moveMaker.PermutationParameter.ActualName = VRPToursParameter.ActualName;
- IAtomicOperation op = this.ExecutionContext.CreateChildOperation(moveMaker);
- op.Operator.Execute((IExecutionContext)op);
-
- return next;
- }
- }
-}
Index: unk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs (revision 4207)
+++ (revision )
@@ -1,66 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
- [Item("AlbaTranslocationMoveSoftTabuCriterion", "An operator which checks if translocation moves are tabu using a soft criterion for a VRP representation.")]
- [StorableClass]
- public sealed class AlbaTranslocationMoveSoftTabuCriterion : PermutationMoveOperator, IAlbaTranslocationMoveOperator, ITabuChecker {
- private TranslocationMoveSoftTabuCriterion tabuChecker;
- protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
- get { return tabuChecker; }
- set { tabuChecker = value as TranslocationMoveSoftTabuCriterion; }
- }
-
- public ILookupParameter TranslocationMoveParameter {
- get { return tabuChecker.TranslocationMoveParameter; }
- }
-
- public ILookupParameter PermutationParameter {
- get { return tabuChecker.PermutationParameter; }
- }
-
- public ILookupParameter MoveTabuParameter {
- get { return tabuChecker.MoveTabuParameter; }
- }
-
- public ILookupParameter MoveQualityParameter {
- get { return tabuChecker.MoveQualityParameter; }
- }
-
- public IValueLookupParameter MaximizationParameter {
- get { return tabuChecker.MaximizationParameter; }
- }
-
- [StorableConstructor]
- private AlbaTranslocationMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { }
-
- public AlbaTranslocationMoveSoftTabuCriterion()
- : base() {
- tabuChecker = new TranslocationMoveSoftTabuCriterion();
- }
- }
-}
Index: unk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs (revision 4207)
+++ (revision )
@@ -1,66 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
- [Item("AlbaTranslocationMoveTabuMaker", "An operator which makes translocation moves tabu for a VRP representation.")]
- [StorableClass]
- public sealed class AlbaTranslocationMoveTabuMaker : PermutationMoveOperator, IAlbaTranslocationMoveOperator, ITabuMaker {
- private TranslocationMoveTabuMaker moveTabuMaker;
- protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
- get { return moveTabuMaker; }
- set { moveTabuMaker = value as TranslocationMoveTabuMaker; }
- }
-
- public ILookupParameter PermutationParameter {
- get { return moveTabuMaker.PermutationParameter; }
- }
-
- public ILookupParameter TranslocationMoveParameter {
- get { return moveTabuMaker.TranslocationMoveParameter; }
- }
-
- public ILookupParameter MoveQualityParameter {
- get { return moveTabuMaker.MoveQualityParameter; }
- }
-
- public ILookupParameter QualityParameter {
- get { return moveTabuMaker.QualityParameter; }
- }
-
- public IValueLookupParameter MaximizationParameter {
- get { return moveTabuMaker.MaximizationParameter; }
- }
-
- [StorableConstructor]
- private AlbaTranslocationMoveTabuMaker(bool deserializing) : base(deserializing) { }
-
- public AlbaTranslocationMoveTabuMaker()
- : base() {
- moveTabuMaker = new TranslocationMoveTabuMaker();
- }
- }
-}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveEvaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveEvaluator.cs (revision 4208)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveEvaluator.cs (revision 4208)
@@ -0,0 +1,59 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Core;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
+
+namespace HeuristicLab.Problems.VehicleRouting {
+ [Item("PermutationTranslocationMoveEvaluator", "Evaluates a translocation or insertion move (3-opt) for a VRP representation.")]
+ [StorableClass]
+ public sealed class PermutationTranslocationMoveEvaluator : VRPMoveEvaluator, IAlbaTranslocationMoveOperator {
+ public ILookupParameter TranslocationMoveParameter {
+ get { return (ILookupParameter)Parameters["TranslocationMove"]; }
+ set { Parameters["TranslocationMove"].ActualValue = value.ActualValue; }
+ }
+
+ [StorableConstructor]
+ private PermutationTranslocationMoveEvaluator(bool deserializing) : base(deserializing) { }
+
+ public PermutationTranslocationMoveEvaluator()
+ : base() {
+ Parameters.Add(new LookupParameter("TranslocationMove", "The move to evaluate."));
+ }
+
+ protected override TourEvaluation GetMoveQuality() {
+ TranslocationMove move = TranslocationMoveParameter.ActualValue;
+ //perform move
+ AlbaEncoding newSolution = VRPToursParameter.ActualValue.Clone() as AlbaEncoding;
+ TranslocationManipulator.Apply(newSolution, move.Index1, move.Index2, move.Index3);
+
+ return VRPEvaluator.Evaluate(
+ newSolution,
+ DueTimeParameter.ActualValue, ServiceTimeParameter.ActualValue, ReadyTimeParameter.ActualValue,
+ DemandParameter.ActualValue, CapacityParameter.ActualValue,
+ FleetUsageFactor.ActualValue, TimeFactor.ActualValue, DistanceFactor.ActualValue, OverloadPenalty.ActualValue, TardinessPenalty.ActualValue,
+ CoordinatesParameter.ActualValue, DistanceMatrixParameter, UseDistanceMatrixParameter.ActualValue);
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveGenerator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveGenerator.cs (revision 4208)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveGenerator.cs (revision 4208)
@@ -0,0 +1,91 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 System.Collections.Generic;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
+ [Item("PermutationTranslocationMoveGenerator", "An operator which generates translocation moves for a VRP representation.")]
+ [StorableClass]
+ public sealed class PermutationTranslocationMoveGenerator : PermutationMoveOperator, IAlbaTranslocationMoveOperator, IMultiMoveGenerator {
+ public IValueLookupParameter TranslocationMoveGeneratorParameter {
+ get { return (IValueLookupParameter)Parameters["TranslocationMoveGenerator"]; }
+ }
+
+ protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
+ get { return TranslocationMoveGeneratorParameter.Value; }
+ set {
+ TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator;
+ if (TranslocationMoveGeneratorParameter.Value is IMultiMoveGenerator) {
+ ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name;
+ }
+ }
+ }
+
+ public ILookupParameter TranslocationMoveParameter {
+ get {
+ if (TranslocationMoveGeneratorParameter.Value != null)
+ return TranslocationMoveGeneratorParameter.Value.TranslocationMoveParameter;
+ else
+ return null;
+ }
+ }
+
+ public ILookupParameter PermutationParameter {
+ get {
+ if (TranslocationMoveGeneratorParameter.Value != null)
+ return TranslocationMoveGeneratorParameter.Value.PermutationParameter;
+ else
+ return null;
+ }
+ }
+
+ public IValueLookupParameter SampleSizeParameter {
+ get { return (IValueLookupParameter)Parameters["SampleSize"]; }
+ }
+
+ [StorableConstructor]
+ private PermutationTranslocationMoveGenerator(bool deserializing) : base(deserializing) { }
+
+ public PermutationTranslocationMoveGenerator()
+ : base() {
+ Parameters.Add(new ValueLookupParameter("TranslocationMoveGenerator", "The move generator.",
+ new StochasticTranslocationMultiMoveGenerator()));
+ Parameters.Add(new ValueLookupParameter("SampleSize", "The number of moves to generate."));
+
+ ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name;
+ }
+
+ public override IOperation Apply() {
+ IOperation successor = base.Apply();
+
+ Permutation permutation = VRPToursParameter.ActualValue as Permutation;
+ string moveName = TranslocationMoveGeneratorParameter.ActualValue.TranslocationMoveParameter.Name;
+
+ return successor;
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveHardTabuCriterion.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveHardTabuCriterion.cs (revision 4208)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveHardTabuCriterion.cs (revision 4208)
@@ -0,0 +1,66 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
+ [Item("PermutationTranslocationMoveHardTabuCriterion", "An operator which checks if translocation moves are tabu using a hard criterion for a VRP representation.")]
+ [StorableClass]
+ public sealed class PermutationTranslocationMoveHardTabuCriterion : PermutationMoveOperator, IAlbaTranslocationMoveOperator, ITabuChecker {
+ private TranslocationMoveHardTabuCriterion tabuChecker;
+ protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
+ get { return tabuChecker; }
+ set { tabuChecker = value as TranslocationMoveHardTabuCriterion; }
+ }
+
+ public ILookupParameter TranslocationMoveParameter {
+ get { return tabuChecker.TranslocationMoveParameter; }
+ }
+
+ public ILookupParameter PermutationParameter {
+ get { return tabuChecker.PermutationParameter; }
+ }
+
+ public ILookupParameter MoveTabuParameter {
+ get { return tabuChecker.MoveTabuParameter; }
+ }
+
+ public ILookupParameter MoveQualityParameter {
+ get { return tabuChecker.MoveQualityParameter; }
+ }
+
+ public IValueLookupParameter MaximizationParameter {
+ get { return tabuChecker.MaximizationParameter; }
+ }
+
+ [StorableConstructor]
+ private PermutationTranslocationMoveHardTabuCriterion(bool deserializing) : base(deserializing) { }
+
+ public PermutationTranslocationMoveHardTabuCriterion()
+ : base() {
+ tabuChecker = new TranslocationMoveHardTabuCriterion();
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveMaker.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveMaker.cs (revision 4208)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveMaker.cs (revision 4208)
@@ -0,0 +1,70 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
+ [Item("PermutationTranslocationMoveMaker", "An operator which makes translocation moves for a VRP representation.")]
+ [StorableClass]
+ public sealed class PermutationTranslocationMoveMaker : AlbaMoveMaker, IAlbaTranslocationMoveOperator, IVRPMoveMaker {
+ private TranslocationMoveMaker moveMaker;
+
+ public ILookupParameter TranslocationMoveParameter {
+ get { return moveMaker.TranslocationMoveParameter; }
+ }
+
+ public ILookupParameter QualityParameter {
+ get { return moveMaker.QualityParameter; }
+ }
+
+ public ILookupParameter MoveQualityParameter {
+ get { return moveMaker.MoveQualityParameter; }
+ }
+
+ public ILookupParameter PermutationParameter {
+ get { return moveMaker.PermutationParameter; }
+ }
+
+ [StorableConstructor]
+ private PermutationTranslocationMoveMaker(bool deserializing) : base(deserializing) { }
+
+ public PermutationTranslocationMoveMaker()
+ : base() {
+ moveMaker = new TranslocationMoveMaker();
+ }
+
+ public override IOperation Apply() {
+ IOperation next = base.Apply();
+
+ IVRPEncoding solution = VRPToursParameter.ActualValue;
+
+ moveMaker.PermutationParameter.ActualName = VRPToursParameter.ActualName;
+ IAtomicOperation op = this.ExecutionContext.CreateChildOperation(moveMaker);
+ op.Operator.Execute((IExecutionContext)op);
+
+ return next;
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveSoftTabuCriterion.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveSoftTabuCriterion.cs (revision 4208)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveSoftTabuCriterion.cs (revision 4208)
@@ -0,0 +1,66 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
+ [Item("PermutationTranslocationMoveSoftTabuCriterion", "An operator which checks if translocation moves are tabu using a soft criterion for a VRP representation.")]
+ [StorableClass]
+ public sealed class PermutationTranslocationMoveSoftTabuCriterion : PermutationMoveOperator, IAlbaTranslocationMoveOperator, ITabuChecker {
+ private TranslocationMoveSoftTabuCriterion tabuChecker;
+ protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
+ get { return tabuChecker; }
+ set { tabuChecker = value as TranslocationMoveSoftTabuCriterion; }
+ }
+
+ public ILookupParameter TranslocationMoveParameter {
+ get { return tabuChecker.TranslocationMoveParameter; }
+ }
+
+ public ILookupParameter PermutationParameter {
+ get { return tabuChecker.PermutationParameter; }
+ }
+
+ public ILookupParameter MoveTabuParameter {
+ get { return tabuChecker.MoveTabuParameter; }
+ }
+
+ public ILookupParameter MoveQualityParameter {
+ get { return tabuChecker.MoveQualityParameter; }
+ }
+
+ public IValueLookupParameter MaximizationParameter {
+ get { return tabuChecker.MaximizationParameter; }
+ }
+
+ [StorableConstructor]
+ private PermutationTranslocationMoveSoftTabuCriterion(bool deserializing) : base(deserializing) { }
+
+ public PermutationTranslocationMoveSoftTabuCriterion()
+ : base() {
+ tabuChecker = new TranslocationMoveSoftTabuCriterion();
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveTabuMaker.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveTabuMaker.cs (revision 4208)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/PermutationTranslocationMoveTabuMaker.cs (revision 4208)
@@ -0,0 +1,66 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
+ [Item("PermutationTranslocationMoveTabuMaker", "An operator which makes translocation moves tabu for a VRP representation.")]
+ [StorableClass]
+ public sealed class PermutationTranslocationMoveTabuMaker : PermutationMoveOperator, IAlbaTranslocationMoveOperator, ITabuMaker {
+ private TranslocationMoveTabuMaker moveTabuMaker;
+ protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
+ get { return moveTabuMaker; }
+ set { moveTabuMaker = value as TranslocationMoveTabuMaker; }
+ }
+
+ public ILookupParameter PermutationParameter {
+ get { return moveTabuMaker.PermutationParameter; }
+ }
+
+ public ILookupParameter TranslocationMoveParameter {
+ get { return moveTabuMaker.TranslocationMoveParameter; }
+ }
+
+ public ILookupParameter MoveQualityParameter {
+ get { return moveTabuMaker.MoveQualityParameter; }
+ }
+
+ public ILookupParameter QualityParameter {
+ get { return moveTabuMaker.QualityParameter; }
+ }
+
+ public IValueLookupParameter MaximizationParameter {
+ get { return moveTabuMaker.MaximizationParameter; }
+ }
+
+ [StorableConstructor]
+ private PermutationTranslocationMoveTabuMaker(bool deserializing) : base(deserializing) { }
+
+ public PermutationTranslocationMoveTabuMaker()
+ : base() {
+ moveTabuMaker = new TranslocationMoveTabuMaker();
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/HeuristicLab.Problems.VehicleRouting-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/HeuristicLab.Problems.VehicleRouting-3.3.csproj (revision 4207)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/HeuristicLab.Problems.VehicleRouting-3.3.csproj (revision 4208)
@@ -158,9 +158,9 @@
-
-
-
-
-
+
+
+
+
+
@@ -180,5 +180,5 @@
-
+