Changeset 7437


Ignore:
Timestamp:
02/01/12 00:14:00 (9 years ago)
Author:
abeham
Message:

#1614

  • Allowed to view the solution of a certain point in the pareto chart
  • Added multi crossovers and manipulators
  • Added population diversity analyzer
  • Fixed a few bugs
Location:
branches/GeneralizedQAP
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentArchiveView.Designer.cs

    r7418 r7437  
    5656      chartArea1.AxisX.Title = "FlowDistanceQuality";
    5757      chartArea1.AxisY.Title = "InstallationQuality";
     58      chartArea1.CursorX.IsUserEnabled = true;
     59      chartArea1.CursorX.IsUserSelectionEnabled = true;
     60      chartArea1.CursorY.IsUserEnabled = true;
     61      chartArea1.CursorY.IsUserSelectionEnabled = true;
    5862      chartArea1.Name = "ChartArea1";
    5963      this.paretoFrontChart.ChartAreas.Add(chartArea1);
     
    7276      this.paretoFrontChart.TabIndex = 0;
    7377      this.paretoFrontChart.Text = "Pareto Front";
     78      this.paretoFrontChart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.paretoFrontChart_MouseDoubleClick);
    7479      //
    7580      // messageLabel
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentArchiveView.cs

    r7418 r7437  
    2222using System;
    2323using System.ComponentModel;
     24using System.Linq;
    2425using System.Windows.Forms;
     26using System.Windows.Forms.DataVisualization.Charting;
    2527using HeuristicLab.Collections;
    2628using HeuristicLab.Core.Views;
     
    8385          if (Content == null) return;
    8486          foreach (var solution in Content.Solutions) {
    85             if (solution.OverbookedCapacity.Value <= 0.0)
     87            if (solution.OverbookedCapacity.Value <= 0.0) {
    8688              paretoFrontChart.Series[0].Points.AddXY(solution.FlowDistanceQuality.Value, solution.InstallationQuality.Value);
     89              paretoFrontChart.Series[0].Points.Last().Tag = solution;
     90            }
    8791          }
    8892        } finally {
     
    9296      }
    9397    }
     98
     99    private void paretoFrontChart_MouseDoubleClick(object sender, MouseEventArgs e) {
     100      HitTestResult h = paretoFrontChart.HitTest(e.X, e.Y, ChartElementType.DataPoint);
     101      if (h.ChartElementType == ChartElementType.DataPoint) {
     102        var solution = (GQAPSolution)((DataPoint)h.Object).Tag;
     103        var assignment = new GQAPAssignment(solution.Assignment, solution.Quality, solution.FlowDistanceQuality, solution.InstallationQuality, solution.OverbookedCapacity, Content.EquipmentNames, Content.LocationNames, Content.Distances, Content.Weights, Content.InstallationCosts, Content.Demands, Content.Capacities, Content.TransportationCosts, Content.OverbookedCapacityPenalty);
     104
     105        var view = MainFormManager.MainForm.ShowContent(assignment);
     106        if (view != null) {
     107          view.ReadOnly = this.ReadOnly;
     108          view.Locked = this.Locked;
     109        }
     110      }
     111    }
    94112  }
    95113}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/BestGQAPSolutionAnalyzer.cs

    r7432 r7437  
    165165      GQAPAssignment assignment = BestSolutionParameter.ActualValue;
    166166      if (assignment == null) {
    167         assignment = new GQAPAssignment((IntegerVector)assignments[bestIndex].Clone(), (DoubleValue)qualities[bestIndex].Clone(), flowDistanceQualities[bestIndex], overbookedCapacities[bestIndex], installationQualities[bestIndex], equipmentNames, locationNames, distances, weights, installationCosts, demands, capacities, transportationCosts, overbookedCapacityPenalty);
     167        assignment = new GQAPAssignment((IntegerVector)assignments[bestIndex].Clone(), (DoubleValue)qualities[bestIndex].Clone(), flowDistanceQualities[bestIndex], installationQualities[bestIndex], overbookedCapacities[bestIndex], equipmentNames, locationNames, distances, weights, installationCosts, demands, capacities, transportationCosts, overbookedCapacityPenalty);
    168168        assignment.Distances = distances;
    169169        BestSolutionParameter.ActualValue = assignment;
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/GQAPSolutionArchiveAnalyzer.cs

    r7423 r7437  
    178178            && front[i].InstallationQuality.Value > front[j].InstallationQuality.Value) {
    179179            front.RemoveAt(i);
    180             j = i + 1;
     180            j = i;
    181181          }
    182182        }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPAssignment.cs

    r7432 r7437  
    160160      this.solution = new GQAPSolution(assignment, quality, flowDistanceQuality, installationQuality, overbookedCapacity);
    161161    }
    162     public GQAPAssignment(IntegerVector assignment, DoubleValue quality, DoubleValue flowDistanceQuality, DoubleValue overbookedCapacity, DoubleValue installationQuality, StringArray equipmentNames, StringArray locationNames, DoubleMatrix distances, DoubleMatrix weights, DoubleMatrix installationCosts, DoubleArray demands, DoubleArray capacities, DoubleValue transportationCosts, DoubleValue overbookedCapacityPenalty)
     162    public GQAPAssignment(IntegerVector assignment, DoubleValue quality, DoubleValue flowDistanceQuality, DoubleValue installationQuality, DoubleValue overbookedCapacity, StringArray equipmentNames, StringArray locationNames, DoubleMatrix distances, DoubleMatrix weights, DoubleMatrix installationCosts, DoubleArray demands, DoubleArray capacities, DoubleValue transportationCosts, DoubleValue overbookedCapacityPenalty)
    163163      : this(assignment, quality, flowDistanceQuality, installationQuality, overbookedCapacity) {
     164      this.equipmentNames = equipmentNames;
     165      this.locationNames = locationNames;
    164166      this.distances = distances;
    165167      this.weights = weights;
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs

    r7432 r7437  
    229229
    230230    private void InitializeOperators() {
     231      Operators.Clear();
    231232      Operators.Add(new BestGQAPSolutionAnalyzer());
    232233      Operators.Add(new GQAPSolutionArchiveAnalyzer());
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj

    r7432 r7437  
    3838  </PropertyGroup>
    3939  <ItemGroup>
     40    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
     41      <SpecificVersion>False</SpecificVersion>
     42      <Private>False</Private>
     43    </Reference>
    4044    <Reference Include="HeuristicLab.Collections-3.3">
    4145      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     
    9094  <ItemGroup>
    9195    <Compile Include="Analyzers\BestGQAPSolutionAnalyzer.cs" />
     96    <Compile Include="Analyzers\GQAPPopulationDiversityAnalyzer.cs" />
    9297    <Compile Include="Analyzers\GQAPSolutionArchiveAnalyzer.cs" />
    9398    <Compile Include="Evaluators\GQAPNMoveEvaluator.cs" />
     
    98103    <Compile Include="GQAPAssignmentArchive.cs" />
    99104    <Compile Include="GQAPSolution.cs" />
     105    <Compile Include="Interfaces\IGQAPManipulator.cs" />
    100106    <Compile Include="Interfaces\IQualitiesAwareGQAPOperator.cs" />
    101107    <Compile Include="Interfaces\IAssignmentsAwareGQAPOperator.cs" />
     
    130136    <Compile Include="Moves\StochasticNMoveSingleMoveGenerator.cs" />
    131137    <Compile Include="Operators\ApproximateLocalSearch.cs" />
     138    <Compile Include="Operators\MultiGQAPCrossover.cs" />
    132139    <Compile Include="Operators\GQAPPathRelinking.cs" />
    133140    <Compile Include="Operators\GQAPStochasticSolutionCreator.cs" />
     
    137144    <Compile Include="Operators\GQAPSolutionCreator.cs" />
    138145    <Compile Include="Operators\GreedyRandomizedSolutionCreator.cs" />
     146    <Compile Include="Operators\MultiGQAPManipulator.cs" />
    139147    <Compile Include="Operators\NMoveShakingOperator.cs" />
    140148    <Compile Include="Operators\QualitySimilarityMerger.cs" />
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GQAPManipulator.cs

    r7419 r7437  
    3131  [Item("GQAPManipulator", "A base class for operators that manipulate assignment vectors of the GeneralizedQuadraticAssignment problems.")]
    3232  [StorableClass]
    33   public abstract class GQAPManipulator : SingleSuccessorOperator, IAssignmentAwareGQAPOperator, IManipulator, IStochasticOperator {
     33  public abstract class GQAPManipulator : SingleSuccessorOperator, IGQAPManipulator, IAssignmentAwareGQAPOperator, IStochasticOperator {
    3434    public override bool CanChangeName {
    3535      get { return false; }
Note: See TracChangeset for help on using the changeset viewer.