Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/27/12 13:24:36 (12 years ago)
Author:
abeham
Message:

#1614

  • reworked parameterization (one interface for every parameter resp. parameter group)
  • unified parameter descriptions
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  
    3333  [Item("GQAPEvaluator", "Evaluates solutions to the generalized quadratic assignment problem.")]
    3434  [StorableClass]
    35   public class GQAPEvaluator : SingleSuccessorOperator, IGQAPEvaluator {
     35  public class GQAPEvaluator : SingleSuccessorOperator, IGQAPEvaluator,
     36  IWeightsAwareGQAPOperator, IDistancesAwareGQAPOperator, IInstallationCostsAwareGQAPOperator,
     37  IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, IAssignmentAwareGQAPOperator {
    3638
     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    }
    3749    public ILookupParameter<DoubleValue> QualityParameter {
    3850      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
     
    7789    public GQAPEvaluator()
    7890      : 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));
    91104    }
    92105
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators/GQAPNMoveEvaluator.cs

    r7413 r7419  
    2727using HeuristicLab.Encodings.IntegerVectorEncoding;
    2828using HeuristicLab.Operators;
     29using HeuristicLab.Optimization;
    2930using HeuristicLab.Parameters;
    3031using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3334  [Item("GQAPNMoveEvaluator", "Evaluates an n-move.")]
    3435  [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    }
    3773    public ILookupParameter<IntegerVector> AssignmentParameter {
    3874      get { return (ILookupParameter<IntegerVector>)Parameters["Assignment"]; }
    3975    }
    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; }
    4281    }
    4382    public ILookupParameter<DoubleValue> QualityParameter {
     
    5392      get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; }
    5493    }
    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     }
    6794    public IValueLookupParameter<DoubleValue> TransportationCostsParameter {
    6895      get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
     
    86113      get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; }
    87114    }
     115    #endregion
    88116
    89117    [StorableConstructor]
     
    92120    public GQAPNMoveEvaluator()
    93121      : 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));
    111140    }
    112141
Note: See TracChangeset for help on using the changeset viewer.