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
File:
1 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    }
Note: See TracChangeset for help on using the changeset viewer.