Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/01/12 13:28:54 (12 years ago)
Author:
abeham
Message:

#1614

  • Add BestKnownSolutions parameter
  • Assignment view
    • Clicking on an equipment highlights all related equipments
    • Clicking on a location highlights other locations that contain equipment to which relations exist
    • Showing installation costs when nothing is selected
  • Analyzers were present double times
  • Fixed GRASP to check EnabledByDefault
Location:
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/BestGQAPSolutionAnalyzer.cs

    r7437 r7438  
    4141    IDemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, ITransportationCostsAwareGQAPOperator,
    4242    IOverbookedCapacityPenaltyAwareGQAPOperator, IEquipmentNamesAwareGQAPOperator, ILocationNamesAwareGQAPOperator,
    43     IBestKnownQualityAwareGQAPOperator, IBestKnownSolutionAwareGQAPOperator, IAnalyzer {
     43    IBestKnownQualityAwareGQAPOperator, IBestKnownSolutionAwareGQAPOperator, IBestKnownSolutionsAwareGQAPOperator,
     44    IAnalyzer {
    4445
    4546    public bool EnabledByDefault {
     
    4748    }
    4849
     50    #region Parameter Properties
    4951    public IScopeTreeLookupParameter<IntegerVector> AssignmentParameter {
    5052      get { return (IScopeTreeLookupParameter<IntegerVector>)Parameters["Assignment"]; }
     
    98100      get { return (ILookupParameter<IntegerVector>)Parameters["BestKnownSolution"]; }
    99101    }
     102    public ILookupParameter<GQAPAssignmentArchive> BestKnownSolutionsParameter {
     103      get { return (ILookupParameter<GQAPAssignmentArchive>)Parameters["BestKnownSolutions"]; }
     104    }
    100105    public ILookupParameter<GQAPAssignment> BestSolutionParameter {
    101106      get { return (ILookupParameter<GQAPAssignment>)Parameters["BestSolution"]; }
     
    104109      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    105110    }
     111    #endregion
    106112
    107113    [StorableConstructor]
     
    130136      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", GeneralizedQuadraticAssignmentProblem.BestKnownQualityDescription));
    131137      Parameters.Add(new LookupParameter<IntegerVector>("BestKnownSolution", GeneralizedQuadraticAssignmentProblem.BestKnownSolutionDescription));
     138      Parameters.Add(new LookupParameter<GQAPAssignmentArchive>("BestKnownSolutions", GeneralizedQuadraticAssignmentProblem.BestKnownSolutionsDescription));
    132139      Parameters.Add(new LookupParameter<GQAPAssignment>("BestSolution", "The best GQAP solution found so far."));
    133140      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best GQAP solution should be stored."));
     
    152159      var maximization = MaximizationParameter.ActualValue.Value;
    153160      var bestKnownQuality = BestKnownQualityParameter.ActualValue;
     161      var bestKnownSolutions = BestKnownSolutionsParameter.ActualValue;
    154162
    155163      int bestIndex;
     
    186194      }
    187195
     196      GQAPAssignmentArchive archive = BestKnownSolutionsParameter.ActualValue;
     197      if (archive == null) {
     198        archive = new GQAPAssignmentArchive(equipmentNames, locationNames, distances, weights, installationCosts, demands, capacities, transportationCosts, overbookedCapacityPenalty);
     199        BestKnownSolutionsParameter.ActualValue = archive;
     200      } else {
     201        var solutions = Enumerable.Range(0, assignments.Length)
     202        .Select(i => new GQAPSolution(assignments[i], qualities[i], flowDistanceQualities[i], installationQualities[i], overbookedCapacities[i]))
     203        .Concat(archive.Solutions);
     204        archive.Solutions = GQAPSolutionArchiveUpdater.GetFeasibleParetoFront(solutions);
     205      }
     206
    188207      return base.Apply();
    189208    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/GQAPPopulationDiversityAnalyzer.cs

    r7437 r7438  
    3838    }
    3939    public new ILookupParameter<BoolValue> MaximizationParameter {
    40       get { return MaximizationParameter; }
     40      get { return base.MaximizationParameter; }
    4141    }
    4242    public new IScopeTreeLookupParameter<DoubleValue> QualityParameter {
    43       get { return QualityParameter; }
     43      get { return base.QualityParameter; }
    4444    }
    4545    public IScopeTreeLookupParameter<DoubleValue> FlowDistanceQualityParameter {
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/GQAPSolutionArchiveAnalyzer.cs

    r7437 r7438  
    2020#endregion
    2121
     22using System.Linq;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    163164      }
    164165
    165       ItemList<GQAPSolution> front = new ItemList<GQAPSolution>(archive.Solutions);
    166       for (int i = 0; i < assignments.Length; i++) {
    167         if (overbookedCapacities[i].Value <= 0.0)
    168           front.Add(new GQAPSolution(assignments[i], qualities[i], flowDistanceQualities[i], installationQualities[i], overbookedCapacities[i]));
    169       }
    170 
    171       for (int i = 0; i < front.Count - 1; i++) {
    172         for (int j = i + 1; j < front.Count; j++) {
    173           if (front[i].FlowDistanceQuality.Value < front[j].FlowDistanceQuality.Value
    174             && front[i].InstallationQuality.Value < front[j].InstallationQuality.Value) {
    175             front.RemoveAt(j);
    176             j--;
    177           } else if (front[i].FlowDistanceQuality.Value > front[j].FlowDistanceQuality.Value
    178             && front[i].InstallationQuality.Value > front[j].InstallationQuality.Value) {
    179             front.RemoveAt(i);
    180             j = i;
    181           }
    182         }
    183       }
    184 
    185       archive.Solutions = front;
     166      var solutions = Enumerable.Range(0, assignments.Length)
     167        .Select(i => new GQAPSolution(assignments[i], qualities[i], flowDistanceQualities[i], installationQualities[i], overbookedCapacities[i]))
     168        .Concat(archive.Solutions);
     169      archive.Solutions = GQAPSolutionArchiveUpdater.GetFeasibleParetoFront(solutions);
    186170
    187171      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.