- Timestamp:
- 03/28/11 15:34:30 (13 years ago)
- Location:
- branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPEvaluator.cs
r5598 r5838 35 35 get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } 36 36 } 37 public ILookupParameter<DoubleMatrix> DistanceMatrixParameter { 38 get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; } 39 } 40 public ILookupParameter<DoubleMatrix> CoordinatesParameter { 41 get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; } 37 public ILookupParameter<DoubleMatrix> DistancesParameter { 38 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; } 42 39 } 43 40 public ILookupParameter<DoubleMatrix> WeightsParameter { … … 53 50 public QAPEvaluator() { 54 51 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that represents the current solution.")); 55 Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The distance matrix that contains the distances between the locations.")); 56 Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates in case the distance matrix should not be used.")); 52 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distance matrix that contains the distances between the locations.")); 57 53 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The matrix with the weights between the facilities, that is how strongly they're connected to each other.")); 58 54 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value aka fitness value of the solution.")); … … 76 72 Permutation assignment = PermutationParameter.ActualValue; 77 73 DoubleMatrix weights = WeightsParameter.ActualValue; 78 DoubleMatrix distanceMatrix = Distance MatrixParameter.ActualValue;74 DoubleMatrix distanceMatrix = DistancesParameter.ActualValue; 79 75 80 76 double quality = Apply(assignment, weights, distanceMatrix); -
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPInversionMoveEvaluator.cs
r5785 r5838 73 73 if (move == null) throw new InvalidOperationException("Inversion move is not found."); 74 74 Permutation assignment = PermutationParameter.ActualValue; 75 DoubleMatrix distances = Distance MatrixParameter.ActualValue;75 DoubleMatrix distances = DistancesParameter.ActualValue; 76 76 DoubleMatrix weights = WeightsParameter.ActualValue; 77 77 -
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPMoveEvaluator.cs
r5785 r5838 49 49 get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } 50 50 } 51 public ILookupParameter<DoubleMatrix> Distance MatrixParameter {52 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distance Matrix"]; }51 public ILookupParameter<DoubleMatrix> DistancesParameter { 52 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; } 53 53 } 54 54 public ILookupParameter<DoubleMatrix> WeightsParameter { … … 64 64 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The evaluated quality of a move on a QAP solution.")); 65 65 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); 66 Parameters.Add(new LookupParameter<DoubleMatrix>("Distance Matrix", "The matrix which contains the distances between the facilities."));66 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The matrix which contains the distances between the facilities.")); 67 67 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The matrix with the weights between the facilities, that is how strongly they're connected to each other.")); 68 68 } -
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPSwapMoveEvaluator.cs
r5785 r5838 29 29 30 30 namespace HeuristicLab.Problems.QuadraticAssignment { 31 [Item("QAPSwap MoveEvaluator", "Evaluated a swapmove on a QAP solution.")]31 [Item("QAPSwap2MoveEvaluator", "Evaluated a swap-2 move on a QAP solution.")] 32 32 [StorableClass] 33 public class QAPSwap MoveEvaluator : QAPMoveEvaluator, IPermutationSwapMoveOperator {34 public ILookupParameter<Swap Move> SwapMoveParameter {35 get { return (ILookupParameter<Swap Move>)Parameters["SwapMove"]; }33 public class QAPSwap2MoveEvaluator : QAPMoveEvaluator, IPermutationSwap2MoveOperator { 34 public ILookupParameter<Swap2Move> Swap2MoveParameter { 35 get { return (ILookupParameter<Swap2Move>)Parameters["Swap2Move"]; } 36 36 } 37 37 38 38 [StorableConstructor] 39 protected QAPSwap MoveEvaluator(bool deserializing) : base(deserializing) { }40 protected QAPSwap MoveEvaluator(QAPSwapMoveEvaluator original, Cloner cloner)39 protected QAPSwap2MoveEvaluator(bool deserializing) : base(deserializing) { } 40 protected QAPSwap2MoveEvaluator(QAPSwap2MoveEvaluator original, Cloner cloner) 41 41 : base(original, cloner) { 42 42 } 43 public QAPSwap MoveEvaluator() {44 Parameters.Add(new LookupParameter<Swap Move>("SwapMove", "The move to evaluate."));43 public QAPSwap2MoveEvaluator() { 44 Parameters.Add(new LookupParameter<Swap2Move>("Swap2Move", "The move to evaluate.")); 45 45 } 46 46 47 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new QAPSwap MoveEvaluator(this, cloner);48 return new QAPSwap2MoveEvaluator(this, cloner); 49 49 } 50 50 51 public static double Apply(Permutation assignment, Swap Move move, DoubleMatrix weights, DoubleMatrix distances) {51 public static double Apply(Permutation assignment, Swap2Move move, DoubleMatrix weights, DoubleMatrix distances) { 52 52 if (move.Index1 == move.Index2) return 0; 53 53 double moveQuality = 0; … … 70 70 71 71 public override IOperation Apply() { 72 Swap Move move = SwapMoveParameter.ActualValue;73 if (move == null) throw new InvalidOperationException("Swap move is not found.");72 Swap2Move move = Swap2MoveParameter.ActualValue; 73 if (move == null) throw new InvalidOperationException("Swap-2 move is not found."); 74 74 Permutation assignment = PermutationParameter.ActualValue; 75 DoubleMatrix distances = Distance MatrixParameter.ActualValue;75 DoubleMatrix distances = DistancesParameter.ActualValue; 76 76 DoubleMatrix weights = WeightsParameter.ActualValue; 77 77 -
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPTranslocationMoveEvaluator.cs
r5801 r5838 85 85 if (move == null) throw new InvalidOperationException("Translocation move is not found."); 86 86 Permutation assignment = PermutationParameter.ActualValue; 87 DoubleMatrix distances = Distance MatrixParameter.ActualValue;87 DoubleMatrix distances = DistancesParameter.ActualValue; 88 88 DoubleMatrix weights = WeightsParameter.ActualValue; 89 89
Note: See TracChangeset
for help on using the changeset viewer.