Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7438


Ignore:
Timestamp:
02/01/12 13:28:54 (13 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
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/GRASPWithPathRelinking.cs

    r7420 r7438  
    215215            param.Depth = 1;
    216216          Analyzer.Operators.Add(a);
     217          Analyzer.Operators.SetItemCheckedState(a, a.EnabledByDefault);
    217218        }
    218219        InitializeFromInstallation(LocalImprovementParameter, x => x.ProblemType.IsAssignableFrom(Problem.GetType()));
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentArchiveView.Designer.cs

    r7437 r7438  
    5656      chartArea1.AxisX.Title = "FlowDistanceQuality";
    5757      chartArea1.AxisY.Title = "InstallationQuality";
    58       chartArea1.CursorX.IsUserEnabled = true;
    5958      chartArea1.CursorX.IsUserSelectionEnabled = true;
    60       chartArea1.CursorY.IsUserEnabled = true;
    6159      chartArea1.CursorY.IsUserSelectionEnabled = true;
    6260      chartArea1.Name = "ChartArea1";
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.Designer.cs

    r7415 r7438  
    5050      this.assignmentGroupBox = new System.Windows.Forms.GroupBox();
    5151      this.characteristicsGroupBox = new System.Windows.Forms.GroupBox();
     52      this.label7 = new System.Windows.Forms.Label();
     53      this.overbookedCapacityLabel = new System.Windows.Forms.Label();
     54      this.label5 = new System.Windows.Forms.Label();
     55      this.installationQualityLabel = new System.Windows.Forms.Label();
     56      this.label3 = new System.Windows.Forms.Label();
    5257      this.flowDistanceQualityLabel = new System.Windows.Forms.Label();
    53       this.label3 = new System.Windows.Forms.Label();
    54       this.installationQualityLabel = new System.Windows.Forms.Label();
    55       this.label5 = new System.Windows.Forms.Label();
    56       this.overbookedCapacityLabel = new System.Windows.Forms.Label();
    57       this.label7 = new System.Windows.Forms.Label();
    5858      this.assignmentGroupBox.SuspendLayout();
    5959      this.characteristicsGroupBox.SuspendLayout();
     
    7070      this.assignmentTreeView.Size = new System.Drawing.Size(228, 331);
    7171      this.assignmentTreeView.TabIndex = 3;
     72      this.assignmentTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.assignmentTreeView_AfterSelect);
     73      this.assignmentTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.assignmentTreeView_MouseUp);
    7274      //
    7375      // label1
     
    123125      this.characteristicsGroupBox.Text = "Characteristics";
    124126      //
     127      // label7
     128      //
     129      this.label7.AutoSize = true;
     130      this.label7.Location = new System.Drawing.Point(6, 76);
     131      this.label7.Margin = new System.Windows.Forms.Padding(3);
     132      this.label7.Name = "label7";
     133      this.label7.Size = new System.Drawing.Size(71, 13);
     134      this.label7.TabIndex = 0;
     135      this.label7.Text = "Overbooking:";
     136      //
     137      // overbookedCapacityLabel
     138      //
     139      this.overbookedCapacityLabel.AutoSize = true;
     140      this.overbookedCapacityLabel.Location = new System.Drawing.Point(91, 76);
     141      this.overbookedCapacityLabel.Margin = new System.Windows.Forms.Padding(3);
     142      this.overbookedCapacityLabel.Name = "overbookedCapacityLabel";
     143      this.overbookedCapacityLabel.Size = new System.Drawing.Size(10, 13);
     144      this.overbookedCapacityLabel.TabIndex = 4;
     145      this.overbookedCapacityLabel.Text = "-";
     146      //
     147      // label5
     148      //
     149      this.label5.AutoSize = true;
     150      this.label5.Location = new System.Drawing.Point(6, 57);
     151      this.label5.Margin = new System.Windows.Forms.Padding(3);
     152      this.label5.Name = "label5";
     153      this.label5.Size = new System.Drawing.Size(60, 13);
     154      this.label5.TabIndex = 0;
     155      this.label5.Text = "Installation:";
     156      //
     157      // installationQualityLabel
     158      //
     159      this.installationQualityLabel.AutoSize = true;
     160      this.installationQualityLabel.Location = new System.Drawing.Point(91, 57);
     161      this.installationQualityLabel.Margin = new System.Windows.Forms.Padding(3);
     162      this.installationQualityLabel.Name = "installationQualityLabel";
     163      this.installationQualityLabel.Size = new System.Drawing.Size(10, 13);
     164      this.installationQualityLabel.TabIndex = 4;
     165      this.installationQualityLabel.Text = "-";
     166      //
     167      // label3
     168      //
     169      this.label3.AutoSize = true;
     170      this.label3.Location = new System.Drawing.Point(6, 38);
     171      this.label3.Margin = new System.Windows.Forms.Padding(3);
     172      this.label3.Name = "label3";
     173      this.label3.Size = new System.Drawing.Size(79, 13);
     174      this.label3.TabIndex = 0;
     175      this.label3.Text = "Flow/Distance:";
     176      //
    125177      // flowDistanceQualityLabel
    126178      //
     
    132184      this.flowDistanceQualityLabel.TabIndex = 4;
    133185      this.flowDistanceQualityLabel.Text = "-";
    134       //
    135       // label3
    136       //
    137       this.label3.AutoSize = true;
    138       this.label3.Location = new System.Drawing.Point(6, 38);
    139       this.label3.Margin = new System.Windows.Forms.Padding(3);
    140       this.label3.Name = "label3";
    141       this.label3.Size = new System.Drawing.Size(79, 13);
    142       this.label3.TabIndex = 0;
    143       this.label3.Text = "Flow/Distance:";
    144       //
    145       // installationQualityLabel
    146       //
    147       this.installationQualityLabel.AutoSize = true;
    148       this.installationQualityLabel.Location = new System.Drawing.Point(91, 57);
    149       this.installationQualityLabel.Margin = new System.Windows.Forms.Padding(3);
    150       this.installationQualityLabel.Name = "installationQualityLabel";
    151       this.installationQualityLabel.Size = new System.Drawing.Size(10, 13);
    152       this.installationQualityLabel.TabIndex = 4;
    153       this.installationQualityLabel.Text = "-";
    154       //
    155       // label5
    156       //
    157       this.label5.AutoSize = true;
    158       this.label5.Location = new System.Drawing.Point(6, 57);
    159       this.label5.Margin = new System.Windows.Forms.Padding(3);
    160       this.label5.Name = "label5";
    161       this.label5.Size = new System.Drawing.Size(60, 13);
    162       this.label5.TabIndex = 0;
    163       this.label5.Text = "Installation:";
    164       //
    165       // overbookedCapacityLabel
    166       //
    167       this.overbookedCapacityLabel.AutoSize = true;
    168       this.overbookedCapacityLabel.Location = new System.Drawing.Point(91, 76);
    169       this.overbookedCapacityLabel.Margin = new System.Windows.Forms.Padding(3);
    170       this.overbookedCapacityLabel.Name = "overbookedCapacityLabel";
    171       this.overbookedCapacityLabel.Size = new System.Drawing.Size(10, 13);
    172       this.overbookedCapacityLabel.TabIndex = 4;
    173       this.overbookedCapacityLabel.Text = "-";
    174       //
    175       // label7
    176       //
    177       this.label7.AutoSize = true;
    178       this.label7.Location = new System.Drawing.Point(6, 76);
    179       this.label7.Margin = new System.Windows.Forms.Padding(3);
    180       this.label7.Name = "label7";
    181       this.label7.Size = new System.Drawing.Size(71, 13);
    182       this.label7.TabIndex = 0;
    183       this.label7.Text = "Overbooking:";
    184186      //
    185187      // GQAPAssignmentView
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.cs

    r7418 r7438  
    2323using System.Collections.Generic;
    2424using System.ComponentModel;
     25using System.Drawing;
    2526using System.Linq;
    2627using System.Windows.Forms;
     
    3435  [Content(typeof(GQAPAssignment), IsDefaultView = true)]
    3536  public partial class GQAPAssignmentView : ItemView {
     37    private static readonly double BrightnessLevel = 0.5;
     38
    3639    public new GQAPAssignment Content {
    3740      get { return (GQAPAssignment)base.Content; }
     
    6972    }
    7073
    71     #region Event Handlers
     74    #region Content Event Handlers
    7275    private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    7376      switch (e.PropertyName) {
     
    8992    #endregion
    9093
     94    #region Event Handlers
     95    private void assignmentTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
     96      if (Content != null) {
     97        assignmentTreeView.BeginUpdate();
     98        try {
     99          if (assignmentTreeView.SelectedNode == null) {
     100            ColorByInstallationCosts();
     101          } else {
     102            var equipmentNode = (assignmentTreeView.SelectedNode as EquipmentNode);
     103            if (equipmentNode != null) {
     104              ColorByWeight(equipmentNode);
     105            }
     106            var locationNode = (assignmentTreeView.SelectedNode as LocationNode);
     107            if (locationNode != null) {
     108              ColorByWeight(locationNode);
     109            }
     110          }
     111        } finally { assignmentTreeView.EndUpdate(); }
     112      }
     113    }
     114
     115    private void assignmentTreeView_MouseUp(object sender, MouseEventArgs e) {
     116      var hit = assignmentTreeView.HitTest(e.X, e.Y);
     117      if (hit.Node == null || hit.Location == TreeViewHitTestLocations.None || hit.Location == TreeViewHitTestLocations.RightOfLabel) {
     118        assignmentTreeView.SelectedNode = null;
     119        ColorByInstallationCosts();
     120      }
     121    }
     122    #endregion
     123
     124    #region Helpers
    91125    private void UpdateQuality() {
    92126      if (InvokeRequired) Invoke((Action)UpdateQuality);
     
    145179              if (Content.LocationNames != null && Content.LocationNames.Length > assignment[i])
    146180                locationName = Content.LocationNames[assignment[i]];
    147               locationNodes.Add(assignment[i], new TreeNode(locationName));
     181              locationNodes.Add(assignment[i], new LocationNode(assignment[i], locationName));
    148182            }
    149183            string equipmentName = i.ToString();
    150184            if (Content.EquipmentNames != null && Content.EquipmentNames.Length > i)
    151185              equipmentName = Content.EquipmentNames[i];
    152             locationNodes[assignment[i]].Nodes.Add(equipmentName);
     186            locationNodes[assignment[i]].Nodes.Add(new EquipmentNode(i, equipmentName));
    153187          }
    154188
     
    159193              node.Expand();
    160194            }
     195            ColorByInstallationCosts();
    161196          } finally { assignmentTreeView.EndUpdate(); }
    162197        }
    163198      }
    164199    }
     200
     201    private void ColorByInstallationCosts() {
     202      var installationCosts = new Dictionary<EquipmentNode, double>();
     203      foreach (var node in GetAllSubNodes(assignmentTreeView.Nodes).OfType<EquipmentNode>()) {
     204        int location = Content.Solution.Assignment[node.Equipment];
     205        installationCosts[node] = Content.InstallationCosts[node.Equipment, location];
     206      }
     207      double max = installationCosts.Values.Max();
     208      foreach (var kvp in installationCosts) {
     209        if (max == 0) {
     210          kvp.Key.BackColor = assignmentTreeView.BackColor;
     211          kvp.Key.ForeColor = assignmentTreeView.ForeColor;
     212        }
     213        int colorComponent = (int)(255 * Math.Pow((max - kvp.Value) / max, 2));
     214        kvp.Key.BackColor = Color.FromArgb(255, colorComponent, colorComponent);
     215        if (kvp.Key.BackColor.GetBrightness() < BrightnessLevel) kvp.Key.ForeColor = Color.White;
     216        else kvp.Key.ForeColor = Color.Black;
     217      }
     218    }
     219
     220    private void ColorByWeight(EquipmentNode selectedNode) {
     221      int equipment = selectedNode.Equipment;
     222      double rowSum = 0, colSum = 0;
     223      for (int i = 0; i < Content.Weights.Columns; i++)
     224        if (i != equipment) rowSum += Content.Weights[equipment, i];
     225      for (int i = 0; i < Content.Weights.Rows; i++)
     226        if (i != equipment) colSum += Content.Weights[i, equipment];
     227
     228      var otherEquipments = GetAllSubNodes(assignmentTreeView.Nodes)
     229        .OfType<EquipmentNode>()
     230        .Where(x => x != selectedNode);
     231
     232      selectedNode.BackColor = assignmentTreeView.BackColor;
     233      selectedNode.ForeColor = assignmentTreeView.ForeColor;
     234      foreach (var other in otherEquipments) {
     235        if (rowSum == 0 && colSum == 0) {
     236          other.BackColor = assignmentTreeView.BackColor;
     237          other.ForeColor = assignmentTreeView.ForeColor;
     238        } else {
     239          double rowInvProportion = rowSum == 0 ? 1.0 : (rowSum - Content.Weights[equipment, other.Equipment]) / rowSum;
     240          double colInvProportion = colSum == 0 ? 1.0 : (colSum - Content.Weights[other.Equipment, equipment]) / colSum;
     241          int colorComponent = (int)(255 * Math.Pow(Math.Min(rowInvProportion, colInvProportion), 2));
     242          other.BackColor = Color.FromArgb(colorComponent, 255, colorComponent);
     243          if (other.BackColor.GetBrightness() < BrightnessLevel) other.ForeColor = Color.White;
     244          else other.ForeColor = Color.Black;
     245        }
     246      }
     247    }
     248
     249    private void ColorByWeight(LocationNode selectedNode) {
     250      var equipments = new HashSet<int>(Content.Solution.Assignment.Select((v, i) => new { Index = i, Value = v })
     251        .Where(x => x.Value == selectedNode.Location).Select(x => x.Index));
     252      var rowSums = new Dictionary<int, double>(equipments.Count);
     253      var colSums = new Dictionary<int, double>(equipments.Count);
     254      foreach (var e in equipments) {
     255        rowSums[e] = 0;
     256        colSums[e] = 0;
     257        for (int i = 0; i < Content.Weights.Columns; i++) {
     258          if (!equipments.Contains(i)) rowSums[e] += Content.Weights[e, i];
     259          if (!equipments.Contains(i)) colSums[e] += Content.Weights[i, e];
     260        }
     261      }
     262      var equipmentNodes = GetAllSubNodes(assignmentTreeView.Nodes)
     263        .OfType<EquipmentNode>();
     264
     265      var relevantEquipments = new HashSet<int>(equipments.Where(x => rowSums[x] > 0 || colSums[x] > 0));
     266      foreach (var other in equipmentNodes) {
     267        if (!relevantEquipments.Any() || equipments.Contains(other.Equipment)) {
     268          other.BackColor = assignmentTreeView.BackColor;
     269          other.ForeColor = assignmentTreeView.ForeColor;
     270        } else {
     271          double rowInvProportion = relevantEquipments.Min(x => rowSums[x] == 0 ? 1.0 : (rowSums[x] - Content.Weights[x, other.Equipment]) / rowSums[x]);
     272          double colInvProportion = relevantEquipments.Min(x => colSums[x] == 0 ? 1.0 : (colSums[x] - Content.Weights[other.Equipment, x]) / colSums[x]);
     273          int colorComponent = (int)(255 * Math.Pow(Math.Min(rowInvProportion, colInvProportion), 2));
     274          other.BackColor = Color.FromArgb(colorComponent, 255, colorComponent);
     275          if (other.BackColor.GetBrightness() < BrightnessLevel) other.ForeColor = Color.White;
     276          else other.ForeColor = Color.Black;
     277        }
     278      }
     279    }
     280
     281    private IEnumerable<TreeNode> GetAllSubNodes(TreeNodeCollection nodes) {
     282      foreach (TreeNode node in nodes) {
     283        yield return node;
     284        foreach (TreeNode subNode in GetAllSubNodes(node.Nodes))
     285          yield return subNode;
     286      }
     287    }
     288    #endregion
     289
     290    #region Helper Classes
     291    private class LocationNode : TreeNode {
     292      public int Location { get; set; }
     293
     294      public LocationNode() : base() { }
     295      public LocationNode(int location, string name)
     296        : base(name) {
     297        Location = location;
     298      }
     299    }
     300
     301    private class EquipmentNode : TreeNode {
     302      public int Equipment { get; set; }
     303
     304      public EquipmentNode() : base() { }
     305      public EquipmentNode(int equipment, string name)
     306        : base(name) {
     307        Equipment = equipment;
     308      }
     309    }
     310    #endregion
    165311  }
    166312}
  • 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();
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs

    r7437 r7438  
    5555    public static readonly string BestKnownQualityDescription = "The best known quality (if available).";
    5656    public static readonly string BestKnownSolutionDescription = "The best known solution (if available).";
     57    public static readonly string BestKnownSolutionsDescription = "Contains an archive of best-known solutions regarding flow-distance quality and installation quality.";
    5758    public static readonly string EquipmentNamesDescription = "Optional: A list of names that describes the equipments.";
    5859    public static readonly string LocationNamesDescription = "Optional: A list of names that describes the locations.";
     
    8384    public OptionalValueParameter<IItem> BestKnownSolutionParameter {
    8485      get { return (OptionalValueParameter<IItem>)Parameters["BestKnownSolution"]; }
     86    }
     87    public OptionalValueParameter<GQAPAssignmentArchive> BestKnownSolutionsParameter {
     88      get { return (OptionalValueParameter<GQAPAssignmentArchive>)Parameters["BestKnownSolutions"]; }
    8589    }
    8690    public OptionalValueParameter<StringArray> EquipmentNamesParameter {
     
    146150    public GeneralizedQuadraticAssignmentProblem()
    147151      : base(new GQAPEvaluator(), new RandomSolutionCreator()) {
    148       Parameters.Add(new ValueParameter<DoubleMatrix>("Weights", WeightsDescription, new DoubleMatrix()));
    149       Parameters.Add(new ValueParameter<DoubleMatrix>("Distances", DistancesDescription, new DoubleMatrix()));
    150       Parameters.Add(new ValueParameter<DoubleMatrix>("InstallationCosts", InstallationCostsDescription, new DoubleMatrix()));
     152      Parameters.Add(new ValueParameter<DoubleMatrix>("Weights", WeightsDescription, new DoubleMatrix(), false));
     153      Parameters.Add(new ValueParameter<DoubleMatrix>("Distances", DistancesDescription, new DoubleMatrix(), false));
     154      Parameters.Add(new ValueParameter<DoubleMatrix>("InstallationCosts", InstallationCostsDescription, new DoubleMatrix(), false));
    151155      Parameters.Add(new FixedValueParameter<DoubleValue>("TransportationCosts", TransportationCostsDescription, new DoubleValue(1)));
    152156      Parameters.Add(new FixedValueParameter<DoubleValue>("OverbookedCapacityPenalty", OverbookedCapacityPenaltyDescription, new DoubleValue(1000)));
    153       Parameters.Add(new ValueParameter<DoubleArray>("Demands", DemandsDescription, new DoubleArray()));
    154       Parameters.Add(new ValueParameter<DoubleArray>("Capacities", CapacitiesDescription, new DoubleArray()));
    155       Parameters.Add(new OptionalValueParameter<IItem>("BestKnownSolution", BestKnownSolutionDescription, null));
     157      Parameters.Add(new ValueParameter<DoubleArray>("Demands", DemandsDescription, new DoubleArray(), false));
     158      Parameters.Add(new ValueParameter<DoubleArray>("Capacities", CapacitiesDescription, new DoubleArray(), false));
     159      Parameters.Add(new OptionalValueParameter<IItem>("BestKnownSolution", BestKnownSolutionDescription, null, false));
     160      Parameters.Add(new OptionalValueParameter<GQAPAssignmentArchive>("BestKnownSolutions", BestKnownSolutionsDescription, null, false));
    156161      Parameters.Add(new OptionalValueParameter<StringArray>("EquipmentNames", EquipmentNamesDescription, null, false));
    157162      Parameters.Add(new OptionalValueParameter<StringArray>("LocationNames", LocationNamesDescription, null, false));
     163
     164      BestKnownQualityParameter.Value = null;
    158165
    159166      WeightsParameter.ReactOnValueToStringChangedAndValueItemImageChanged = false;
     
    230237    private void InitializeOperators() {
    231238      Operators.Clear();
    232       Operators.Add(new BestGQAPSolutionAnalyzer());
    233       Operators.Add(new GQAPSolutionArchiveAnalyzer());
    234239      Operators.AddRange(ApplicationManager.Manager.GetInstances<IGQAPOperator>());
    235240      Operators.AddRange(ApplicationManager.Manager.GetInstances<IIntegerVectorOperator>());
     
    254259      foreach (var op in operators.OfType<IBestKnownSolutionAwareGQAPOperator>()) {
    255260        op.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
     261      }
     262      foreach (var op in operators.OfType<IBestKnownSolutionsAwareGQAPOperator>()) {
     263        op.BestKnownSolutionsParameter.ActualName = BestKnownSolutionsParameter.Name;
    256264      }
    257265      foreach (var op in operators.OfType<ICapacitiesAwareGQAPOperator>()) {
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj

    r7437 r7438  
    9494  <ItemGroup>
    9595    <Compile Include="Analyzers\BestGQAPSolutionAnalyzer.cs" />
     96    <Compile Include="Analyzers\GQAPSolutionArchiveUpdater.cs" />
    9697    <Compile Include="Analyzers\GQAPPopulationDiversityAnalyzer.cs" />
    9798    <Compile Include="Analyzers\GQAPSolutionArchiveAnalyzer.cs" />
     
    103104    <Compile Include="GQAPAssignmentArchive.cs" />
    104105    <Compile Include="GQAPSolution.cs" />
     106    <Compile Include="Interfaces\IBestKnownSolutionsAwareGQAPOperator.cs" />
    105107    <Compile Include="Interfaces\IGQAPManipulator.cs" />
    106108    <Compile Include="Interfaces\IQualitiesAwareGQAPOperator.cs" />
Note: See TracChangeset for help on using the changeset viewer.