Changeset 5838


Ignore:
Timestamp:
03/28/11 15:34:30 (11 years ago)
Author:
abeham
Message:

#1330

  • Renamed the DistanceMatrix parameter to Distances
  • Renamed the SwapMove to Swap2Move and renamed operators accordingly
  • Integrated changes in HeuristicLab.Analysis.Views regarding description text box
Location:
branches/QAP
Files:
11 added
11 deleted
23 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/QAP/HeuristicLab.Analysis.Views/3.3

  • branches/QAP/HeuristicLab.Analysis.Views/3.3/DataTableView.Designer.cs

    r5445 r5838  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       System.Windows.Forms.DataVisualization.Charting.ChartArea defaultChartArea = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    48       System.Windows.Forms.DataVisualization.Charting.Legend defaultLegend = new System.Windows.Forms.DataVisualization.Charting.Legend();
    49       System.Windows.Forms.DataVisualization.Charting.Series defaultSeries = new System.Windows.Forms.DataVisualization.Charting.Series();
    50       System.Windows.Forms.DataVisualization.Charting.Title defaultTitle = new System.Windows.Forms.DataVisualization.Charting.Title();
     47      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     48      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
     49      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
     50      System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
    5151      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    5252      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     
    5858      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5959      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    60       this.nameTextBox.Size = new System.Drawing.Size(287, 20);
     60      this.nameTextBox.Location = new System.Drawing.Point(55, 0);
     61      this.nameTextBox.Size = new System.Drawing.Size(279, 20);
    6162      //
    62       // descriptionTextBox
     63      // infoLabel
    6364      //
    64       this.descriptionTextBox.Size = new System.Drawing.Size(287, 20);
     65      this.infoLabel.Location = new System.Drawing.Point(340, 3);
    6566      //
    6667      // chart
     
    7172      this.chart.BorderlineColor = System.Drawing.Color.Black;
    7273      this.chart.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
    73       defaultChartArea.AxisX.Minimum = 0;
    74       defaultChartArea.CursorX.IsUserEnabled = true;
    75       defaultChartArea.CursorX.IsUserSelectionEnabled = true;
    76       defaultChartArea.CursorY.IsUserEnabled = true;
    77       defaultChartArea.CursorY.IsUserSelectionEnabled = true;
    78       defaultChartArea.Name = "Default";
    79       this.chart.ChartAreas.Add(defaultChartArea);
    80       defaultLegend.Alignment = System.Drawing.StringAlignment.Center;
    81       defaultLegend.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
    82       defaultLegend.Name = "Default";
    83       this.chart.Legends.Add(defaultLegend);
    84       this.chart.Location = new System.Drawing.Point(0, 52);
     74      chartArea1.AxisX.Minimum = 0D;
     75      chartArea1.CursorX.IsUserEnabled = true;
     76      chartArea1.CursorX.IsUserSelectionEnabled = true;
     77      chartArea1.CursorY.IsUserEnabled = true;
     78      chartArea1.CursorY.IsUserSelectionEnabled = true;
     79      chartArea1.Name = "Default";
     80      this.chart.ChartAreas.Add(chartArea1);
     81      legend1.Alignment = System.Drawing.StringAlignment.Center;
     82      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
     83      legend1.Name = "Default";
     84      this.chart.Legends.Add(legend1);
     85      this.chart.Location = new System.Drawing.Point(0, 26);
    8586      this.chart.Name = "chart";
    86       defaultSeries.ChartArea = "Default";
    87       defaultSeries.Legend = "Default";
    88       defaultSeries.Name = "Default";
    89       this.chart.Series.Add(defaultSeries);
    90       this.chart.Size = new System.Drawing.Size(359, 222);
    91       this.chart.TabIndex = 4;
     87      series1.ChartArea = "Default";
     88      series1.Legend = "Default";
     89      series1.Name = "Default";
     90      this.chart.Series.Add(series1);
     91      this.chart.Size = new System.Drawing.Size(359, 248);
     92      this.chart.TabIndex = 3;
    9293      this.chart.Text = "chart";
    93       defaultTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    94       defaultTitle.Name = "Default";
    95       defaultTitle.Text = "Title";
    96       this.chart.Titles.Add(defaultTitle);
     94      title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     95      title1.Name = "Default";
     96      title1.Text = "Title";
     97      this.chart.Titles.Add(title1);
    9798      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
    9899      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
     
    106107      this.Name = "DataTableView";
    107108      this.Size = new System.Drawing.Size(359, 274);
     109      this.Controls.SetChildIndex(this.infoLabel, 0);
    108110      this.Controls.SetChildIndex(this.chart, 0);
    109111      this.Controls.SetChildIndex(this.nameLabel, 0);
    110       this.Controls.SetChildIndex(this.descriptionLabel, 0);
    111112      this.Controls.SetChildIndex(this.nameTextBox, 0);
    112       this.Controls.SetChildIndex(this.descriptionTextBox, 0);
    113113      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    114114      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
  • branches/QAP/HeuristicLab.Encodings.PermutationEncoding/3.3/HeuristicLab.Encodings.PermutationEncoding-3.3.csproj

    r5785 r5838  
    168168    <Compile Include="Moves\PermutationMoveAttribute.cs" />
    169169    <Compile Include="Moves\StandardEdgeEqualityComparer.cs" />
    170     <Compile Include="Moves\Swap\SwapMoveSoftTabuCriterion.cs" />
    171     <Compile Include="Moves\Swap\ExhaustiveSwapMoveGenerator.cs" />
    172     <Compile Include="Moves\Swap\StochasticSwapSingleMoveGenerator.cs" />
    173     <Compile Include="Moves\Swap\SwapMoveAbsoluteAttribute.cs" />
    174     <Compile Include="Moves\Swap\SwapMoveHardTabuCriterion.cs" />
    175     <Compile Include="Moves\Swap\SwapMoveMaker.cs" />
    176     <Compile Include="Moves\Swap\SwapMoveRelativeAttribute.cs" />
    177     <Compile Include="Moves\Swap\SwapMoveTabuMaker.cs" />
    178     <Compile Include="Moves\Swap\StochasticSwapMultiMoveGenerator.cs" />
    179     <Compile Include="Moves\Swap\SwapMoveGenerator.cs" />
    180     <Compile Include="Moves\Swap\SwapMove.cs" />
     170    <Compile Include="Moves\Swap2\ExhaustiveSwap2MoveGenerator.cs" />
     171    <Compile Include="Moves\Swap2\StochasticSwap2MultiMoveGenerator.cs" />
     172    <Compile Include="Moves\Swap2\StochasticSwap2SingleMoveGenerator.cs" />
     173    <Compile Include="Moves\Swap2\Swap2Move.cs" />
     174    <Compile Include="Moves\Swap2\Swap2MoveAbsoluteAttribute.cs" />
     175    <Compile Include="Moves\Swap2\Swap2MoveGenerator.cs" />
     176    <Compile Include="Moves\Swap2\Swap2MoveHardTabuCriterion.cs" />
     177    <Compile Include="Moves\Swap2\Swap2MoveMaker.cs" />
     178    <Compile Include="Moves\Swap2\Swap2MoveRelativeAttribute.cs" />
     179    <Compile Include="Moves\Swap2\Swap2MoveSoftTabuCriterion.cs" />
     180    <Compile Include="Moves\Swap2\Swap2MoveTabuMaker.cs" />
    181181    <Compile Include="Moves\ThreeIndexMove.cs" />
    182182    <Compile Include="Moves\ThreeOpt\StochasticSingleInsertionMoveGenerator.cs" />
  • branches/QAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Interfaces/IPermutationSwapMoveOperator.cs

    r5785 r5838  
    2323
    2424namespace HeuristicLab.Encodings.PermutationEncoding {
    25   public interface IPermutationSwapMoveOperator : IPermutationMoveOperator {
    26     ILookupParameter<SwapMove> SwapMoveParameter { get; }
     25  public interface IPermutationSwap2MoveOperator : IPermutationMoveOperator {
     26    ILookupParameter<Swap2Move> Swap2MoveParameter { get; }
    2727  }
    2828}
  • branches/QAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeIndexMove.cs

    r5445 r5838  
    2525
    2626namespace HeuristicLab.Encodings.PermutationEncoding {
    27   [Item("ThreeIndexMove", "A move on a permutation that is specified by 3 indices")]
     27  [Item("ThreeIndexMove", "A move on a permutation that is specified by 3 indices.")]
    2828  [StorableClass]
    2929  public class ThreeIndexMove : Item {
  • branches/QAP/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoIndexMove.cs

    r5445 r5838  
    2525
    2626namespace HeuristicLab.Encodings.PermutationEncoding {
    27   [Item("TwoIndexMove", "A move on a permutation that is specified by 2 indices")]
     27  [Item("TwoIndexMove", "A move on a permutation that is specified by 2 indices.")]
    2828  [StorableClass]
    2929  public class TwoIndexMove : Item {
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.Designer.cs

    r5641 r5838  
    7575      this.nameLabel.Location = new System.Drawing.Point(3, 32);
    7676      //
    77       // descriptionLabel
    78       //
    79       this.descriptionLabel.Location = new System.Drawing.Point(3, 58);
    80       //
    81       // descriptionTextBox
    82       //
    83       this.descriptionTextBox.Location = new System.Drawing.Point(86, 55);
    84       this.descriptionTextBox.Size = new System.Drawing.Size(561, 20);
    85       //
    8677      // importInstanceButton
    8778      //
     
    147138      this.tabControl.Controls.Add(this.problemTabPage);
    148139      this.tabControl.Controls.Add(this.visualizationTabPage);
    149       this.tabControl.Location = new System.Drawing.Point(0, 81);
     140      this.tabControl.Location = new System.Drawing.Point(0, 55);
    150141      this.tabControl.Name = "tabControl";
    151142      this.tabControl.SelectedIndex = 0;
    152       this.tabControl.Size = new System.Drawing.Size(647, 411);
     143      this.tabControl.Size = new System.Drawing.Size(647, 437);
    153144      this.tabControl.TabIndex = 8;
    154145      //
     
    158149      this.problemTabPage.Name = "problemTabPage";
    159150      this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);
    160       this.problemTabPage.Size = new System.Drawing.Size(639, 385);
     151      this.problemTabPage.Size = new System.Drawing.Size(639, 411);
    161152      this.problemTabPage.TabIndex = 0;
    162153      this.problemTabPage.Text = "Problem";
     
    196187      this.Name = "QuadraticAssignmentProblemView";
    197188      this.Size = new System.Drawing.Size(647, 492);
     189      this.Controls.SetChildIndex(this.infoLabel, 0);
    198190      this.Controls.SetChildIndex(this.parameterCollectionView, 0);
    199       this.Controls.SetChildIndex(this.descriptionLabel, 0);
    200191      this.Controls.SetChildIndex(this.nameLabel, 0);
    201192      this.Controls.SetChildIndex(this.nameTextBox, 0);
    202193      this.Controls.SetChildIndex(this.QAPLIBInstancesLabel, 0);
    203       this.Controls.SetChildIndex(this.descriptionTextBox, 0);
    204194      this.Controls.SetChildIndex(this.loadInstanceButton, 0);
    205195      this.Controls.SetChildIndex(this.importInstanceButton, 0);
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs

    r5641 r5838  
    4646    protected override void RegisterContentEvents() {
    4747      base.RegisterContentEvents();
    48       Content.DistanceMatrixParameter.ValueChanged += new EventHandler(DistanceMatrixParameter_ValueChanged);
     48      Content.DistancesParameter.ValueChanged += new EventHandler(DistanceMatrixParameter_ValueChanged);
    4949      Content.WeightsParameter.ValueChanged += new EventHandler(WeightsParameter_ValueChanged);
    5050      Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
     
    5252
    5353    protected override void DeregisterContentEvents() {
    54       Content.DistanceMatrixParameter.ValueChanged -= new EventHandler(DistanceMatrixParameter_ValueChanged);
     54      Content.DistancesParameter.ValueChanged -= new EventHandler(DistanceMatrixParameter_ValueChanged);
    5555      Content.WeightsParameter.ValueChanged -= new EventHandler(WeightsParameter_ValueChanged);
    5656      Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged);
     
    5959
    6060    private void DistanceMatrixParameter_ValueChanged(object sender, System.EventArgs e) {
    61       qapView.Distances = Content.DistanceMatrix;
     61      qapView.Distances = Content.Distances;
    6262    }
    6363
     
    7777          instancesComboBox.Items.Add(instance);
    7878        }
    79         qapView.Distances = Content.DistanceMatrix;
     79        qapView.Distances = Content.Distances;
    8080        qapView.Weights = Content.Weights;
    8181        qapView.Assignment = Content.BestKnownSolution;
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/BestQAPSolutionAnalyzer.cs

    r5583 r5838  
    8989
    9090    public override IOperation Apply() {
    91       DoubleMatrix coordinates = CoordinatesParameter.ActualValue;
    9291      DoubleMatrix distances = DistancesParameter.ActualValue;
    9392      DoubleMatrix weights = WeightsParameter.ActualValue;
     
    113112      if (assignment == null) {
    114113        assignment = new QAPAssignment(weights, (Permutation)permutations[i].Clone(), new DoubleValue(qualities[i].Value));
    115         assignment.Coordinates = coordinates;
    116114        assignment.Distances = distances;
    117115        BestSolutionParameter.ActualValue = assignment;
     
    120118        if (max && assignment.Quality.Value < qualities[i].Value ||
    121119          !max && assignment.Quality.Value > qualities[i].Value) {
    122           assignment.Coordinates = coordinates;
    123120          assignment.Distances = distances;
    124121          assignment.Weights = weights;
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPEvaluator.cs

    r5598 r5838  
    3535      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    3636    }
    37     public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
    38       get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; }
    39     }
    40     public ILookupParameter<DoubleMatrix> CoordinatesParameter {
    41       get { return (ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     37    public ILookupParameter<DoubleMatrix> DistancesParameter {
     38      get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; }
    4239    }
    4340    public ILookupParameter<DoubleMatrix> WeightsParameter {
     
    5350    public QAPEvaluator() {
    5451      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that represents the current solution."));
    55       Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The distance matrix that contains the distances between the locations."));
    56       Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates in case the distance matrix should not be used."));
     52      Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distance matrix that contains the distances between the locations."));
    5753      Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The matrix with the weights between the facilities, that is how strongly they're connected to each other."));
    5854      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value aka fitness value of the solution."));
     
    7672      Permutation assignment = PermutationParameter.ActualValue;
    7773      DoubleMatrix weights = WeightsParameter.ActualValue;
    78       DoubleMatrix distanceMatrix = DistanceMatrixParameter.ActualValue;
     74      DoubleMatrix distanceMatrix = DistancesParameter.ActualValue;
    7975
    8076      double quality = Apply(assignment, weights, distanceMatrix);
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPInversionMoveEvaluator.cs

    r5785 r5838  
    7373      if (move == null) throw new InvalidOperationException("Inversion move is not found.");
    7474      Permutation assignment = PermutationParameter.ActualValue;
    75       DoubleMatrix distances = DistanceMatrixParameter.ActualValue;
     75      DoubleMatrix distances = DistancesParameter.ActualValue;
    7676      DoubleMatrix weights = WeightsParameter.ActualValue;
    7777
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPMoveEvaluator.cs

    r5785 r5838  
    4949      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
    5050    }
    51     public ILookupParameter<DoubleMatrix> DistanceMatrixParameter {
    52       get { return (ILookupParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; }
     51    public ILookupParameter<DoubleMatrix> DistancesParameter {
     52      get { return (ILookupParameter<DoubleMatrix>)Parameters["Distances"]; }
    5353    }
    5454    public ILookupParameter<DoubleMatrix> WeightsParameter {
     
    6464      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The evaluated quality of a move on a QAP solution."));
    6565      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation."));
    66       Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the facilities."));
     66      Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The matrix which contains the distances between the facilities."));
    6767      Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The matrix with the weights between the facilities, that is how strongly they're connected to each other."));
    6868    }
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPSwapMoveEvaluator.cs

    r5785 r5838  
    2929
    3030namespace HeuristicLab.Problems.QuadraticAssignment {
    31   [Item("QAPSwapMoveEvaluator", "Evaluated a swap move on a QAP solution.")]
     31  [Item("QAPSwap2MoveEvaluator", "Evaluated a swap-2 move on a QAP solution.")]
    3232  [StorableClass]
    33   public class QAPSwapMoveEvaluator : QAPMoveEvaluator, IPermutationSwapMoveOperator {
    34     public ILookupParameter<SwapMove> SwapMoveParameter {
    35       get { return (ILookupParameter<SwapMove>)Parameters["SwapMove"]; }
     33  public class QAPSwap2MoveEvaluator : QAPMoveEvaluator, IPermutationSwap2MoveOperator {
     34    public ILookupParameter<Swap2Move> Swap2MoveParameter {
     35      get { return (ILookupParameter<Swap2Move>)Parameters["Swap2Move"]; }
    3636    }
    3737
    3838    [StorableConstructor]
    39     protected QAPSwapMoveEvaluator(bool deserializing) : base(deserializing) { }
    40     protected QAPSwapMoveEvaluator(QAPSwapMoveEvaluator original, Cloner cloner)
     39    protected QAPSwap2MoveEvaluator(bool deserializing) : base(deserializing) { }
     40    protected QAPSwap2MoveEvaluator(QAPSwap2MoveEvaluator original, Cloner cloner)
    4141      : base(original, cloner) {
    4242    }
    43     public QAPSwapMoveEvaluator() {
    44       Parameters.Add(new LookupParameter<SwapMove>("SwapMove", "The move to evaluate."));
     43    public QAPSwap2MoveEvaluator() {
     44      Parameters.Add(new LookupParameter<Swap2Move>("Swap2Move", "The move to evaluate."));
    4545    }
    4646
    4747    public override IDeepCloneable Clone(Cloner cloner) {
    48       return new QAPSwapMoveEvaluator(this, cloner);
     48      return new QAPSwap2MoveEvaluator(this, cloner);
    4949    }
    5050
    51     public static double Apply(Permutation assignment, SwapMove move, DoubleMatrix weights, DoubleMatrix distances) {
     51    public static double Apply(Permutation assignment, Swap2Move move, DoubleMatrix weights, DoubleMatrix distances) {
    5252      if (move.Index1 == move.Index2) return 0;
    5353      double moveQuality = 0;
     
    7070
    7171    public override IOperation Apply() {
    72       SwapMove move = SwapMoveParameter.ActualValue;
    73       if (move == null) throw new InvalidOperationException("Swap move is not found.");
     72      Swap2Move move = Swap2MoveParameter.ActualValue;
     73      if (move == null) throw new InvalidOperationException("Swap-2 move is not found.");
    7474      Permutation assignment = PermutationParameter.ActualValue;
    75       DoubleMatrix distances = DistanceMatrixParameter.ActualValue;
     75      DoubleMatrix distances = DistancesParameter.ActualValue;
    7676      DoubleMatrix weights = WeightsParameter.ActualValue;
    7777
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPTranslocationMoveEvaluator.cs

    r5801 r5838  
    8585      if (move == null) throw new InvalidOperationException("Translocation move is not found.");
    8686      Permutation assignment = PermutationParameter.ActualValue;
    87       DoubleMatrix distances = DistanceMatrixParameter.ActualValue;
     87      DoubleMatrix distances = DistancesParameter.ActualValue;
    8888      DoubleMatrix weights = WeightsParameter.ActualValue;
    8989
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Interfaces/IQAPEvaluator.cs

    r5598 r5838  
    2828  public interface IQAPEvaluator : ISingleObjectiveEvaluator {
    2929    ILookupParameter<Permutation> PermutationParameter { get; }
    30     ILookupParameter<DoubleMatrix> DistanceMatrixParameter { get; }
    31     ILookupParameter<DoubleMatrix> CoordinatesParameter { get; }
     30    ILookupParameter<DoubleMatrix> DistancesParameter { get; }
    3231    ILookupParameter<DoubleMatrix> WeightsParameter { get; }
    3332  }
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Interfaces/IQAPMoveEvaluator.cs

    r5785 r5838  
    2828  public interface IQAPMoveEvaluator : ISingleObjectiveMoveEvaluator, IMoveOperator {
    2929    ILookupParameter<Permutation> PermutationParameter { get; }
    30     ILookupParameter<DoubleMatrix> DistanceMatrixParameter { get; }
     30    ILookupParameter<DoubleMatrix> DistancesParameter { get; }
    3131    ILookupParameter<DoubleMatrix> WeightsParameter { get; }
    3232  }
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Parsers/QAPLIBParser.cs

    r5648 r5838  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.IO;
    324
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Parsers/QAPLIBSolutionParser.cs

    r5814 r5838  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Globalization;
    324using System.IO;
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Plugin.cs.frame

    r5563 r5838  
    2525  [Plugin("HeuristicLab.Problems.QuadraticAssignment", "3.3.3.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Problems.QuadraticAssignment-3.3.dll", PluginFileType.Assembly)]
    27   [PluginDependency("HeuristicLab.Collections", "3.3.3")]
    28   [PluginDependency("HeuristicLab.Common", "3.3.3")]
    29   [PluginDependency("HeuristicLab.Common.Resources", "3.3.3")]
    30   [PluginDependency("HeuristicLab.Core", "3.3.3")]
    31   [PluginDependency("HeuristicLab.Data", "3.3.3")]
    32   [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3.3")]
    33   [PluginDependency("HeuristicLab.Operators", "3.3.3")]
    34   [PluginDependency("HeuristicLab.Optimization", "3.3.3")]
    35   [PluginDependency("HeuristicLab.Parameters", "3.3.3")]
    36   [PluginDependency("HeuristicLab.Persistence", "3.3.3")]
     27  [PluginDependency("HeuristicLab.Collections", "3.3")]
     28  [PluginDependency("HeuristicLab.Common", "3.3")]
     29  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
     30  [PluginDependency("HeuristicLab.Core", "3.3")]
     31  [PluginDependency("HeuristicLab.Data", "3.3")]
     32  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
     33  [PluginDependency("HeuristicLab.Operators", "3.3")]
     34  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     35  [PluginDependency("HeuristicLab.Parameters", "3.3")]
     36  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    3737  public class HeuristicLabProblemsQuadraticAssignmentPlugin : PluginBase { }
    3838}
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPAssignment.cs

    r5648 r5838  
    1010  [StorableClass]
    1111  public sealed class QAPAssignment : Item, INotifyPropertyChanged {
    12     [Storable]
    13     private DoubleMatrix coordinates;
    14     public DoubleMatrix Coordinates {
    15       get { return coordinates; }
    16       set {
    17         bool changed = (coordinates != value);
    18         coordinates = value;
    19         if (changed) OnPropertyChanged("Coordinates");
    20       }
    21     }
    2212
    2313    [Storable]
     
    6959    private QAPAssignment(QAPAssignment original, Cloner cloner)
    7060      : base(original, cloner) {
    71       coordinates = cloner.Clone(original.coordinates);
    7261      distances = cloner.Clone(original.distances);
    7362      weights = cloner.Clone(original.weights);
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs

    r5814 r5838  
    3636
    3737namespace HeuristicLab.Problems.QuadraticAssignment {
    38   [Item("Quadratic Assignment Problem", "The Quadratic Assignment Problem (QAP) is the problem of assigning N facilities to N fixed locations such that there is exactly one facility in each location and that the distances multiplied by the connection strength between the facilities becomes minimal.")]
     38  [Item("Quadratic Assignment Problem", "The Quadratic Assignment Problem (QAP) can be described as the problem of assigning N facilities to N fixed locations such that there is exactly one facility in each location and that the sum of the distances multiplied by the connection strength between the facilities becomes minimal.")]
    3939  [Creatable("Problems")]
    4040  [StorableClass]
     
    5656      get { return (IValueParameter<DoubleMatrix>)Parameters["Weights"]; }
    5757    }
    58     public IValueParameter<DoubleMatrix> DistanceMatrixParameter {
    59       get { return (IValueParameter<DoubleMatrix>)Parameters["DistanceMatrix"]; }
     58    public IValueParameter<DoubleMatrix> DistancesParameter {
     59      get { return (IValueParameter<DoubleMatrix>)Parameters["Distances"]; }
    6060    }
    6161    #endregion
     
    7474      set { WeightsParameter.Value = value; }
    7575    }
    76     public DoubleMatrix DistanceMatrix {
    77       get { return DistanceMatrixParameter.Value; }
    78       set { DistanceMatrixParameter.Value = value; }
     76    public DoubleMatrix Distances {
     77      get { return DistancesParameter.Value; }
     78      set { DistancesParameter.Value = value; }
    7979    }
    8080
     
    106106      Parameters.Add(new ValueParameter<DoubleMatrix>("Coordinates", "The coordinates of the locations. If this is changed the distance matrix is calculated automatically using the euclidean distance."));
    107107      Parameters.Add(new ValueParameter<DoubleMatrix>("Weights", "The strength of the connection between the facilities.", new DoubleMatrix(5, 5)));
    108       Parameters.Add(new ValueParameter<DoubleMatrix>("DistanceMatrix", "The distance matrix which can either be specified directly without the coordinates, or can be calculated automatically from the coordinates.", new DoubleMatrix(5, 5)));
     108      Parameters.Add(new ValueParameter<DoubleMatrix>("Distances", "The distance matrix which can either be specified directly without the coordinates, or can be calculated automatically from the coordinates.", new DoubleMatrix(5, 5)));
    109109
    110110      Maximization = new BoolValue(false);
     
    126126      });
    127127
    128       DistanceMatrix = new DoubleMatrix(new double[,] {
     128      Distances = new DoubleMatrix(new double[,] {
    129129        {   0, 360, 582, 582, 360 },
    130130        { 360,   0, 360, 582, 582 },
     
    231231      if (Evaluator != null) {
    232232        Evaluator.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
    233         Evaluator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
    234         Evaluator.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
     233        Evaluator.DistancesParameter.ActualName = DistancesParameter.Name;
    235234        Evaluator.WeightsParameter.ActualName = WeightsParameter.Name;
    236235      }
     
    240239        BestQAPSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    241240        BestQAPSolutionAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
    242         BestQAPSolutionAnalyzer.DistancesParameter.ActualName = DistanceMatrixParameter.Name;
     241        BestQAPSolutionAnalyzer.DistancesParameter.ActualName = DistancesParameter.Name;
    243242        BestQAPSolutionAnalyzer.WeightsParameter.ActualName = WeightsParameter.Name;
    244243        BestQAPSolutionAnalyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
     
    267266        foreach (IPermutationTranslocationMoveOperator op in Operators.OfType<IPermutationTranslocationMoveOperator>())
    268267          op.TranslocationMoveParameter.ActualName = translocationMove;
    269         string swapMove = Operators.OfType<IMoveGenerator>().OfType<IPermutationSwapMoveOperator>().First().SwapMoveParameter.ActualName;
    270         foreach (IPermutationSwapMoveOperator op in Operators.OfType<IPermutationSwapMoveOperator>()) {
    271           op.SwapMoveParameter.ActualName = swapMove;
     268        string swapMove = Operators.OfType<IMoveGenerator>().OfType<IPermutationSwap2MoveOperator>().First().Swap2MoveParameter.ActualName;
     269        foreach (IPermutationSwap2MoveOperator op in Operators.OfType<IPermutationSwap2MoveOperator>()) {
     270          op.Swap2MoveParameter.ActualName = swapMove;
    272271        }
    273272      }
     
    282281            double dy = Coordinates[i, 1] - Coordinates[j, 1];
    283282            distance[i, j] = Math.Sqrt(dx * dx + dy * dy);
    284             distance[j, i] = DistanceMatrix[i, j];
     283            distance[j, i] = Distances[i, j];
    285284          }
    286285        }
    287         DistanceMatrix = distance;
     286        Distances = distance;
    288287      }
    289288    }
     
    295294      if (parser.Error != null) throw parser.Error;
    296295      Coordinates = new DoubleMatrix();
    297       DistanceMatrix = new DoubleMatrix(parser.Distances);
     296      Distances = new DoubleMatrix(parser.Distances);
    298297      Weights = new DoubleMatrix(parser.Weights);
    299298      Name = "Quadratic Assignment Problem (imported from " + Path.GetFileNameWithoutExtension(filename) + ")";
     
    311310        if (parser.Error != null) throw parser.Error;
    312311        Coordinates = new DoubleMatrix();
    313         DistanceMatrix = new DoubleMatrix(parser.Distances);
     312        Distances = new DoubleMatrix(parser.Distances);
    314313        Weights = new DoubleMatrix(parser.Weights);
    315314        Name = "Quadratic Assignment Problem (loaded instance " + instance + ")";
     
    327326          solParser.Parse(solStream, false); // most sln's seem to be of the type index = location => value = facility
    328327          if (solParser.Error != null) throw solParser.Error;
    329           if (!solParser.Quality.IsAlmost(QAPEvaluator.Apply(new Permutation(PermutationTypes.Absolute, solParser.Assignment), Weights, DistanceMatrix))) {
     328          if (!solParser.Quality.IsAlmost(QAPEvaluator.Apply(new Permutation(PermutationTypes.Absolute, solParser.Assignment), Weights, Distances))) {
    330329            solStream.Seek(0, SeekOrigin.Begin);
    331330            solParser.Parse(solStream, true); // some sln's seem to be of the type index = facility => value = location
    332331            if (solParser.Error != null) throw solParser.Error;
    333             if (solParser.Quality.IsAlmost(QAPEvaluator.Apply(new Permutation(PermutationTypes.Absolute, solParser.Assignment), Weights, DistanceMatrix))) {
     332            if (solParser.Quality.IsAlmost(QAPEvaluator.Apply(new Permutation(PermutationTypes.Absolute, solParser.Assignment), Weights, Distances))) {
    334333              BestKnownQuality = new DoubleValue(solParser.Quality);
    335334              BestKnownSolution = new Permutation(PermutationTypes.Absolute, solParser.Assignment);
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Tests/QAPLIBInstancesTest.cs

    r5814 r5838  
    3535          double quality = double.NaN;
    3636          try {
    37             quality = QAPEvaluator.Apply(qap.BestKnownSolution, qap.Weights, qap.DistanceMatrix);
     37            quality = QAPEvaluator.Apply(qap.BestKnownSolution, qap.Weights, qap.Distances);
    3838          } catch (Exception ex) {
    3939            failedInstances.AppendLine("An unknown problem occurred evaluating solution of instance " + instance + ": " + ex.Message);
  • branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Tests/QAPMoveEvaluatorTest.cs

    r5801 r5838  
    9797        double after = QAPEvaluator.Apply(assignment, weights, distances);
    9898        // evaluate swap back
    99         double move = QAPSwapMoveEvaluator.Apply(assignment, new SwapMove(index1, index2, assignment), weights, distances);
     99        double move = QAPSwap2MoveEvaluator.Apply(assignment, new Swap2Move(index1, index2, assignment), weights, distances);
    100100        Assert.IsTrue(move.IsAlmost(before - after));
    101101      }
Note: See TracChangeset for help on using the changeset viewer.