Changeset 7419
- Timestamp:
- 01/27/12 13:24:36 (13 years ago)
- Location:
- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3
- Files:
-
- 17 added
- 5 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/BestGQAPSolutionAnalyzer.cs
r7418 r7419 37 37 [Item("Best GeneralizedQAP Solution Analyzer", "An operator for analyzing the best solution of Generalized Quadratic Assignment Problems.")] 38 38 [StorableClass] 39 public sealed class BestGQAPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer { 39 public sealed class BestGQAPSolutionAnalyzer : SingleSuccessorOperator, IAssignmentsAwareGQAPOperator, 40 IQualitiesAwareGQAPOperator, IDistancesAwareGQAPOperator, IWeightsAwareGQAPOperator, IInstallationCostsAwareGQAPOperator, 41 IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, ITransportationCostsAwareGQAPOperator, 42 IOverbookedCapacityPenaltyAwareGQAPOperator, IEquipmentNamesAwareGQAPOperator, ILocationNamesAwareGQAPOperator, 43 IBestKnownQualityAwareGQAPOperator, IBestKnownSolutionAwareGQAPOperator, IAnalyzer { 40 44 41 45 public bool EnabledByDefault { … … 43 47 } 44 48 45 public LookupParameter<BoolValue> MaximizationParameter {46 get { return ( LookupParameter<BoolValue>)Parameters["Maximization"]; }49 public IScopeTreeLookupParameter<IntegerVector> AssignmentParameter { 50 get { return (IScopeTreeLookupParameter<IntegerVector>)Parameters["Assignment"]; } 47 51 } 48 public LookupParameter<DoubleMatrix> DistancesParameter {49 get { return ( LookupParameter<DoubleMatrix>)Parameters["Distances"]; }52 public ILookupParameter<BoolValue> MaximizationParameter { 53 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 50 54 } 51 public LookupParameter<DoubleMatrix> WeightsParameter {52 get { return ( LookupParameter<DoubleMatrix>)Parameters["Weights"]; }55 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 56 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 53 57 } 54 public LookupParameter<DoubleMatrix> InstallationCostsParameter {55 get { return ( LookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }58 public IScopeTreeLookupParameter<DoubleValue> FlowDistanceQualityParameter { 59 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; } 56 60 } 57 public LookupParameter<DoubleArray> DemandsParameter {58 get { return ( LookupParameter<DoubleArray>)Parameters["Demands"]; }61 public IScopeTreeLookupParameter<DoubleValue> InstallationQualityParameter { 62 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["InstallationQuality"]; } 59 63 } 60 public LookupParameter<DoubleArray> CapacitiesParameter {61 get { return ( LookupParameter<DoubleArray>)Parameters["Capacities"]; }64 public IScopeTreeLookupParameter<DoubleValue> OverbookedCapacityParameter { 65 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 62 66 } 63 public LookupParameter<DoubleValue> TransportationCostsParameter {64 get { return ( LookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }67 public ILookupParameter<DoubleMatrix> DistancesParameter { 68 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; } 65 69 } 66 public LookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter {67 get { return ( LookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }70 public ILookupParameter<DoubleMatrix> WeightsParameter { 71 get { return (ILookupParameter<DoubleMatrix>)Parameters["Weights"]; } 68 72 } 69 public ScopeTreeLookupParameter<IntegerVector> AssignmentParameter {70 get { return ( ScopeTreeLookupParameter<IntegerVector>)Parameters["Assignment"]; }73 public ILookupParameter<DoubleMatrix> InstallationCostsParameter { 74 get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; } 71 75 } 72 public ScopeTreeLookupParameter<DoubleValue> QualityParameter {73 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }76 public ILookupParameter<DoubleArray> DemandsParameter { 77 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; } 74 78 } 75 public ScopeTreeLookupParameter<DoubleValue> FlowDistanceQualityParameter {76 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; }79 public ILookupParameter<DoubleArray> CapacitiesParameter { 80 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 77 81 } 78 public ScopeTreeLookupParameter<DoubleValue> InstallationQualityParameter {79 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters["InstallationQuality"]; }82 public IValueLookupParameter<DoubleValue> TransportationCostsParameter { 83 get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; } 80 84 } 81 public ScopeTreeLookupParameter<DoubleValue> OverbookedCapacityParameter { 82 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 83 } 84 public LookupParameter<GQAPAssignment> BestSolutionParameter { 85 get { return (LookupParameter<GQAPAssignment>)Parameters["BestSolution"]; } 86 } 87 public ValueLookupParameter<ResultCollection> ResultsParameter { 88 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } 89 } 90 public LookupParameter<DoubleValue> BestKnownQualityParameter { 91 get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 92 } 93 public LookupParameter<IntegerVector> BestKnownSolutionParameter { 94 get { return (LookupParameter<IntegerVector>)Parameters["BestKnownSolution"]; } 85 public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter { 86 get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; } 95 87 } 96 88 public ILookupParameter<StringArray> EquipmentNamesParameter { … … 99 91 public ILookupParameter<StringArray> LocationNamesParameter { 100 92 get { return (ILookupParameter<StringArray>)Parameters["LocationNames"]; } 93 } 94 public ILookupParameter<DoubleValue> BestKnownQualityParameter { 95 get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 96 } 97 public ILookupParameter<IntegerVector> BestKnownSolutionParameter { 98 get { return (ILookupParameter<IntegerVector>)Parameters["BestKnownSolution"]; } 99 } 100 public ILookupParameter<GQAPAssignment> BestSolutionParameter { 101 get { return (ILookupParameter<GQAPAssignment>)Parameters["BestSolution"]; } 102 } 103 public IValueLookupParameter<ResultCollection> ResultsParameter { 104 get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; } 101 105 } 102 106 … … 115 119 Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands of the equipments.")); 116 120 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities at the locations.")); 117 Parameters.Add(new LookupParameter<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 matrix already."));118 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality."));121 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 matrix already.")); 122 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality.")); 119 123 Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("Assignment", "The GQAP solutions from which the best solution should be analyzed.")); 120 124 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the GQAP solutions which should be analyzed.")); -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/GQAPSolutionArchiveAnalyzer.cs
r7418 r7419 35 35 [Item("GeneralizedQAP Solution Archive Analyzer", "An operator for analyzing the archive of found solutions for the GQAP.")] 36 36 [StorableClass] 37 public sealed class GQAPSolutionArchiveAnalyzer : SingleSuccessorOperator, IAnalyzer { 37 public sealed class GQAPSolutionArchiveAnalyzer : SingleSuccessorOperator, IAssignmentsAwareGQAPOperator, 38 IQualitiesAwareGQAPOperator, IDistancesAwareGQAPOperator, IWeightsAwareGQAPOperator, IInstallationCostsAwareGQAPOperator, 39 IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, ITransportationCostsAwareGQAPOperator, 40 IOverbookedCapacityPenaltyAwareGQAPOperator, IEquipmentNamesAwareGQAPOperator, ILocationNamesAwareGQAPOperator, 41 IBestKnownQualityAwareGQAPOperator, IBestKnownSolutionAwareGQAPOperator, IAnalyzer { 38 42 39 43 public bool EnabledByDefault { 40 get { return true; }44 get { return false; } 41 45 } 42 46 43 public LookupParameter<BoolValue> MaximizationParameter {44 get { return ( LookupParameter<BoolValue>)Parameters["Maximization"]; }47 public IScopeTreeLookupParameter<IntegerVector> AssignmentParameter { 48 get { return (IScopeTreeLookupParameter<IntegerVector>)Parameters["Assignment"]; } 45 49 } 46 public LookupParameter<DoubleMatrix> DistancesParameter {47 get { return ( LookupParameter<DoubleMatrix>)Parameters["Distances"]; }50 public ILookupParameter<BoolValue> MaximizationParameter { 51 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 48 52 } 49 public LookupParameter<DoubleMatrix> WeightsParameter {50 get { return ( LookupParameter<DoubleMatrix>)Parameters["Weights"]; }53 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 54 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 51 55 } 52 public LookupParameter<DoubleMatrix> InstallationCostsParameter {53 get { return ( LookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }56 public IScopeTreeLookupParameter<DoubleValue> FlowDistanceQualityParameter { 57 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; } 54 58 } 55 public LookupParameter<DoubleArray> DemandsParameter {56 get { return ( LookupParameter<DoubleArray>)Parameters["Demands"]; }59 public IScopeTreeLookupParameter<DoubleValue> InstallationQualityParameter { 60 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["InstallationQuality"]; } 57 61 } 58 public LookupParameter<DoubleArray> CapacitiesParameter {59 get { return ( LookupParameter<DoubleArray>)Parameters["Capacities"]; }62 public IScopeTreeLookupParameter<DoubleValue> OverbookedCapacityParameter { 63 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 60 64 } 61 public LookupParameter<DoubleValue> TransportationCostsParameter {62 get { return ( LookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }65 public ILookupParameter<DoubleMatrix> DistancesParameter { 66 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; } 63 67 } 64 public LookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter {65 get { return ( LookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }68 public ILookupParameter<DoubleMatrix> WeightsParameter { 69 get { return (ILookupParameter<DoubleMatrix>)Parameters["Weights"]; } 66 70 } 67 public ScopeTreeLookupParameter<IntegerVector> AssignmentParameter {68 get { return ( ScopeTreeLookupParameter<IntegerVector>)Parameters["Assignment"]; }71 public ILookupParameter<DoubleMatrix> InstallationCostsParameter { 72 get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; } 69 73 } 70 public ScopeTreeLookupParameter<DoubleValue> QualityParameter {71 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }74 public ILookupParameter<DoubleArray> DemandsParameter { 75 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; } 72 76 } 73 public ScopeTreeLookupParameter<DoubleValue> FlowDistanceQualityParameter {74 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; }77 public ILookupParameter<DoubleArray> CapacitiesParameter { 78 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 75 79 } 76 public ScopeTreeLookupParameter<DoubleValue> InstallationQualityParameter {77 get { return ( ScopeTreeLookupParameter<DoubleValue>)Parameters["InstallationQuality"]; }80 public IValueLookupParameter<DoubleValue> TransportationCostsParameter { 81 get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; } 78 82 } 79 public ScopeTreeLookupParameter<DoubleValue> OverbookedCapacityParameter { 80 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 81 } 82 public LookupParameter<GQAPAssignment> BestSolutionParameter { 83 get { return (LookupParameter<GQAPAssignment>)Parameters["BestSolution"]; } 84 } 85 public ValueLookupParameter<ResultCollection> ResultsParameter { 86 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } 87 } 88 public LookupParameter<DoubleValue> BestKnownQualityParameter { 89 get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 90 } 91 public LookupParameter<IntegerVector> BestKnownSolutionParameter { 92 get { return (LookupParameter<IntegerVector>)Parameters["BestKnownSolution"]; } 83 public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter { 84 get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; } 93 85 } 94 86 public ILookupParameter<StringArray> EquipmentNamesParameter { … … 97 89 public ILookupParameter<StringArray> LocationNamesParameter { 98 90 get { return (ILookupParameter<StringArray>)Parameters["LocationNames"]; } 91 } 92 public ILookupParameter<DoubleValue> BestKnownQualityParameter { 93 get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 94 } 95 public ILookupParameter<IntegerVector> BestKnownSolutionParameter { 96 get { return (ILookupParameter<IntegerVector>)Parameters["BestKnownSolution"]; } 97 } 98 public ILookupParameter<GQAPAssignment> BestSolutionParameter { 99 get { return (ILookupParameter<GQAPAssignment>)Parameters["BestSolution"]; } 100 } 101 public IValueLookupParameter<ResultCollection> ResultsParameter { 102 get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; } 99 103 } 100 104 … … 113 117 Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands of the equipments.")); 114 118 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities at the locations.")); 115 Parameters.Add(new LookupParameter<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 matrix already."));116 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality."));119 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 matrix already.")); 120 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality.")); 117 121 Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("Assignment", "The GQAP solutions from which the best solution should be analyzed.")); 118 122 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the GQAP solutions which should be analyzed.")); -
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 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs
r7418 r7419 37 37 [StorableClass] 38 38 public sealed class GeneralizedQuadraticAssignmentProblem : SingleObjectiveHeuristicOptimizationProblem<IGQAPEvaluator, IGQAPSolutionCreator>, IStorableContent { 39 39 40 public override Image ItemImage { 40 41 get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; } … … 42 43 43 44 public string Filename { get; set; } 45 46 #region Parameter Descriptions 47 public static readonly string MaximizationDescription = "False if the fitness function should be minimized (default) or otherwise True if it should be maximized."; 48 public static readonly string WeightsDescription = "The weights matrix describes the flows between the equipments."; 49 public static readonly string DistancesDescription = "The distances matrix describes the distances between the locations at which the equipment can be installed."; 50 public static readonly string InstallationCostsDescription = "The installation costs matrix describes the installation costs of installing equipment i at location j"; 51 public static readonly string DemandsDescription = "The demands vector describes the space requirements of the equipments."; 52 public static readonly string CapacitiesDescription = "The capacities vector describes the available space at the locations."; 53 public static readonly string TransportationCostsDescription = "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 matrix already."; 54 public static readonly string OverbookedCapacityPenaltyDescription = "The multiplier for the constraint violation when added to the quality."; 55 public static readonly string BestKnownSolutionDescription = "The best known solution (if available)"; 56 public static readonly string EquipmentNamesDescription = "Optional: A list of names that describes the equipments."; 57 public static readonly string LocationNamesDescription = "Optional: A list of names that describes the locations."; 58 #endregion 44 59 45 60 #region Parameter Properties … … 130 145 public GeneralizedQuadraticAssignmentProblem() 131 146 : base(new GQAPEvaluator(), new RandomSolutionCreator()) { 132 Parameters.Add(new ValueParameter<DoubleMatrix>("Weights", "The weights matrix describes the flows between the equipments.", new DoubleMatrix()));133 Parameters.Add(new ValueParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed.", new DoubleMatrix()));134 Parameters.Add(new ValueParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j", new DoubleMatrix()));135 Parameters.Add(new FixedValueParameter<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 matrix already.", new DoubleValue(1)));136 Parameters.Add(new FixedValueParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality.", new DoubleValue(1000)));137 Parameters.Add(new ValueParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments.", new DoubleArray()));138 Parameters.Add(new ValueParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations.", new DoubleArray()));139 Parameters.Add(new OptionalValueParameter<IItem>("BestKnownSolution", "The best known solution (if available)", null));140 Parameters.Add(new OptionalValueParameter<StringArray>("EquipmentNames", "Optional: A list of names that describes the equipments.", null, false));141 Parameters.Add(new OptionalValueParameter<StringArray>("LocationNames", "Optional: A list of names that describes the locations.", null, false));147 Parameters.Add(new ValueParameter<DoubleMatrix>("Weights", WeightsDescription, new DoubleMatrix())); 148 Parameters.Add(new ValueParameter<DoubleMatrix>("Distances", DistancesDescription, new DoubleMatrix())); 149 Parameters.Add(new ValueParameter<DoubleMatrix>("InstallationCosts", InstallationCostsDescription, new DoubleMatrix())); 150 Parameters.Add(new FixedValueParameter<DoubleValue>("TransportationCosts", TransportationCostsDescription, new DoubleValue(1))); 151 Parameters.Add(new FixedValueParameter<DoubleValue>("OverbookedCapacityPenalty", OverbookedCapacityPenaltyDescription, new DoubleValue(1000))); 152 Parameters.Add(new ValueParameter<DoubleArray>("Demands", DemandsDescription, new DoubleArray())); 153 Parameters.Add(new ValueParameter<DoubleArray>("Capacities", CapacitiesDescription, new DoubleArray())); 154 Parameters.Add(new OptionalValueParameter<IItem>("BestKnownSolution", BestKnownSolutionDescription, null)); 155 Parameters.Add(new OptionalValueParameter<StringArray>("EquipmentNames", EquipmentNamesDescription, null, false)); 156 Parameters.Add(new OptionalValueParameter<StringArray>("LocationNames", LocationNamesDescription, null, false)); 142 157 143 158 WeightsParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false; … … 223 238 224 239 private void Parameterize() { 225 Evaluator.WeightsParameter.ActualName = WeightsParameter.Name; 226 Evaluator.DistancesParameter.ActualName = DistancesParameter.Name; 227 Evaluator.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name; 228 Evaluator.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name; 229 Evaluator.DemandsParameter.ActualName = DemandsParameter.Name; 230 Evaluator.CapacitiesParameter.ActualName = CapacitiesParameter.Name; 231 Evaluator.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 232 233 SolutionCreator.DemandsParameter.ActualName = DemandsParameter.Name; 234 SolutionCreator.CapacitiesParameter.ActualName = CapacitiesParameter.Name; 235 236 foreach (var op in Operators.OfType<IEquipmentAwareGQAPOperator>()) { 240 241 var operators = Operators.Union(new IOperator[] { SolutionCreator, Evaluator }).ToArray(); 242 243 foreach (var op in operators.OfType<IAssignmentAwareGQAPOperator>()) { 244 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 245 } 246 foreach (var op in operators.OfType<IAssignmentsAwareGQAPOperator>()) { 247 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 248 } 249 foreach (var op in operators.OfType<IBestKnownQualityAwareGQAPOperator>()) { 250 op.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name; 251 } 252 foreach (var op in operators.OfType<IBestKnownSolutionAwareGQAPOperator>()) { 253 op.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name; 254 } 255 foreach (var op in operators.OfType<ICapacitiesAwareGQAPOperator>()) { 256 op.CapacitiesParameter.ActualName = CapacitiesParameter.Name; 257 } 258 foreach (var op in operators.OfType<IDemandsAwareGQAPOperator>()) { 237 259 op.DemandsParameter.ActualName = DemandsParameter.Name; 238 260 } 239 foreach (var op in Operators.OfType<IGQAPCrossover>()) { 261 foreach (var op in operators.OfType<IDistancesAwareGQAPOperator>()) { 262 op.DistancesParameter.ActualName = DistancesParameter.Name; 263 } 264 foreach (var op in operators.OfType<IEquipmentNamesAwareGQAPOperator>()) { 265 op.EquipmentNamesParameter.ActualName = EquipmentNamesParameter.Name; 266 } 267 foreach (var op in operators.OfType<IGQAPCrossover>()) { 240 268 op.ParentsParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 241 269 op.ChildParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 242 270 } 243 foreach (var op in Operators.OfType<IGQAPEvaluationOperator>()) { 244 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 245 op.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name; 271 foreach (var op in operators.OfType<IInstallationCostsAwareGQAPOperator>()) { 272 op.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name; 273 } 274 foreach (var op in operators.OfType<ILocationNamesAwareGQAPOperator>()) { 275 op.LocationNamesParameter.ActualName = LocationNamesParameter.Name; 276 } 277 var moveEvaluator = operators.OfType<IGQAPMoveEvaluator>().FirstOrDefault(); 278 foreach (var op in operators.OfType<IGQAPMoveEvaluator>()) { // synchronize all move evaluators 279 if (moveEvaluator != null) { 280 op.MoveQualityParameter.ActualName = moveEvaluator.MoveQualityParameter.ActualName; 281 op.MoveFlowDistanceQualityParameter.ActualName = moveEvaluator.MoveFlowDistanceQualityParameter.ActualName; 282 op.MoveInstallationQualityParameter.ActualName = moveEvaluator.MoveInstallationQualityParameter.ActualName; 283 op.MoveOverbookedCapacityParameter.ActualName = moveEvaluator.MoveOverbookedCapacityParameter.ActualName; 284 } 285 } 286 foreach (var op in operators.OfType<IMoveQualityAwareGQAPOperator>()) { 287 if (moveEvaluator != null) { 288 op.MoveQualityParameter.ActualName = moveEvaluator.MoveQualityParameter.ActualName; 289 op.MoveFlowDistanceQualityParameter.ActualName = moveEvaluator.MoveFlowDistanceQualityParameter.ActualName; 290 op.MoveInstallationQualityParameter.ActualName = moveEvaluator.MoveInstallationQualityParameter.ActualName; 291 op.MoveOverbookedCapacityParameter.ActualName = moveEvaluator.MoveOverbookedCapacityParameter.ActualName; 292 } 293 op.MaximizationParameter.ActualName = MaximizationParameter.Name; 294 } 295 foreach (var op in operators.OfType<IOverbookedCapacityPenaltyAwareGQAPOperator>()) { 246 296 op.OverbookedCapacityPenaltyParameter.ActualName = OverbookedCapacityPenaltyParameter.Name; 247 op.WeightsParameter.ActualName = WeightsParameter.Name; 248 op.DistancesParameter.ActualName = DistancesParameter.Name; 249 op.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name; 250 op.DemandsParameter.ActualName = DemandsParameter.Name; 251 op.CapacitiesParameter.ActualName = CapacitiesParameter.Name; 252 } 253 foreach (var op in Operators.OfType<IGQAPLocalImprovementOperator>()) { 254 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 297 } 298 foreach (var op in operators.OfType<IQualitiesAwareGQAPOperator>()) { 255 299 op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 256 300 op.FlowDistanceQualityParameter.ActualName = Evaluator.FlowDistanceQualityParameter.ActualName; 257 301 op.InstallationQualityParameter.ActualName = Evaluator.InstallationQualityParameter.ActualName; 258 302 op.OverbookedCapacityParameter.ActualName = Evaluator.OverbookedCapacityParameter.ActualName; 303 op.MaximizationParameter.ActualName = MaximizationParameter.Name; 304 } 305 foreach (var op in operators.OfType<IQualityAwareGQAPOperator>()) { 306 op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 307 op.FlowDistanceQualityParameter.ActualName = Evaluator.FlowDistanceQualityParameter.ActualName; 308 op.InstallationQualityParameter.ActualName = Evaluator.InstallationQualityParameter.ActualName; 309 op.OverbookedCapacityParameter.ActualName = Evaluator.OverbookedCapacityParameter.ActualName; 310 op.MaximizationParameter.ActualName = MaximizationParameter.Name; 311 } 312 foreach (var op in operators.OfType<ITransportationCostsAwareGQAPOperator>()) { 259 313 op.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name; 260 op.OverbookedCapacityPenaltyParameter.ActualName = OverbookedCapacityPenaltyParameter.Name; 314 } 315 foreach (var op in operators.OfType<IWeightsAwareGQAPOperator>()) { 261 316 op.WeightsParameter.ActualName = WeightsParameter.Name; 262 op.DistancesParameter.ActualName = DistancesParameter.Name; 263 op.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name; 264 op.DemandsParameter.ActualName = DemandsParameter.Name; 265 op.CapacitiesParameter.ActualName = CapacitiesParameter.Name; 266 } 267 foreach (var op in Operators.OfType<IGQAPManipulator>()) { 268 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 269 } 270 foreach (var op in Operators.OfType<IGQAPMerger>()) { 271 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 272 op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 273 op.MaximizationParameter.ActualName = MaximizationParameter.Name; 274 } 275 foreach (var op in Operators.OfType<IGQAPMoveOperator>()) { 276 op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 277 } 278 foreach (var op in Operators.OfType<ILocationAwareGQAPOperator>()) { 279 op.CapacitiesParameter.ActualName = CapacitiesParameter.Name; 280 } 281 282 foreach (var op in Operators.OfType<IIntegerVectorCrossover>()) { 317 } 318 319 foreach (var op in operators.OfType<IIntegerVectorCrossover>()) { 283 320 op.ParentsParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 284 321 op.ChildParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 285 322 } 286 foreach (var op in Operators.OfType<IIntegerVectorManipulator>()) {323 foreach (var op in operators.OfType<IIntegerVectorManipulator>()) { 287 324 op.IntegerVectorParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName; 288 }289 290 if (BestSolutionAnalyzer != null) {291 BestSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;292 BestSolutionAnalyzer.DistancesParameter.ActualName = DistancesParameter.Name;293 BestSolutionAnalyzer.WeightsParameter.ActualName = WeightsParameter.Name;294 BestSolutionAnalyzer.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name;295 BestSolutionAnalyzer.DemandsParameter.ActualName = DemandsParameter.Name;296 BestSolutionAnalyzer.CapacitiesParameter.ActualName = CapacitiesParameter.Name;297 BestSolutionAnalyzer.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name;298 BestSolutionAnalyzer.OverbookedCapacityPenaltyParameter.ActualName = OverbookedCapacityPenaltyParameter.Name;299 BestSolutionAnalyzer.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;300 BestSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;301 BestSolutionAnalyzer.FlowDistanceQualityParameter.ActualName = Evaluator.FlowDistanceQualityParameter.ActualName;302 BestSolutionAnalyzer.InstallationQualityParameter.ActualName = Evaluator.InstallationQualityParameter.ActualName;303 BestSolutionAnalyzer.OverbookedCapacityParameter.ActualName = Evaluator.OverbookedCapacityParameter.ActualName;304 BestSolutionAnalyzer.ResultsParameter.ActualName = "Results";305 BestSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;306 BestSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;307 BestSolutionAnalyzer.EquipmentNamesParameter.ActualName = EquipmentNamesParameter.Name;308 BestSolutionAnalyzer.LocationNamesParameter.ActualName = LocationNamesParameter.Name;309 }310 if (SolutionArchiveAnalyzer != null) {311 SolutionArchiveAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;312 SolutionArchiveAnalyzer.DistancesParameter.ActualName = DistancesParameter.Name;313 SolutionArchiveAnalyzer.WeightsParameter.ActualName = WeightsParameter.Name;314 SolutionArchiveAnalyzer.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name;315 SolutionArchiveAnalyzer.DemandsParameter.ActualName = DemandsParameter.Name;316 SolutionArchiveAnalyzer.CapacitiesParameter.ActualName = CapacitiesParameter.Name;317 SolutionArchiveAnalyzer.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name;318 SolutionArchiveAnalyzer.OverbookedCapacityPenaltyParameter.ActualName = OverbookedCapacityPenaltyParameter.Name;319 SolutionArchiveAnalyzer.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;320 SolutionArchiveAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;321 SolutionArchiveAnalyzer.FlowDistanceQualityParameter.ActualName = Evaluator.FlowDistanceQualityParameter.ActualName;322 SolutionArchiveAnalyzer.InstallationQualityParameter.ActualName = Evaluator.InstallationQualityParameter.ActualName;323 SolutionArchiveAnalyzer.OverbookedCapacityParameter.ActualName = Evaluator.OverbookedCapacityParameter.ActualName;324 SolutionArchiveAnalyzer.ResultsParameter.ActualName = "Results";325 SolutionArchiveAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;326 SolutionArchiveAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;327 SolutionArchiveAnalyzer.EquipmentNamesParameter.ActualName = EquipmentNamesParameter.Name;328 SolutionArchiveAnalyzer.LocationNamesParameter.ActualName = LocationNamesParameter.Name;329 325 } 330 326 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj
r7418 r7419 99 99 <Compile Include="GQAPIntegerVectorProximityCalculator.cs" /> 100 100 <Compile Include="GQAPSolution.cs" /> 101 <Compile Include="Interfaces\IGQAPMerger.cs" /> 101 <Compile Include="Interfaces\IQualitiesAwareGQAPOperator.cs" /> 102 <Compile Include="Interfaces\IAssignmentsAwareGQAPOperator.cs" /> 103 <Compile Include="Interfaces\IBestKnownQualityAwareGQAPOperator.cs" /> 104 <Compile Include="Interfaces\IBestKnownSolutionAwareGQAPOperator.cs" /> 105 <Compile Include="Interfaces\ILocationNamesAwareGQAPOperator.cs" /> 106 <Compile Include="Interfaces\IEquipmentNamesAwareGQAPOperator.cs" /> 107 <Compile Include="Interfaces\IMoveQualityAwareGQAPOperator.cs" /> 108 <Compile Include="Interfaces\IGQAPEvaluator.cs" /> 109 <Compile Include="Interfaces\IQualityAwareGQAPOperator.cs" /> 110 <Compile Include="Interfaces\IOverbookedCapacityPenaltyAwareGQAPOperator.cs" /> 111 <Compile Include="Interfaces\ITransportationCostsAwareGQAPOperator.cs" /> 112 <Compile Include="Interfaces\IInstallationCostsAwareGQAPOperator.cs" /> 113 <Compile Include="Interfaces\IDistancesAwareGQAPOperator.cs" /> 114 <Compile Include="Interfaces\IWeightsAwareGQAPOperator.cs" /> 115 <Compile Include="Interfaces\IAssignmentAwareGQAPOperator.cs" /> 102 116 <Compile Include="Interfaces\IGQAPNMoveEvaluator.cs" /> 103 <Compile Include="Interfaces\I EquipmentAwareGQAPOperator.cs" />117 <Compile Include="Interfaces\IDemandsAwareGQAPOperator.cs" /> 104 118 <Compile Include="Interfaces\IGQAPCrossover.cs" /> 105 <Compile Include="Interfaces\IGQAPEvaluationOperator.cs" />106 <Compile Include="Interfaces\IGQAPEvaluator.cs" />107 119 <Compile Include="Interfaces\IGQAPLocalImprovementOperator.cs" /> 108 <Compile Include="Interfaces\IGQAPManipulator.cs" />109 120 <Compile Include="Interfaces\IGQAPMoveEvaluator.cs" /> 110 121 <Compile Include="Interfaces\IGQAPMoveOperator.cs" /> … … 112 123 <Compile Include="Interfaces\IGQAPOperator.cs" /> 113 124 <Compile Include="Interfaces\IGQAPSolutionCreator.cs" /> 114 <Compile Include="Interfaces\I LocationAwareGQAPOperator.cs" />125 <Compile Include="Interfaces\ICapacitiesAwareGQAPOperator.cs" /> 115 126 <Compile Include="Moves\NMove.cs" /> 116 127 <Compile Include="Moves\GQAPMoveGenerator.cs" /> … … 120 131 <Compile Include="Moves\StochasticNMoveSingleMoveGenerator.cs" /> 121 132 <Compile Include="Operators\ApproximateLocalSearch.cs" /> 133 <Compile Include="Operators\GQAPPathRelinking.cs" /> 122 134 <Compile Include="Operators\GQAPStochasticSolutionCreator.cs" /> 123 135 <Compile Include="Operators\DemandEquivalentSwapEquipmentManipluator.cs" /> -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPEvaluator.cs
r7412 r7419 25 25 26 26 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment { 27 public interface IGQAPEvaluator : IGQAPEvaluationOperator, ISingleObjectiveEvaluator { 27 public interface IGQAPEvaluator : ISingleObjectiveEvaluator { 28 ILookupParameter<BoolValue> MaximizationParameter { get; } 28 29 ILookupParameter<DoubleValue> FlowDistanceQualityParameter { get; } 29 30 ILookupParameter<DoubleValue> InstallationQualityParameter { get; } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPLocalImprovementOperator.cs
r7412 r7419 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Data; 24 using HeuristicLab.Encodings.IntegerVectorEncoding;25 24 using HeuristicLab.Optimization; 26 25 27 26 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment { 28 public interface IGQAPLocalImprovementOperator : IGQAPOperator, ILocalImprovementOperator { 29 ILookupParameter<DoubleValue> QualityParameter { get; } 30 ILookupParameter<DoubleValue> FlowDistanceQualityParameter { get; } 31 ILookupParameter<DoubleValue> InstallationQualityParameter { get; } 32 ILookupParameter<DoubleValue> OverbookedCapacityParameter { get; } 27 public interface IGQAPLocalImprovementOperator : ILocalImprovementOperator { 33 28 IValueLookupParameter<IntValue> MaximumCandidateListSizeParameter { get; } 34 IValueLookupParameter<IntValue> MaximumSampleSizeParameter { get; }35 ILookupParameter<IntegerVector> AssignmentParameter { get; }36 ILookupParameter<DoubleMatrix> WeightsParameter { get; }37 ILookupParameter<DoubleMatrix> DistancesParameter { get; }38 ILookupParameter<DoubleMatrix> InstallationCostsParameter { get; }39 ILookupParameter<DoubleArray> DemandsParameter { get; }40 ILookupParameter<DoubleArray> CapacitiesParameter { get; }41 IValueLookupParameter<DoubleValue> TransportationCostsParameter { get; }42 IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter { get; }43 29 } 44 30 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPMoveEvaluator.cs
r7412 r7419 25 25 26 26 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment { 27 public interface IGQAPMoveEvaluator : IGQAPEvaluationOperator, ISingleObjectiveMoveEvaluator { 28 ILookupParameter<DoubleValue> FlowDistanceQualityParameter { get; } 29 ILookupParameter<DoubleValue> InstallationQualityParameter { get; } 30 ILookupParameter<DoubleValue> OverbookedCapacityParameter { get; } 27 public interface IGQAPMoveEvaluator : IGQAPMoveOperator, ISingleObjectiveMoveEvaluator { 28 ILookupParameter<BoolValue> MaximizationParameter { get; } 29 ILookupParameter<DoubleValue> MoveFlowDistanceQualityParameter { get; } 30 ILookupParameter<DoubleValue> MoveInstallationQualityParameter { get; } 31 ILookupParameter<DoubleValue> MoveOverbookedCapacityParameter { get; } 31 32 } 32 33 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPMoveOperator.cs
r7407 r7419 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 using HeuristicLab.Encodings.IntegerVectorEncoding;24 22 using HeuristicLab.Optimization; 25 23 26 24 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment { 27 public interface IGQAPMoveOperator : IGQAPOperator, IMoveOperator { 28 ILookupParameter<IntegerVector> AssignmentParameter { get; } 29 } 25 public interface IGQAPMoveOperator : IMoveOperator { } 30 26 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPSolutionCreator.cs
r7373 r7419 25 25 26 26 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment { 27 public interface IGQAPSolutionCreator : I GQAPOperator, ISolutionCreator, ILocationAwareGQAPOperator, IEquipmentAwareGQAPOperator {27 public interface IGQAPSolutionCreator : ISolutionCreator { 28 28 ILookupParameter<IntegerVector> AssignmentParameter { get; } 29 29 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/GQAPMoveGenerator.cs
r7413 r7419 31 31 [Item("GQAPMoveGenerator", "Base class for move generators for the Generalized Quadratic Assignment Problem.")] 32 32 [StorableClass] 33 public abstract class GQAPMoveGenerator : SingleSuccessorOperator, I MoveGenerator, IGQAPMoveOperator {33 public abstract class GQAPMoveGenerator : SingleSuccessorOperator, IAssignmentAwareGQAPOperator, IMoveGenerator, IGQAPMoveOperator { 34 34 35 35 public ILookupParameter<IntegerVector> AssignmentParameter { … … 42 42 public GQAPMoveGenerator() 43 43 : base() { 44 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "The current equipment-location assignment."));44 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 45 45 } 46 46 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/GQAPNMoveGenerator.cs
r7413 r7419 34 34 public abstract class GQAPNMoveGenerator : GQAPMoveGenerator, IGQAPNMoveOperator { 35 35 36 #region Parameter Descriptions 37 public static readonly string MoveDescription = "Moves represent changes to the current solution. The n-move changes the assignment of up to or exactly n equipments."; 38 #endregion 39 36 40 public ILookupParameter<NMove> MoveParameter { 37 41 get { return (ILookupParameter<NMove>)Parameters["Move"]; } … … 46 50 public GQAPNMoveGenerator() 47 51 : base() { 48 Parameters.Add(new LookupParameter<NMove>("Move", "The move to generate."));52 Parameters.Add(new LookupParameter<NMove>("Move", MoveDescription)); 49 53 Parameters.Add(new ValueLookupParameter<IntValue>("N", "The maximum number of equipment(s) that should be moved.", new IntValue(2))); 50 54 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/NMoveMaker.cs
r7413 r7419 32 32 [Item("NMoveMaker", "Performs an n-move.")] 33 33 [StorableClass] 34 public class NMoveMaker : SingleSuccessorOperator, I GQAPNMoveOperator, IMoveMaker {34 public class NMoveMaker : SingleSuccessorOperator, IAssignmentAwareGQAPOperator, IQualityAwareGQAPOperator, IMoveQualityAwareGQAPOperator, IGQAPNMoveOperator, IMoveMaker { 35 35 36 36 public ILookupParameter<IntegerVector> AssignmentParameter { … … 39 39 public ILookupParameter<NMove> MoveParameter { 40 40 get { return (ILookupParameter<NMove>)Parameters["Move"]; } 41 } 42 ILookupParameter<BoolValue> IQualityAwareGQAPOperator.MaximizationParameter { 43 get { return MaximizationParameter; } 44 } 45 ILookupParameter<BoolValue> IMoveQualityAwareGQAPOperator.MaximizationParameter { 46 get { return MaximizationParameter; } 47 } 48 public ILookupParameter<BoolValue> MaximizationParameter { 49 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 41 50 } 42 51 public ILookupParameter<DoubleValue> QualityParameter { … … 70 79 public NMoveMaker() 71 80 : base() { 72 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "The equipment-location assignment vector.")); 73 Parameters.Add(new LookupParameter<NMove>("Move", "The move to perform.")); 74 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality.")); 75 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria.")); 76 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs.")); 77 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location.")); 78 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move if it would be applied.")); 79 Parameters.Add(new LookupParameter<DoubleValue>("MoveFlowDistanceQuality", "The quality of the move regarding the flow-distance criteria.")); 80 Parameters.Add(new LookupParameter<DoubleValue>("MoveInstallationQuality", "The quality of the move regarding the installation costs.")); 81 Parameters.Add(new LookupParameter<DoubleValue>("MoveOverbookedCapacity", "The sum of the overbooked capacities of the move relative to the capacity of each location.")); 81 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 82 Parameters.Add(new LookupParameter<NMove>("Move", GQAPNMoveGenerator.MoveDescription)); 83 Parameters.Add(new LookupParameter<BoolValue>("Maximization", GeneralizedQuadraticAssignmentProblem.MaximizationDescription)); 84 Parameters.Add(new LookupParameter<DoubleValue>("Quality", GQAPEvaluator.QualityDescription)); 85 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", GQAPEvaluator.FlowDistanceQualityDescription)); 86 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", GQAPEvaluator.InstallationQualityDescription)); 87 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", GQAPEvaluator.OverbookedCapacityDescription)); 88 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", GQAPNMoveEvaluator.MoveQualityDescription)); 89 Parameters.Add(new LookupParameter<DoubleValue>("MoveFlowDistanceQuality", GQAPNMoveEvaluator.MoveFlowDistanceQualityDescription)); 90 Parameters.Add(new LookupParameter<DoubleValue>("MoveInstallationQuality", GQAPNMoveEvaluator.MoveInstallationQualityDescription)); 91 Parameters.Add(new LookupParameter<DoubleValue>("MoveOverbookedCapacity", GQAPNMoveEvaluator.MoveOverbookedCapacityDescription)); 82 92 } 83 93 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveMultiMoveGenerator.cs
r7413 r7419 32 32 [Item("Stochastic n-move MultiMoveGenerator", "Randomly samples a number of n-moves.")] 33 33 [StorableClass] 34 public class StochasticNMoveMultiMoveGenerator : GQAPNMoveGenerator, I LocationAwareGQAPOperator, IMultiMoveGenerator, IStochasticOperator {34 public class StochasticNMoveMultiMoveGenerator : GQAPNMoveGenerator, ICapacitiesAwareGQAPOperator, IStochasticOperator, IMultiMoveGenerator { 35 35 36 public ILookupParameter<DoubleArray> CapacitiesParameter { 37 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 38 } 36 39 public ILookupParameter<IRandom> RandomParameter { 37 40 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 38 }39 public ILookupParameter<DoubleArray> CapacitiesParameter {40 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; }41 41 } 42 42 public IValueLookupParameter<IntValue> SampleSizeParameter { … … 50 50 : base() { 51 51 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator that should be used.")); 52 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "Capacities of the locations."));52 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 53 53 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate.")); 54 54 } -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs
r7413 r7419 32 32 [Item("Stochastic n-move SingleMoveGenerator", "Randomly samples a single n-move.")] 33 33 [StorableClass] 34 public class StochasticNMoveSingleMoveGenerator : GQAPNMoveGenerator, I LocationAwareGQAPOperator, ISingleMoveGenerator, IStochasticOperator {34 public class StochasticNMoveSingleMoveGenerator : GQAPNMoveGenerator, ICapacitiesAwareGQAPOperator, IStochasticOperator, ISingleMoveGenerator { 35 35 36 public ILookupParameter<DoubleArray> CapacitiesParameter { 37 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 38 } 36 39 public ILookupParameter<IRandom> RandomParameter { 37 40 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 38 }39 public ILookupParameter<DoubleArray> CapacitiesParameter {40 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; }41 41 } 42 42 … … 47 47 : base() { 48 48 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator that should be used.")); 49 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "Capacities of the locations."));49 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 50 50 } 51 51 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/ApproximateLocalSearch.cs
r7412 r7419 33 33 34 34 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Operators { 35 [Item("ApproximateLocalSearch", @"The approximate local search is described in Mateus, G., Resende, M., and Silva, R. 2011. GRASP with path-relinking for the generalized quadratic assignment problem. Journal of Heuristics 17, Springer Netherlands, pp. 527-565. 36 37 The implementation differs slightly from Mateus et al. in that the maximumIterations parameter defines a cap on the number of steps that the local search can perform. While the maxSampleSize parameter corresponds to the maxItr parameter defined by Mateus et al.")] 35 [Item("ApproximateLocalSearch", "The approximate local search is described in Mateus, G., Resende, M., and Silva, R. 2011. GRASP with path-relinking for the generalized quadratic assignment problem. Journal of Heuristics 17, Springer Netherlands, pp. 527-565.")] 38 36 [StorableClass] 39 public class ApproximateLocalSearch : SingleSuccessorOperator, IGQAPLocalImprovementOperator, IStochasticOperator { 37 public class ApproximateLocalSearch : SingleSuccessorOperator, IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, 38 IWeightsAwareGQAPOperator, IDistancesAwareGQAPOperator, IInstallationCostsAwareGQAPOperator, 39 ITransportationCostsAwareGQAPOperator, IOverbookedCapacityPenaltyAwareGQAPOperator, 40 IAssignmentAwareGQAPOperator, IQualityAwareGQAPOperator, IGQAPLocalImprovementOperator, IStochasticOperator { 40 41 public IProblem Problem { get; set; } 41 42 public Type ProblemType { … … 43 44 } 44 45 46 public ILookupParameter<DoubleArray> DemandsParameter { 47 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; } 48 } 49 public ILookupParameter<DoubleArray> CapacitiesParameter { 50 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 51 } 52 public ILookupParameter<DoubleMatrix> WeightsParameter { 53 get { return (ILookupParameter<DoubleMatrix>)Parameters["Weights"]; } 54 } 55 public ILookupParameter<DoubleMatrix> DistancesParameter { 56 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; } 57 } 58 public ILookupParameter<DoubleMatrix> InstallationCostsParameter { 59 get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; } 60 } 61 public IValueLookupParameter<DoubleValue> TransportationCostsParameter { 62 get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; } 63 } 64 public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter { 65 get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; } 66 } 67 public ILookupParameter<IntegerVector> AssignmentParameter { 68 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; } 69 } 70 public ILookupParameter<BoolValue> MaximizationParameter { 71 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 72 } 73 public ILookupParameter<DoubleValue> QualityParameter { 74 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 75 } 76 public ILookupParameter<DoubleValue> FlowDistanceQualityParameter { 77 get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; } 78 } 79 public ILookupParameter<DoubleValue> InstallationQualityParameter { 80 get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; } 81 } 82 public ILookupParameter<DoubleValue> OverbookedCapacityParameter { 83 get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 84 } 85 public IValueLookupParameter<IntValue> MaximumIterationsParameter { 86 get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; } 87 } 88 public ILookupParameter<IntValue> EvaluatedSolutionsParameter { 89 get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 90 } 45 91 public ILookupParameter<IRandom> RandomParameter { 46 92 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 47 93 } 48 public IValueLookupParameter<IntValue> MaximumIterationsParameter { 49 get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; } 50 } 51 public ILookupParameter<IntValue> EvaluatedSolutionsParameter { 52 get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; } 53 } 54 public ILookupParameter<DoubleValue> QualityParameter { 55 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 56 } 57 public ILookupParameter<DoubleValue> FlowDistanceQualityParameter { 58 get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; } 59 } 60 public ILookupParameter<DoubleValue> InstallationQualityParameter { 61 get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; } 62 } 63 public ILookupParameter<DoubleValue> OverbookedCapacityParameter { 64 get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 94 public IValueLookupParameter<IntValue> MaximumCandidateListSizeParameter { 95 get { return (IValueLookupParameter<IntValue>)Parameters["MaximumCandidateListSize"]; } 96 } 97 public IValueLookupParameter<PercentValue> OneMoveProbabilityParameter { 98 get { return (IValueLookupParameter<PercentValue>)Parameters["OneMoveProbability"]; } 65 99 } 66 100 public ILookupParameter<ResultCollection> ResultsParameter { 67 101 get { return (ILookupParameter<ResultCollection>)Parameters["Results"]; } 68 }69 public IValueLookupParameter<IntValue> MaximumCandidateListSizeParameter {70 get { return (IValueLookupParameter<IntValue>)Parameters["MaximumCandidateListSize"]; }71 }72 public IValueLookupParameter<IntValue> MaximumSampleSizeParameter {73 get { return (IValueLookupParameter<IntValue>)Parameters["MaximumSampleSize"]; }74 }75 public ILookupParameter<IntegerVector> AssignmentParameter {76 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; }77 }78 public ILookupParameter<DoubleMatrix> WeightsParameter {79 get { return (ILookupParameter<DoubleMatrix>)Parameters["Weights"]; }80 }81 public ILookupParameter<DoubleMatrix> DistancesParameter {82 get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; }83 }84 public ILookupParameter<DoubleMatrix> InstallationCostsParameter {85 get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }86 }87 public ILookupParameter<DoubleArray> DemandsParameter {88 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; }89 }90 public ILookupParameter<DoubleArray> CapacitiesParameter {91 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; }92 }93 public IValueLookupParameter<DoubleValue> TransportationCostsParameter {94 get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }95 }96 public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter {97 get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }98 }99 public IValueLookupParameter<PercentValue> OneMoveProbabilityParameter {100 get { return (IValueLookupParameter<PercentValue>)Parameters["OneMoveProbability"]; }101 102 } 102 103 … … 106 107 public ApproximateLocalSearch() 107 108 : base() { 108 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 109 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 110 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 111 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", GeneralizedQuadraticAssignmentProblem.WeightsDescription)); 112 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", GeneralizedQuadraticAssignmentProblem.DistancesDescription)); 113 Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", GeneralizedQuadraticAssignmentProblem.InstallationCostsDescription)); 114 Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", GeneralizedQuadraticAssignmentProblem.TransportationCostsDescription)); 115 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", GeneralizedQuadraticAssignmentProblem.OverbookedCapacityPenaltyDescription)); 116 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 117 Parameters.Add(new LookupParameter<BoolValue>("Maximization", GeneralizedQuadraticAssignmentProblem.MaximizationDescription)); 118 Parameters.Add(new LookupParameter<DoubleValue>("Quality", GQAPEvaluator.QualityDescription)); 119 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", GQAPEvaluator.FlowDistanceQualityDescription)); 120 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", GQAPEvaluator.InstallationQualityDescription)); 121 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", GQAPEvaluator.OverbookedCapacityDescription)); 109 122 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of iterations that should be performed.")); 110 123 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solution equivalents.")); 111 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality.")); 112 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria.")); 113 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs.")); 114 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location.")); 124 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 125 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumCandidateListSize", "The maximum number of candidates that should be found in each step.", new IntValue(10))); 126 Parameters.Add(new ValueLookupParameter<PercentValue>("OneMoveProbability", "The probability for performing a 1-move, which is the opposite of performing a 2-move.", new PercentValue(.5))); 115 127 Parameters.Add(new LookupParameter<ResultCollection>("Results", "The result collection that stores the results.")); 116 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumCandidateListSize", "The maximum number of candidates that should be found in each step.", new IntValue(10)));117 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumSampleSize", "The maximum number of candidates that should be sampled in each step.", new IntValue(100)));118 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "The equipment-location assignment vector."));119 Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The weights matrix describes the flows between the equipments."));120 Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed."));121 Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j."));122 Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments."));123 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));124 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 matrix already."));125 Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality."));126 Parameters.Add(new ValueLookupParameter<PercentValue>("OneMoveProbability", "The probability for performing a 1-move, which is the opposite of performing a 2-move.", new PercentValue(.5)));127 128 } 128 129 … … 143 144 /// <param name="overbookedCapacity">The sum of the overbooked capacities relative to the capacity of each location.</param> 144 145 /// <param name="maxCLS">The maximum number of candidates that should be found in each step.</param> 145 /// <param name="maxSampleSize">The maximum number of candidates that should be sampled in each step.</param> 146 /// <param name="maximumIterations">The maximum number of iterations that should be performed.</param> 146 /// <param name="maximumIterations">The maximum number of iterations that should be performed each time the candidate list is generated.</param> 147 147 /// <param name="weights">The weights matrix describes the flows between the equipments.</param> 148 148 /// <param name="distances">The distances matrix describes the distances between the locations at which the equipment can be installed.</param> … … 155 155 public static void Apply(IRandom random, IntegerVector assignment, 156 156 DoubleValue quality, DoubleValue flowDistanceQuality, DoubleValue installationQuality, DoubleValue overbookedCapacity, 157 IntValue maxCLS, IntValue max SampleSize, IntValue maximumIterations,157 IntValue maxCLS, IntValue maximumIterations, 158 158 DoubleMatrix weights, DoubleMatrix distances, DoubleMatrix installationCosts, DoubleArray demands, DoubleArray capacities, 159 159 DoubleValue transportationCosts, DoubleValue overbookedCapacityPenalty, PercentValue oneMoveProbability) { 160 160 161 for (int i = 0; i < maximumIterations.Value; i++) {161 while (true) { 162 162 int count = 0; 163 163 var CLS = new List<Tuple<NMove, double, double, double, double>>(); … … 180 180 } 181 181 count++; 182 } while (CLS.Count < maxCLS.Value && count < max SampleSize.Value);182 } while (CLS.Count < maxCLS.Value && count < maximumIterations.Value); 183 183 184 184 if (CLS.Count == 0) … … 211 211 OverbookedCapacityParameter.ActualValue, 212 212 MaximumCandidateListSizeParameter.ActualValue, 213 MaximumSampleSizeParameter.ActualValue,214 213 MaximumIterationsParameter.ActualValue, 215 214 WeightsParameter.ActualValue, DistancesParameter.ActualValue, -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/DemandEquivalentSwapEquipmentManipluator.cs
r7407 r7419 35 35 [Item("DemandEquivalentSwapEquipmentManipluator", "Swaps equipment X from location A with as much equipments from location B that the demand of X is less than or equal to the demand of the swapped equipments in B.")] 36 36 [StorableClass] 37 public class DemandEquivalentSwapEquipmentManipluator : GQAPManipulator, I LocationAwareGQAPOperator, IEquipmentAwareGQAPOperator {37 public class DemandEquivalentSwapEquipmentManipluator : GQAPManipulator, IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator { 38 38 39 public ILookupParameter<DoubleArray> DemandsParameter { 40 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; } 41 } 39 42 public ILookupParameter<DoubleArray> CapacitiesParameter { 40 43 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 41 }42 public ILookupParameter<DoubleArray> DemandsParameter {43 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; }44 44 } 45 45 … … 49 49 public DemandEquivalentSwapEquipmentManipluator() 50 50 : base() { 51 Parameters.Add(new LookupParameter<DoubleArray>(" Capacities", "The capacities vector describes the available space at the locations."));52 Parameters.Add(new LookupParameter<DoubleArray>(" Demands", "The demands vector describes the space requirements of the equipments."));51 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 52 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 53 53 } 54 54 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/DiscreteLocationCrossover.cs
r7413 r7419 33 33 [Item("DiscreteLocationCrossover", "Combines the assignment to locations from various parents.")] 34 34 [StorableClass] 35 public class DiscreteLocationCrossover : GQAPCrossover, I LocationAwareGQAPOperator {35 public class DiscreteLocationCrossover : GQAPCrossover, ICapacitiesAwareGQAPOperator { 36 36 37 37 public ILookupParameter<DoubleArray> CapacitiesParameter { … … 45 45 public DiscreteLocationCrossover() 46 46 : base() { 47 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));47 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 48 48 } 49 49 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GQAPCrossover.cs
r7319 r7419 36 36 get { return false; } 37 37 } 38 public ILookupParameter<IRandom> RandomParameter { 39 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 40 } 38 41 39 public IScopeTreeLookupParameter<IntegerVector> ParentsParameter { 42 40 get { return (ScopeTreeLookupParameter<IntegerVector>)Parameters["Parents"]; } … … 44 42 public ILookupParameter<IntegerVector> ChildParameter { 45 43 get { return (ILookupParameter<IntegerVector>)Parameters["Child"]; } 44 } 45 public ILookupParameter<IRandom> RandomParameter { 46 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 46 47 } 47 48 … … 51 52 protected GQAPCrossover() 52 53 : base() { 53 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic crossover operators."));54 54 Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("Parents", "The parent vectors which should be crossed.", "Assignment")); 55 55 Parameters.Add(new LookupParameter<IntegerVector>("Child", "The child vector resulting from the crossover.", "Assignment")); 56 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic crossover operators.")); 56 57 } 57 58 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GQAPManipulator.cs
r7418 r7419 31 31 [Item("GQAPManipulator", "A base class for operators that manipulate assignment vectors of the GeneralizedQuadraticAssignment problems.")] 32 32 [StorableClass] 33 public abstract class GQAPManipulator : SingleSuccessorOperator, I GQAPManipulator, IStochasticOperator {33 public abstract class GQAPManipulator : SingleSuccessorOperator, IAssignmentAwareGQAPOperator, IManipulator, IStochasticOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 38 public ILookupParameter<IntegerVector> AssignmentParameter { 39 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; } 40 } 37 41 public ILookupParameter<IRandom> RandomParameter { 38 42 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 39 }40 public ILookupParameter<IntegerVector> AssignmentParameter {41 get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; }42 43 } 43 44 … … 47 48 protected GQAPManipulator() 48 49 : base() { 50 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 49 51 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 50 Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The assignment vector which should be manipulated."));51 52 } 52 53 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GQAPSolutionCreator.cs
r7373 r7419 31 31 [Item("GQAPSolutionCreator", "Base class for solution creators of the Generalized Quadratic Assignment Problem.")] 32 32 [StorableClass] 33 public abstract class GQAPSolutionCreator : SingleSuccessorOperator, IGQAPSolutionCreator { 33 public abstract class GQAPSolutionCreator : SingleSuccessorOperator, IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, IGQAPSolutionCreator { 34 35 #region Parameter Descriptions 36 public static readonly string AssignmentDescription = "The vector that encodes the assignment."; 37 #endregion 34 38 35 39 public ILookupParameter<IntegerVector> AssignmentParameter { 36 40 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; } 37 41 } 42 public ILookupParameter<DoubleArray> DemandsParameter { 43 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; } 44 } 38 45 public ILookupParameter<DoubleArray> CapacitiesParameter { 39 46 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 40 }41 public ILookupParameter<DoubleArray> DemandsParameter {42 get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; }43 47 } 44 48 … … 49 53 public GQAPSolutionCreator() 50 54 : base() { 51 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "Creates an assignment for the Generalized Quadratic Assignment Problem."));52 Parameters.Add(new LookupParameter<DoubleArray>(" Capacities", "The capacities vector describes the available space at the locations."));53 Parameters.Add(new LookupParameter<DoubleArray>(" Demands", "The demands vector describes the space requirements of the equipments."));55 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", AssignmentDescription)); 56 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 57 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 54 58 } 55 59 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/NMoveShakingOperator.cs
r7418 r7419 32 32 [Item("NMoveShakingOperator", "Performs a number of shaking operations that increase in strength.")] 33 33 [StorableClass] 34 public class NMoveShakingOperator : SingleSuccessorOperator, I LocationAwareGQAPOperator, IGQAPOperator, IMultiNeighborhoodShakingOperator, IStochasticOperator {34 public class NMoveShakingOperator : SingleSuccessorOperator, IAssignmentAwareGQAPOperator, ICapacitiesAwareGQAPOperator, IMultiNeighborhoodShakingOperator, IStochasticOperator { 35 35 36 public ILookupParameter<IRandom> RandomParameter {37 get { return (ILookupParameter<IRandom>)Parameters["Random"]; }38 }39 36 public ILookupParameter<IntegerVector> AssignmentParameter { 40 37 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; } 38 } 39 public ILookupParameter<DoubleArray> CapacitiesParameter { 40 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 41 41 } 42 42 public IValueLookupParameter<IntValue> CurrentNeighborhoodIndexParameter { … … 46 46 get { return (ILookupParameter<IntValue>)Parameters["NeighborhoodCount"]; } 47 47 } 48 public ILookupParameter< DoubleArray> CapacitiesParameter {49 get { return (ILookupParameter< DoubleArray>)Parameters["Capacities"]; }48 public ILookupParameter<IRandom> RandomParameter { 49 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 50 50 } 51 51 … … 54 54 protected NMoveShakingOperator(NMoveShakingOperator original, Cloner cloner) : base(original, cloner) { } 55 55 public NMoveShakingOperator() { 56 Parameters.Add(new LookupParameter<I Random>("Random", "The random number generator to use."));57 Parameters.Add(new LookupParameter< IntegerVector>("Assignment", "The equipment-location assignment vector."));56 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 57 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 58 58 Parameters.Add(new ValueLookupParameter<IntValue>("CurrentNeighborhoodIndex", "The index of the operator that should be applied (k).")); 59 59 Parameters.Add(new LookupParameter<IntValue>("NeighborhoodCount", "The number of operators that are available.")); 60 Parameters.Add(new LookupParameter< DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));60 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 61 61 } 62 62 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/QualitySimilarityMerger.cs
r7412 r7419 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common; 31 32 32 33 namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Operators { 33 34 [Item("QualitySimilarityMerger", "Merges two populations by using quality and similarity information to maintain a population of high quality, but also diverse solutions.")] 34 35 [StorableClass] 35 public class QualitySimilarityMerger : SingleSuccessorOperator, I GQAPMerger {36 public class QualitySimilarityMerger : SingleSuccessorOperator, IAssignmentAwareGQAPOperator, IQualityAwareGQAPOperator, IMerger { 36 37 public ILookupParameter<IntegerVector> AssignmentParameter { 37 38 get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; } 39 } 40 public ILookupParameter<BoolValue> MaximizationParameter { 41 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 38 42 } 39 43 public ILookupParameter<DoubleValue> QualityParameter { 40 44 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 41 45 } 46 public ILookupParameter<DoubleValue> FlowDistanceQualityParameter { 47 get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; } 48 } 49 public ILookupParameter<DoubleValue> InstallationQualityParameter { 50 get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; } 51 } 52 public ILookupParameter<DoubleValue> OverbookedCapacityParameter { 53 get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; } 54 } 42 55 public ILookupParameter<IntValue> PopulationSizeParameter { 43 56 get { return (ILookupParameter<IntValue>)Parameters["PopulationSize"]; } 44 }45 public IValueLookupParameter<BoolValue> MaximizationParameter {46 get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }47 57 } 48 58 … … 52 62 public QualitySimilarityMerger() 53 63 : base() { 54 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", "The equipment-location assignment.")); 55 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of a solution.")); 64 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", GQAPSolutionCreator.AssignmentDescription)); 65 Parameters.Add(new LookupParameter<BoolValue>("Maximization", GeneralizedQuadraticAssignmentProblem.MaximizationDescription)); 66 Parameters.Add(new LookupParameter<DoubleValue>("Quality", GQAPEvaluator.QualityDescription)); 67 Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", GQAPEvaluator.FlowDistanceQualityDescription)); 68 Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", GQAPEvaluator.InstallationQualityDescription)); 69 Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", GQAPEvaluator.OverbookedCapacityDescription)); 56 70 Parameters.Add(new LookupParameter<IntValue>("PopulationSize", "The size of the population that should not be surpassed.")); 57 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is to be maximized, false otherwise."));58 71 } 59 72 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/RelocateEquipmentManipluator.cs
r7407 r7419 35 35 [Item("RelocateEquipmentManipluator", "Relocates a random equipment from an overstuffed location to a random one with space or a random equipment if constraints are satisfied.")] 36 36 [StorableClass] 37 public class RelocateEquipmentManipluator : GQAPManipulator, I LocationAwareGQAPOperator, IEquipmentAwareGQAPOperator {37 public class RelocateEquipmentManipluator : GQAPManipulator, IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator { 38 38 39 39 public ILookupParameter<DoubleArray> CapacitiesParameter { … … 49 49 public RelocateEquipmentManipluator() 50 50 : base() { 51 Parameters.Add(new LookupParameter<DoubleArray>(" Capacities", "The capacities vector describes the available space at the locations."));52 Parameters.Add(new LookupParameter<DoubleArray>(" Demands", "The demands vector describes the space requirements of the equipments."));51 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 52 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 53 53 } 54 54 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/SwapLocationManipulator.cs
r7319 r7419 33 33 [Item("SwapLocationManipluator", "Swaps two locations by exchanging all equipments between the locations.")] 34 34 [StorableClass] 35 public class SwapLocationManipluator : GQAPManipulator, I LocationAwareGQAPOperator {35 public class SwapLocationManipluator : GQAPManipulator, ICapacitiesAwareGQAPOperator { 36 36 37 37 public ILookupParameter<DoubleArray> CapacitiesParameter { … … 44 44 public SwapLocationManipluator() 45 45 : base() { 46 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));46 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 47 47 } 48 48
Note: See TracChangeset
for help on using the changeset viewer.