Changeset 7419 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators
- Timestamp:
- 01/27/12 13:24:36 (12 years ago)
- Location:
- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators/GQAPEvaluator.cs
r7412 r7419 33 33 [Item("GQAPEvaluator", "Evaluates solutions to the generalized quadratic assignment problem.")] 34 34 [StorableClass] 35 public class GQAPEvaluator : SingleSuccessorOperator, IGQAPEvaluator { 35 public class GQAPEvaluator : SingleSuccessorOperator, IGQAPEvaluator, 36 IWeightsAwareGQAPOperator, IDistancesAwareGQAPOperator, IInstallationCostsAwareGQAPOperator, 37 IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, IAssignmentAwareGQAPOperator { 36 38 39 #region Parameter Descriptions 40 public static readonly string QualityDescription = "The quality of the solution."; 41 public static readonly string FlowDistanceQualityDescription = "The quality regarding the flow-distance criteria."; 42 public static readonly string InstallationQualityDescription = "The quality regarding the installation costs."; 43 public static readonly string OverbookedCapacityDescription = "The sum of the overbooked capacities relative to the capacity of each location."; 44 #endregion 45 46 public ILookupParameter<BoolValue> MaximizationParameter { 47 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 48 } 37 49 public ILookupParameter<DoubleValue> QualityParameter { 38 50 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } … … 77 89 public GQAPEvaluator() 78 90 : base() { 79 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution.")); 80 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria.")); 81 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs.")); 82 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location.")); 83 Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights or distance matrix already.")); 84 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality.")); 85 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The weights matrix describes the flows between the equipments.")); 86 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed.")); 87 Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j")); 88 Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments.")); 89 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations.")); 90 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "The vector that encodes the assignment.")); 91 Parameters.Add(new LookupParameter<BoolValue>("Maximization", GeneralizedQuadraticAssignmentProblem.MaximizationDescription)); 92 Parameters.Add(new LookupParameter<DoubleValue>("Quality", QualityDescription)); 93 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", FlowDistanceQualityDescription)); 94 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", InstallationQualityDescription)); 95 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", OverbookedCapacityDescription)); 96 Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", GeneralizedQuadraticAssignmentProblem.TransportationCostsDescription)); 97 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", GeneralizedQuadraticAssignmentProblem.OverbookedCapacityPenaltyDescription)); 98 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", GeneralizedQuadraticAssignmentProblem.WeightsDescription)); 99 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", GeneralizedQuadraticAssignmentProblem.DistancesDescription)); 100 Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", GeneralizedQuadraticAssignmentProblem.InstallationCostsDescription)); 101 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 102 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 103 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 91 104 } 92 105 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators/GQAPNMoveEvaluator.cs
r7413 r7419 27 27 using HeuristicLab.Encodings.IntegerVectorEncoding; 28 28 using HeuristicLab.Operators; 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Parameters; 30 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 [Item("GQAPNMoveEvaluator", "Evaluates an n-move.")] 34 35 [StorableClass] 35 public class GQAPNMoveEvaluator : SingleSuccessorOperator, IGQAPNMoveEvaluator { 36 36 public class GQAPNMoveEvaluator : SingleSuccessorOperator, IGQAPNMoveEvaluator, IAssignmentAwareGQAPOperator, 37 IQualityAwareGQAPOperator, ITransportationCostsAwareGQAPOperator, 38 IOverbookedCapacityPenaltyAwareGQAPOperator, IWeightsAwareGQAPOperator, IDistancesAwareGQAPOperator, 39 IInstallationCostsAwareGQAPOperator, IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator { 40 41 #region Parameter Descriptions 42 public static readonly string MoveQualityDescription = "The quality of the move if it would be applied."; 43 public static readonly string MoveFlowDistanceQualityDescription = "The quality of the move regarding the flow-distance criteria."; 44 public static readonly string MoveInstallationQualityDescription = "The quality of the move regarding the installation costs."; 45 public static readonly string MoveOverbookedCapacityDescription = "The sum of the overbooked capacities of the move relative to the capacity of each location."; 46 #endregion 47 48 #region Parameter Properties 49 ILookupParameter<BoolValue> IQualityAwareGQAPOperator.MaximizationParameter { 50 get { return MaximizationParameter; } 51 } 52 ILookupParameter<BoolValue> IGQAPMoveEvaluator.MaximizationParameter { 53 get { return MaximizationParameter; } 54 } 55 public ILookupParameter<BoolValue> MaximizationParameter { 56 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 57 } 58 public ILookupParameter<DoubleValue> MoveQualityParameter { 59 get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; } 60 } 61 public ILookupParameter<DoubleValue> MoveFlowDistanceQualityParameter { 62 get { return (ILookupParameter<DoubleValue>)Parameters["MoveFlowDistanceQuality"]; } 63 } 64 public ILookupParameter<DoubleValue> MoveInstallationQualityParameter { 65 get { return (ILookupParameter<DoubleValue>)Parameters["MoveInstallationQuality"]; } 66 } 67 public ILookupParameter<DoubleValue> MoveOverbookedCapacityParameter { 68 get { return (ILookupParameter<DoubleValue>)Parameters["MoveOverbookedCapacity"]; } 69 } 70 public ILookupParameter<NMove> MoveParameter { 71 get { return (ILookupParameter<NMove>)Parameters["Move"]; } 72 } 37 73 public ILookupParameter<IntegerVector> AssignmentParameter { 38 74 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; } 39 75 } 40 public ILookupParameter<NMove> MoveParameter { 41 get { return (ILookupParameter<NMove>)Parameters["Move"]; } 76 ILookupParameter<DoubleValue> ISingleObjectiveMoveEvaluator.QualityParameter { 77 get { return QualityParameter; } 78 } 79 ILookupParameter<DoubleValue> IQualityAwareGQAPOperator.QualityParameter { 80 get { return QualityParameter; } 42 81 } 43 82 public ILookupParameter<DoubleValue> QualityParameter { … … 53 92 get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 54 93 } 55 public ILookupParameter<DoubleValue> MoveQualityParameter {56 get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }57 }58 public ILookupParameter<DoubleValue> MoveFlowDistanceQualityParameter {59 get { return (ILookupParameter<DoubleValue>)Parameters["MoveFlowDistanceQuality"]; }60 }61 public ILookupParameter<DoubleValue> MoveInstallationQualityParameter {62 get { return (ILookupParameter<DoubleValue>)Parameters["MoveInstallationQuality"]; }63 }64 public ILookupParameter<DoubleValue> MoveOverbookedCapacityParameter {65 get { return (ILookupParameter<DoubleValue>)Parameters["MoveOverbookedCapacity"]; }66 }67 94 public IValueLookupParameter<DoubleValue> TransportationCostsParameter { 68 95 get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; } … … 86 113 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 87 114 } 115 #endregion 88 116 89 117 [StorableConstructor] … … 92 120 public GQAPNMoveEvaluator() 93 121 : base() { 94 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "The equipment-location assignment vector.")); 95 Parameters.Add(new LookupParameter<NMove>("Move", "The move to perform.")); 96 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality.")); 97 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria.")); 98 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs.")); 99 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location.")); 100 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move if it would be applied.")); 101 Parameters.Add(new LookupParameter<DoubleValue>("MoveFlowDistanceQuality", "The quality of the move regarding the flow-distance criteria.")); 102 Parameters.Add(new LookupParameter<DoubleValue>("MoveInstallationQuality", "The quality of the move regarding the installation costs.")); 103 Parameters.Add(new LookupParameter<DoubleValue>("MoveOverbookedCapacity", "The sum of the overbooked capacities of the move relative to the capacity of each location.")); 104 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality.")); 105 Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights or distance matrix already.")); 106 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The weights matrix describes the flows between the equipments.")); 107 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed.")); 108 Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j")); 109 Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments.")); 110 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations.")); 122 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 123 Parameters.Add(new LookupParameter<NMove>("Move", GQAPNMoveGenerator.MoveDescription)); 124 Parameters.Add(new LookupParameter<BoolValue>("Maximization", GeneralizedQuadraticAssignmentProblem.MaximizationDescription)); 125 Parameters.Add(new LookupParameter<DoubleValue>("Quality", GQAPEvaluator.QualityDescription)); 126 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", GQAPEvaluator.FlowDistanceQualityDescription)); 127 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", GQAPEvaluator.InstallationQualityDescription)); 128 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", GQAPEvaluator.OverbookedCapacityDescription)); 129 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", MoveQualityDescription)); 130 Parameters.Add(new LookupParameter<DoubleValue>("MoveFlowDistanceQuality", MoveFlowDistanceQualityDescription)); 131 Parameters.Add(new LookupParameter<DoubleValue>("MoveInstallationQuality", MoveInstallationQualityDescription)); 132 Parameters.Add(new LookupParameter<DoubleValue>("MoveOverbookedCapacity", MoveOverbookedCapacityDescription)); 133 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", GeneralizedQuadraticAssignmentProblem.OverbookedCapacityPenaltyDescription)); 134 Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", GeneralizedQuadraticAssignmentProblem.TransportationCostsDescription)); 135 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", GeneralizedQuadraticAssignmentProblem.WeightsDescription)); 136 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", GeneralizedQuadraticAssignmentProblem.DistancesDescription)); 137 Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", GeneralizedQuadraticAssignmentProblem.InstallationCostsDescription)); 138 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 139 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 111 140 } 112 141
Note: See TracChangeset
for help on using the changeset viewer.