Changeset 7412


Ignore:
Timestamp:
01/25/12 18:32:44 (9 years ago)
Author:
abeham
Message:

#1614: worked on GQAP and GRASP+PR

Location:
branches/GeneralizedQAP
Files:
12 added
24 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP

    • Property svn:ignore
      •  

        old new  
        11*.suo
         2TestResults
  • branches/GeneralizedQAP/GeneralizedQAP.sln

    r7363 r7412  
    1010Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common-3.3", "HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common\3.3\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common-3.3.csproj", "{DA367BE5-4F53-4243-933B-32AAB86189D5}"
    1111EndProject
     12Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{68C6C157-08DA-414F-9256-CCCA13038399}"
     13EndProject
     14Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7275B9B0-0E8D-471E-9F64-067E1F85BB71}"
     15  ProjectSection(SolutionItems) = preProject
     16    GeneralizedQAP.vsmdi = GeneralizedQAP.vsmdi
     17    Local.testsettings = Local.testsettings
     18    TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
     19  EndProjectSection
     20EndProject
    1221Global
     22  GlobalSection(TestCaseManagementSettings) = postSolution
     23    CategoryFile = GeneralizedQAP.vsmdi
     24  EndGlobalSection
    1325  GlobalSection(SolutionConfigurationPlatforms) = preSolution
    1426    Debug|Any CPU = Debug|Any CPU
     
    5264    {DA367BE5-4F53-4243-933B-32AAB86189D5}.Release|x64.ActiveCfg = Release|Any CPU
    5365    {DA367BE5-4F53-4243-933B-32AAB86189D5}.Release|x86.ActiveCfg = Release|Any CPU
     66    {68C6C157-08DA-414F-9256-CCCA13038399}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     67    {68C6C157-08DA-414F-9256-CCCA13038399}.Debug|Any CPU.Build.0 = Debug|Any CPU
     68    {68C6C157-08DA-414F-9256-CCCA13038399}.Debug|x64.ActiveCfg = Debug|Any CPU
     69    {68C6C157-08DA-414F-9256-CCCA13038399}.Debug|x86.ActiveCfg = Debug|Any CPU
     70    {68C6C157-08DA-414F-9256-CCCA13038399}.Release|Any CPU.ActiveCfg = Release|Any CPU
     71    {68C6C157-08DA-414F-9256-CCCA13038399}.Release|Any CPU.Build.0 = Release|Any CPU
     72    {68C6C157-08DA-414F-9256-CCCA13038399}.Release|x64.ActiveCfg = Release|Any CPU
     73    {68C6C157-08DA-414F-9256-CCCA13038399}.Release|x86.ActiveCfg = Release|Any CPU
    5474  EndGlobalSection
    5575  GlobalSection(SolutionProperties) = preSolution
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/GRASPWithPathRelinking.cs

    r7363 r7412  
    6161      get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }
    6262    }
     63    public IValueParameter<IntValue> MaximumIterationsParameter {
     64      get { return (IValueParameter<IntValue>)Parameters["MaximumIterations"]; }
     65    }
    6366    private IFixedValueParameter<IntValue> EliteSetSizeParameter {
    6467      get { return (IFixedValueParameter<IntValue>)Parameters["EliteSetSize"]; }
     
    7679      get { return (ConstrainedValueParameter<ICrossover>)Parameters["PathRelinking"]; }
    7780    }
    78     public ConstrainedValueParameter<IMerger> EliteSetReplacerParameter {
     81    public ConstrainedValueParameter<IMerger> EliteSetMergerParameter {
    7982      get { return (ConstrainedValueParameter<IMerger>)Parameters["EliteSetMerger"]; }
    8083    }
     
    106109      get { return (RandomCreator)OperatorGraph.InitialOperator; }
    107110    }
    108     #endregion
     111    private GRASPWithPathRelinkingMainLoop MainLoop {
     112      get { return RandomCreator.Successor as GRASPWithPathRelinkingMainLoop; }
     113    }
     114    #endregion
     115
     116    [Storable]
     117    private BestAverageWorstQualityAnalyzer analyzer;
    109118
    110119    [StorableConstructor]
     
    112121    private GRASPWithPathRelinking(GRASPWithPathRelinking original, Cloner cloner)
    113122      : base(original, cloner) {
     123      analyzer = cloner.Clone(original.analyzer);
    114124      RegisterEventHandlers();
    115125    }
     
    119129      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator."));
    120130      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each iteration.", new MultiAnalyzer()));
     131      Parameters.Add(new ValueParameter<IntValue>("MaximumIterations", "The maximum number of iterations that the algorithm should run.", new IntValue(1000)));
    121132      Parameters.Add(new FixedValueParameter<IntValue>("EliteSetSize", "The elite set stores the best found solutions.", new IntValue(10)));
    122       Parameters.Add(new FixedValueParameter<IntValue>("LocalImprovementMaximumIterations", "The maximum number of iterations performed by the local improvement operator.", new IntValue(100)));
     133      Parameters.Add(new FixedValueParameter<IntValue>("LocalImprovementMaximumIterations", "The maximum number of iterations performed by the local improvement operator.", new IntValue(1000)));
    123134      Parameters.Add(new ConstrainedValueParameter<ILocalImprovementOperator>("LocalImprovement", "Performs a local search on the solution."));
    124       Parameters.Add(new FixedValueParameter<IntValue>("MinimumEliteSetSize", "(ρ) The minimum amount of elites for performing path relinking.", new IntValue(1)));
     135      Parameters.Add(new FixedValueParameter<IntValue>("MinimumEliteSetSize", "(ρ) The minimum amount of elites for performing path relinking.", new IntValue(2)));
    125136      Parameters.Add(new ConstrainedValueParameter<ICrossover>("PathRelinking", "The operator that performs the path relinking."));
    126137      Parameters.Add(new ConstrainedValueParameter<IMerger>("EliteSetMerger", "The operator that merges new solutions into the elite set."));
     138
     139      analyzer = new BestAverageWorstQualityAnalyzer();
     140      Analyzer.Operators.Add(analyzer);
    127141
    128142      RandomCreator randomCreator = new RandomCreator();
     
    136150
    137151      var mainLoop = new GRASPWithPathRelinkingMainLoop();
     152      mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name;
     153      mainLoop.EliteSetMergerParameter.ActualName = EliteSetMergerParameter.Name;
     154      mainLoop.EliteSetSizeParameter.ActualName = EliteSetSizeParameter.Name;
     155      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     156      mainLoop.LocalImprovementParameter.ActualName = LocalImprovementParameter.Name;
     157      mainLoop.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name;
     158      mainLoop.PathRelinkingParameter.ActualName = PathRelinkingParameter.Name;
     159      mainLoop.ResultsParameter.ActualName = "Results";
    138160      randomCreator.Successor = mainLoop;
    139161
     
    185207      Analyzer.Operators.Clear();
    186208      if (Problem != null) {
    187         foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) {
    188           foreach (var param in analyzer.Parameters.OfType<IScopeTreeLookupParameter>())
     209        foreach (IAnalyzer a in Problem.Operators.OfType<IAnalyzer>()) {
     210          foreach (var param in a.Parameters.OfType<IScopeTreeLookupParameter>())
    189211            param.Depth = 1;
    190           Analyzer.Operators.Add(analyzer);
     212          Analyzer.Operators.Add(a);
    191213        }
    192214        InitializeFromInstallation(LocalImprovementParameter, x => x.ProblemType.IsAssignableFrom(Problem.GetType()));
    193215        InitializeFromProblem(PathRelinkingParameter);
    194         InitializeFromProblem(EliteSetReplacerParameter);
     216        InitializeFromProblem(EliteSetMergerParameter);
    195217      } else {
    196218        LocalImprovementParameter.ValidValues.Clear();
    197219        PathRelinkingParameter.ValidValues.Clear();
    198         EliteSetReplacerParameter.ValidValues.Clear();
    199       }
     220        EliteSetMergerParameter.ValidValues.Clear();
     221      }
     222      Analyzer.Operators.Add(analyzer);
    200223
    201224      Parameterize();
     
    203226
    204227    private void Parameterize() {
     228      if (Problem != null) {
     229        MainLoop.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
     230        MainLoop.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     231
     232        analyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
     233      }
    205234      foreach (var localImprovement in LocalImprovementParameter.ValidValues) {
    206235        localImprovement.MaximumIterationsParameter.ActualName = LocalImprovementMaximumIterationsParameter.Name;
     
    210239          localImprovement.Problem = Problem;
    211240      }
     241      foreach (var merger in EliteSetMergerParameter.ValidValues) {
     242        merger.PopulationSizeParameter.ActualName = EliteSetSizeParameter.Name;
     243      }
    212244    }
    213245
    214246    private void InitializeFromProblem<T>(ConstrainedValueParameter<T> parameter) where T : class, INamedItem {
    215       InitializeFromProblem(parameter, x => true);
     247      InitializeFromProblem<T>(parameter, x => true);
    216248    }
    217249    private void InitializeFromProblem<T>(ConstrainedValueParameter<T> parameter, Func<T, bool> condition) where T : class, INamedItem {
     
    228260    }
    229261    private void InitializeFromInstallation<T>(ConstrainedValueParameter<T> parameter) where T : class, INamedItem {
    230       InitializeFromInstallation(parameter, x => true);
     262      InitializeFromInstallation<T>(parameter, x => true);
    231263    }
    232264    private void InitializeFromInstallation<T>(ConstrainedValueParameter<T> parameter, Func<T, bool> condition) where T : class, INamedItem {
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/GRASPWithPathRelinkingMainLoop.cs

    r7373 r7412  
    8989      variableCreator1.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
    9090
     91      var resultsCollector = new ResultsCollector();
     92      resultsCollector.CopyValue = new BoolValue(false);
     93      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
     94
    9195      var variableCreator2 = new VariableCreator();
    9296      variableCreator2.Name = "ActualEliteSetSize = 0";
     
    157161      placeholder2.OperatorParameter.ActualName = PathRelinkingParameter.Name;
    158162
     163      var placeholder3 = new Placeholder();
     164      placeholder3.Name = "(Evaluator)";
     165      placeholder3.OperatorParameter.ActualName = EvaluatorParameter.Name;
     166
    159167      var subScopesRemover = new SubScopesRemover();
    160168      subScopesRemover.RemoveAllSubScopes = true;
     
    162170      var ssp4 = new SubScopesProcessor();
    163171
    164       var placeholder3 = new Placeholder();
    165       placeholder3.Name = "(LocalImprovement)";
    166       placeholder3.OperatorParameter.ActualName = LocalImprovementParameter.Name;
    167 
    168172      var placeholder4 = new Placeholder();
    169       placeholder4.Name = "(EliteSetMerger)";
    170       placeholder4.OperatorParameter.ActualName = EliteSetMergerParameter.Name;
     173      placeholder4.Name = "(LocalImprovement)";
     174      placeholder4.OperatorParameter.ActualName = LocalImprovementParameter.Name;
     175
     176      var placeholder5 = new Placeholder();
     177      placeholder5.Name = "(EliteSetMerger)";
     178      placeholder5.OperatorParameter.ActualName = EliteSetMergerParameter.Name;
    171179
    172180      var counter = new IntCounter();
     
    191199
    192200      OperatorGraph.InitialOperator = variableCreator1;
    193       variableCreator1.Successor = variableCreator2;
     201      variableCreator1.Successor = resultsCollector;
     202      resultsCollector.Successor = variableCreator2;
    194203      variableCreator2.Successor = subScopesCounter1;
    195204      subScopesCounter1.Successor = comparator1;
     
    200209      ssp1.Operators.Add(eo1);
    201210      ssp1.Operators.Add(solutionsCreator);
    202       ssp1.Successor = placeholder4;
     211      ssp1.Successor = placeholder5;
    203212      eo1.Successor = null;
    204213      solutionsCreator.Successor = subScopesCounter2;
     
    216225      ssp3.Operators.Add(placeholder2);
    217226      ssp3.Successor = null;
    218       placeholder2.Successor = subScopesRemover;
     227      placeholder2.Successor = placeholder3;
     228      placeholder3.Successor = subScopesRemover;
    219229      subScopesRemover.Successor = null;
    220       ssp4.Operators.Add(placeholder3);
     230      ssp4.Operators.Add(placeholder4);
    221231      ssp4.Successor = null;
    222       placeholder4.Successor = counter;
     232      placeholder5.Successor = counter;
    223233      counter.Successor = analyzer1;
    224234      analyzer1.Successor = comparator3;
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common-3.3.csproj

    r7363 r7412  
    9090    <Compile Include="ExtensionMethods.cs" />
    9191    <Compile Include="IMerger.cs" />
     92    <Compile Include="IntegerVectorEqualityComparer.cs" />
    9293    <Compile Include="Plugin.cs" />
    9394    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common/3.3/IMerger.cs

    r7363 r7412  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2324
    2425namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common {
    2526  public interface IMerger : IOperator {
     27    ILookupParameter<IntValue> PopulationSizeParameter { get; }
    2628  }
    2729}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3

    • Property svn:ignore
      •  

        old new  
        22bin
        33obj
         4*.user
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.Designer.cs

    r7319 r7412  
    5656                  | System.Windows.Forms.AnchorStyles.Left)
    5757                  | System.Windows.Forms.AnchorStyles.Right)));
    58       this.assignmentTreeView.Location = new System.Drawing.Point(3, 52);
     58      this.assignmentTreeView.Location = new System.Drawing.Point(3, 50);
     59      this.assignmentTreeView.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
    5960      this.assignmentTreeView.Name = "assignmentTreeView";
    60       this.assignmentTreeView.Size = new System.Drawing.Size(349, 329);
    61       this.assignmentTreeView.TabIndex = 0;
     61      this.assignmentTreeView.Size = new System.Drawing.Size(349, 331);
     62      this.assignmentTreeView.TabIndex = 3;
    6263      //
    6364      // label1
     
    6768      this.label1.Name = "label1";
    6869      this.label1.Size = new System.Drawing.Size(42, 13);
    69       this.label1.TabIndex = 1;
     70      this.label1.TabIndex = 0;
    7071      this.label1.Text = "Quality:";
    7172      //
     
    7778      this.qualityTextBox.Name = "qualityTextBox";
    7879      this.qualityTextBox.Size = new System.Drawing.Size(301, 20);
    79       this.qualityTextBox.TabIndex = 2;
     80      this.qualityTextBox.TabIndex = 1;
    8081      //
    8182      // label2
    8283      //
    8384      this.label2.AutoSize = true;
    84       this.label2.Location = new System.Drawing.Point(3, 36);
     85      this.label2.Location = new System.Drawing.Point(3, 31);
    8586      this.label2.Name = "label2";
    8687      this.label2.Size = new System.Drawing.Size(64, 13);
    87       this.label2.TabIndex = 1;
     88      this.label2.TabIndex = 2;
    8889      this.label2.Text = "Assignment:";
    8990      //
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/GQAPAssignmentView.cs

    r7319 r7412  
    6666    protected override void SetEnabledStateOfControls() {
    6767      base.SetEnabledStateOfControls();
    68       qualityTextBox.Enabled = !ReadOnly && !Locked && Content != null;
    69       assignmentTreeView.Enabled = !ReadOnly && !Locked && Content != null;
     68      qualityTextBox.Enabled = false;
     69      assignmentTreeView.Enabled = true;
    7070    }
    7171
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views-3.3.csproj

    r7319 r7412  
    3838  </PropertyGroup>
    3939  <ItemGroup>
    40     <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    41     <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     40    <Reference Include="HeuristicLab.Common-3.3">
     41      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     42    </Reference>
     43    <Reference Include="HeuristicLab.Common.Resources-3.3">
     44      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3-3.3.dll</HintPath>
     45    </Reference>
    4246    <Reference Include="HeuristicLab.Core-3.3">
    4347      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     
    4953      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
    5054    </Reference>
    51     <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     55    <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3">
     56      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.IntegerVectorEncoding-3.3.dll</HintPath>
     57    </Reference>
    5258    <Reference Include="HeuristicLab.MainForm-3.3">
    5359      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
     
    5662      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
    5763    </Reference>
    58     <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    59     <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    60     <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    61     <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     64    <Reference Include="HeuristicLab.Operators-3.3">
     65      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     66    </Reference>
     67    <Reference Include="HeuristicLab.Optimization-3.3">
     68      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     69    </Reference>
     70    <Reference Include="HeuristicLab.Parameters-3.3">
     71      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     72    </Reference>
     73    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     74      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     75    </Reference>
    6276    <Reference Include="System" />
    6377    <Reference Include="System.Core" />
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/BestGQAPSolutionAnalyzer.cs

    r7319 r7412  
    9898
    9999    [StorableHook(HookType.AfterDeserialization)]
    100     private void AfterDeserializationHook() {
     100    private void AfterDeserialization() {
    101101      // BackwardsCompatibility3.3
    102102      #region Backwards compatible code, remove with 3.4
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators/GQAPEvaluator.cs

    r7407 r7412  
    3838      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    3939    }
    40     public ILookupParameter<DoubleValue> InfeasibilityParameter {
    41       get { return (ILookupParameter<DoubleValue>)Parameters["Infeasibility"]; }
     40    public ILookupParameter<DoubleValue> FlowDistanceQualityParameter {
     41      get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; }
    4242    }
    43     public IValueLookupParameter<DoubleValue> PenaltyParameter {
    44       get { return (IValueLookupParameter<DoubleValue>)Parameters["Penalty"]; }
     43    public ILookupParameter<DoubleValue> InstallationQualityParameter {
     44      get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; }
     45    }
     46    public ILookupParameter<DoubleValue> OverbookedCapacityParameter {
     47      get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; }
     48    }
     49    public IValueLookupParameter<DoubleValue> TransportationCostsParameter {
     50      get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
     51    }
     52    public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter {
     53      get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }
    4554    }
    4655    public ILookupParameter<DoubleMatrix> WeightsParameter {
     
    5261    public ILookupParameter<DoubleMatrix> InstallationCostsParameter {
    5362      get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }
    54     }
    55     public ILookupParameter<DoubleValue> TransportationCostsParameter {
    56       get { return (ILookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
    5763    }
    5864    public ILookupParameter<DoubleArray> DemandsParameter {
     
    7177    public GQAPEvaluator()
    7278      : base() {
    73       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality a.k.a. fitness of the solution."));
    74       Parameters.Add(new LookupParameter<DoubleValue>("Infeasibility", "The infeasibility describes the sum of the overbooked capacities."));
    75       Parameters.Add(new ValueLookupParameter<DoubleValue>("Penalty", "The multiplier for the constraint violation when added to the quality.", new DoubleValue(1000)));
     79      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution."));
     80      Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria."));
     81      Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs."));
     82      Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location."));
     83      Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights or distance matrix already."));
     84      Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality."));
    7685      Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The weights matrix describes the flows between the equipments."));
    7786      Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed."));
    7887      Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j"));
    79       Parameters.Add(new LookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights matrix already."));
    8088      Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments."));
    8189      Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));
     
    8795    }
    8896
    89     public static DoubleValue Evaluate(IntegerVector assignment, DoubleMatrix weights, DoubleMatrix distances,
    90       DoubleMatrix installCosts, double transportCosts, DoubleArray demands, DoubleArray capacities,
    91       out double infeasibility) {
    92       double quality = 0;
     97    public static double Evaluate(IntegerVector assignment, DoubleMatrix weights, DoubleMatrix distances,
     98                                  DoubleMatrix installCosts, DoubleArray demands, DoubleArray capacities,
     99                                  DoubleValue transportationCosts, DoubleValue overbookedCapacityPenalty) {
     100      double flowDistanceQuality, installationQuality, overbookedCapacity;
     101      Evaluate(assignment, weights, distances, installCosts, demands, capacities,
     102        out flowDistanceQuality, out installationQuality, out overbookedCapacity);
     103      return GetCombinedQuality(flowDistanceQuality, installationQuality, overbookedCapacity,
     104        transportationCosts.Value, overbookedCapacityPenalty.Value);
     105    }
     106
     107    public static void Evaluate(IntegerVector assignment, DoubleMatrix weights, DoubleMatrix distances,
     108                                DoubleMatrix installCosts, DoubleArray demands, DoubleArray capacities,
     109                                out double flowDistanceQuality, out double installationQuality, out double overbookedCapacity) {
     110      flowDistanceQuality = 0;
     111      installationQuality = 0;
    93112      int len = assignment.Length;
    94113      var slack = (DoubleArray)capacities.Clone();
    95114      for (int i = 0; i < len; i++) {
    96         quality += installCosts[i, assignment[i]];
     115        installationQuality += installCosts[i, assignment[i]];
    97116        for (int j = 0; j < len; j++) {
    98           quality += transportCosts * weights[i, j] * distances[assignment[i], assignment[j]];
     117          flowDistanceQuality += weights[i, j] * distances[assignment[i], assignment[j]];
    99118        }
    100119        slack[assignment[i]] -= demands[i];
    101120      }
     121      overbookedCapacity = slack.Select((v, i) => new { V = v, Index = i }).Where(x => x.V < 0.0).Select(x => -x.V / capacities[x.Index]).Sum();
     122    }
    102123
    103       infeasibility = -slack.Where(x => x < 0).Sum();
    104       return new DoubleValue(quality);
     124    public static double GetCombinedQuality(double flowDistanceQuality, double installationQuality, double overbookedCapacity,
     125      double transportationCosts, double overbookedCapacityPenalty) {
     126      return installationQuality
     127        + transportationCosts * flowDistanceQuality
     128        + overbookedCapacityPenalty * overbookedCapacity;
    105129    }
    106130
    107131    public override IOperation Apply() {
    108       IntegerVector assignment = AssignmentParameter.ActualValue;
    109       DoubleMatrix weights = WeightsParameter.ActualValue;
    110       DoubleMatrix distances = DistancesParameter.ActualValue;
    111       DoubleMatrix installCosts = InstallationCostsParameter.ActualValue;
    112       double transportCosts = TransportationCostsParameter.ActualValue.Value;
    113       DoubleArray demands = DemandsParameter.ActualValue;
    114       DoubleArray capacities = (DoubleArray)CapacitiesParameter.ActualValue.Clone();
    115       double penalty = PenaltyParameter.ActualValue.Value;
     132      var assignment = AssignmentParameter.ActualValue;
     133      var weights = WeightsParameter.ActualValue;
     134      var distances = DistancesParameter.ActualValue;
     135      var installCosts = InstallationCostsParameter.ActualValue;
     136      var demands = DemandsParameter.ActualValue;
     137      var capacities = CapacitiesParameter.ActualValue;
     138      var transportCosts = TransportationCostsParameter.ActualValue.Value;
     139      double penalty = OverbookedCapacityPenaltyParameter.ActualValue.Value;
    116140
    117141      if (weights.Rows != weights.Columns || distances.Rows != distances.Columns
     
    120144        throw new InvalidOperationException("ERROR: The problem configuration is not valid! Check the sizes of the weights (NxN), distances (MxM) and installation costs (NxM) matrices as well as the length of the demand (N) and capacities (M) vectors.");
    121145
    122       double infeasibility;
    123       var quality = Evaluate(assignment, weights, distances, installCosts, transportCosts, demands, capacities, out infeasibility);
     146      double flowDistanceQuality, installationQuality, overbookedCapacity;
     147      Evaluate(assignment, weights, distances, installCosts, demands, capacities,
     148        out flowDistanceQuality, out installationQuality, out overbookedCapacity);
    124149
    125       InfeasibilityParameter.ActualValue = new DoubleValue(infeasibility);
    126       QualityParameter.ActualValue = new DoubleValue(quality.Value + penalty * infeasibility);
     150      FlowDistanceQualityParameter.ActualValue = new DoubleValue(flowDistanceQuality);
     151      InstallationQualityParameter.ActualValue = new DoubleValue(installationQuality);
     152      OverbookedCapacityParameter.ActualValue = new DoubleValue(overbookedCapacity);
     153
     154      QualityParameter.ActualValue = new DoubleValue(GetCombinedQuality(flowDistanceQuality, installationQuality, overbookedCapacity, transportCosts, penalty));
    127155      return base.Apply();
    128156    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluators/GQAPNMoveEvaluator.cs

    r7407 r7412  
    4444      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    4545    }
     46    public ILookupParameter<DoubleValue> FlowDistanceQualityParameter {
     47      get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; }
     48    }
     49    public ILookupParameter<DoubleValue> InstallationQualityParameter {
     50      get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; }
     51    }
     52    public ILookupParameter<DoubleValue> OverbookedCapacityParameter {
     53      get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; }
     54    }
    4655    public ILookupParameter<DoubleValue> MoveQualityParameter {
    4756      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
    4857    }
    49     public ILookupParameter<DoubleValue> MoveInfeasibilityParameter {
    50       get { return (ILookupParameter<DoubleValue>)Parameters["MoveInfeasibility"]; }
     58    public ILookupParameter<DoubleValue> MoveFlowDistanceQualityParameter {
     59      get { return (ILookupParameter<DoubleValue>)Parameters["MoveFlowDistanceQuality"]; }
     60    }
     61    public ILookupParameter<DoubleValue> MoveInstallationQualityParameter {
     62      get { return (ILookupParameter<DoubleValue>)Parameters["MoveInstallationQuality"]; }
     63    }
     64    public ILookupParameter<DoubleValue> MoveOverbookedCapacityParameter {
     65      get { return (ILookupParameter<DoubleValue>)Parameters["MoveOverbookedCapacity"]; }
     66    }
     67    public IValueLookupParameter<DoubleValue> TransportationCostsParameter {
     68      get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
     69    }
     70    public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter {
     71      get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }
    5172    }
    5273    public ILookupParameter<DoubleMatrix> WeightsParameter {
     
    5879    public ILookupParameter<DoubleMatrix> InstallationCostsParameter {
    5980      get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }
    60     }
    61     public ILookupParameter<DoubleValue> TransportationCostsParameter {
    62       get { return (ILookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
    6381    }
    6482    public ILookupParameter<DoubleArray> DemandsParameter {
     
    7795      Parameters.Add(new LookupParameter<NMove>("Move", "The move to perform."));
    7896      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality."));
     97      Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria."));
     98      Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs."));
     99      Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location."));
    79100      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move if it would be applied."));
    80       Parameters.Add(new LookupParameter<DoubleValue>("MoveInfeasibility", "The infeasibility of the move if it would be applied."));
     101      Parameters.Add(new LookupParameter<DoubleValue>("MoveFlowDistanceQuality", "The quality of the move regarding the flow-distance criteria."));
     102      Parameters.Add(new LookupParameter<DoubleValue>("MoveInstallationQuality", "The quality of the move regarding the installation costs."));
     103      Parameters.Add(new LookupParameter<DoubleValue>("MoveOverbookedCapacity", "The sum of the overbooked capacities of the move relative to the capacity of each location."));
     104      Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality."));
     105      Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights or distance matrix already."));
    81106      Parameters.Add(new LookupParameter<DoubleMatrix>("Weights", "The weights matrix describes the flows between the equipments."));
    82107      Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed."));
    83108      Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j"));
    84       Parameters.Add(new LookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights matrix already."));
    85109      Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments."));
    86110      Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));
     
    91115    }
    92116
    93     public static DoubleValue Evaluate(NMove move, IntegerVector assignment, DoubleValue quality,
    94                                   DoubleArray demands, DoubleArray capacities,
    95                                   DoubleMatrix weights, DoubleMatrix distances,
    96                                   DoubleMatrix installationCosts,
    97                                   DoubleValue transportationCosts,
    98                                   out DoubleValue moveInfeasibility) {
    99       double moveQuality = quality.Value;
     117    public static double Evaluate(NMove move, IntegerVector assignment, DoubleMatrix weights, DoubleMatrix distances, DoubleMatrix installationCosts,
     118      DoubleArray demands, DoubleArray capacities, DoubleValue transportationCosts, DoubleValue overbookedCapacityPenalty) {
     119      double moveFlowDistanceQuality, moveInstallationQuality, moveOverbookedCapacity;
     120      Evaluate(move, assignment, weights, distances, installationCosts, demands, capacities,
     121        out moveFlowDistanceQuality, out moveInstallationQuality, out moveOverbookedCapacity);
     122      return GQAPEvaluator.GetCombinedQuality(moveFlowDistanceQuality, moveInstallationQuality, moveOverbookedCapacity,
     123        transportationCosts.Value, overbookedCapacityPenalty.Value);
     124    }
     125
     126    public static void Evaluate(NMove move, IntegerVector assignment, DoubleMatrix weights, DoubleMatrix distances, DoubleMatrix installationCosts,
     127      DoubleArray demands, DoubleArray capacities, out double moveFlowDistanceQuality, out double moveInstallationQuality, out double moveOverbookedCapacity) {
     128      moveFlowDistanceQuality = moveInstallationQuality = moveOverbookedCapacity = 0.0;
    100129      int moves = move.N;
    101130      var slack = (DoubleArray)capacities.Clone();
     131      var oldSlack = (DoubleArray)slack.Clone();
    102132      Dictionary<int, int> moving = new Dictionary<int, int>();
    103133      for (int i = 0; i < moves; i++) moving.Add(move.Equipments[i], move.Locations[i]);
     
    106136        int equip = move.Equipments[i];
    107137        int newLoc = move.Locations[i];
    108         moveQuality -= installationCosts[equip, assignment[equip]];
    109         moveQuality += installationCosts[equip, newLoc];
     138        moveInstallationQuality -= installationCosts[equip, assignment[equip]];
     139        moveInstallationQuality += installationCosts[equip, newLoc];
    110140        for (int j = 0; j < assignment.Length; j++) {
    111141          if (!moving.ContainsKey(j)) {
    112             moveQuality += transportationCosts.Value * weights[equip, j] * (distances[newLoc, assignment[j]] - distances[assignment[equip], assignment[j]]);
    113             moveQuality += transportationCosts.Value * weights[j, equip] * (distances[assignment[j], newLoc] - distances[assignment[j], assignment[equip]]);
     142            moveFlowDistanceQuality += weights[equip, j] * distances[newLoc, assignment[j]];
     143            moveFlowDistanceQuality -= weights[equip, j] * distances[assignment[equip], assignment[j]];
     144            moveFlowDistanceQuality += weights[j, equip] * distances[assignment[j], newLoc];
     145            moveFlowDistanceQuality -= weights[j, equip] * distances[assignment[j], assignment[equip]];
    114146            if (i == 0) { // only once for each untouched equipment deduct the demand from the capacity
    115147              slack[assignment[j]] -= demands[j];
     148              oldSlack[assignment[j]] -= demands[j];
    116149            }
    117150          } else {
    118             moveQuality += transportationCosts.Value * weights[equip, j] * (distances[newLoc, moving[j]] - distances[assignment[equip], assignment[j]]);
    119             moveQuality += transportationCosts.Value * weights[j, equip] * (distances[moving[j], newLoc] - distances[assignment[j], assignment[equip]]);
     151            moveFlowDistanceQuality += weights[equip, j] * distances[newLoc, moving[j]];
     152            moveFlowDistanceQuality -= weights[equip, j] * distances[assignment[equip], assignment[j]];
    120153          }
    121154        }
    122155        slack[newLoc] -= demands[equip];
     156        oldSlack[assignment[equip]] -= demands[equip];
    123157      }
    124158
    125       moveInfeasibility = new DoubleValue(-slack.Where(x => x < 0).Sum());
    126       return new DoubleValue(moveQuality);
    127 
     159      moveOverbookedCapacity = slack.Select((v, i) => new { V = v, Index = i }).Where(x => x.V < 0.0).Select(x => -x.V / capacities[x.Index]).Sum()
     160                               - oldSlack.Select((v, i) => new { V = v, Index = i }).Where(x => x.V < 0.0).Select(x => -x.V / capacities[x.Index]).Sum();
    128161    }
    129162
    130163    public override IOperation Apply() {
    131       DoubleValue moveInfeasibility;
    132       MoveQualityParameter.ActualValue = Evaluate(MoveParameter.ActualValue,
    133                  AssignmentParameter.ActualValue, QualityParameter.ActualValue,
    134                  DemandsParameter.ActualValue, CapacitiesParameter.ActualValue,
    135                  WeightsParameter.ActualValue, DistancesParameter.ActualValue,
    136                  InstallationCostsParameter.ActualValue,
    137                  TransportationCostsParameter.ActualValue, out moveInfeasibility);
    138       MoveInfeasibilityParameter.ActualValue = moveInfeasibility;
     164      double moveFlowDistanceQuality, moveInstallationQuality, moveOverbookedCapacity;
     165      double quality = QualityParameter.ActualValue.Value;
     166      double transportationCosts = TransportationCostsParameter.ActualValue.Value;
     167      double overbookedCapacityPenalty = OverbookedCapacityPenaltyParameter.ActualValue.Value;
     168
     169      double flowDistanceQuality = FlowDistanceQualityParameter.ActualValue.Value;
     170      double installationQuality = InstallationQualityParameter.ActualValue.Value;
     171      double overbookedCapacity = OverbookedCapacityParameter.ActualValue.Value;
     172
     173      Evaluate(MoveParameter.ActualValue,
     174               AssignmentParameter.ActualValue,
     175               WeightsParameter.ActualValue, DistancesParameter.ActualValue,
     176               InstallationCostsParameter.ActualValue,
     177               DemandsParameter.ActualValue, CapacitiesParameter.ActualValue,
     178               out moveFlowDistanceQuality, out moveInstallationQuality, out moveOverbookedCapacity);
     179
     180      MoveFlowDistanceQualityParameter.ActualValue = new DoubleValue(flowDistanceQuality + moveFlowDistanceQuality);
     181      MoveInstallationQualityParameter.ActualValue = new DoubleValue(installationQuality + moveInstallationQuality);
     182      MoveOverbookedCapacityParameter.ActualValue = new DoubleValue(moveOverbookedCapacity);
     183
     184      MoveQualityParameter.ActualValue = new DoubleValue(GQAPEvaluator.GetCombinedQuality(
     185        flowDistanceQuality + moveFlowDistanceQuality,
     186        installationQuality + moveInstallationQuality,
     187        moveOverbookedCapacity,
     188        transportationCosts,
     189        overbookedCapacityPenalty));
    139190      return base.Apply();
    140191    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs

    r7407 r7412  
    5353      get { return (ValueParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }
    5454    }
     55    public ValueParameter<DoubleArray> DemandsParameter {
     56      get { return (ValueParameter<DoubleArray>)Parameters["Demands"]; }
     57    }
     58    public ValueParameter<DoubleArray> CapacitiesParameter {
     59      get { return (ValueParameter<DoubleArray>)Parameters["Capacities"]; }
     60    }
    5561    public FixedValueParameter<DoubleValue> TransportationCostsParameter {
    5662      get { return (FixedValueParameter<DoubleValue>)Parameters["TransportationCosts"]; }
    5763    }
    58     public ValueParameter<DoubleArray> DemandsParameter {
    59       get { return (ValueParameter<DoubleArray>)Parameters["Demands"]; }
    60     }
    61     public ValueParameter<DoubleArray> CapacitiesParameter {
    62       get { return (ValueParameter<DoubleArray>)Parameters["Capacities"]; }
     64    public FixedValueParameter<DoubleValue> OverbookedCapacityPenaltyParameter {
     65      get { return (FixedValueParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }
    6366    }
    6467    public OptionalValueParameter<IItem> BestKnownSolutionParameter {
     
    8083      set { InstallationCostsParameter.Value = value; }
    8184    }
     85    public DoubleArray Demands {
     86      get { return DemandsParameter.Value; }
     87      set { DemandsParameter.Value = value; }
     88    }
     89    public DoubleArray Capacities {
     90      get { return CapacitiesParameter.Value; }
     91      set { CapacitiesParameter.Value = value; }
     92    }
    8293    public double TransportationCosts {
    8394      get { return TransportationCostsParameter.Value.Value; }
    8495      set { TransportationCostsParameter.Value.Value = value; }
    8596    }
    86     public DoubleArray Demands {
    87       get { return DemandsParameter.Value; }
    88       set { DemandsParameter.Value = value; }
    89     }
    90     public DoubleArray Capacities {
    91       get { return CapacitiesParameter.Value; }
    92       set { CapacitiesParameter.Value = value; }
     97    public double OverbookedCapacityPenalty {
     98      get { return TransportationCostsParameter.Value.Value; }
     99      set { TransportationCostsParameter.Value.Value = value; }
    93100    }
    94101    #endregion
     
    114121      Parameters.Add(new ValueParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j", new DoubleMatrix()));
    115122      Parameters.Add(new FixedValueParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights matrix already.", new DoubleValue(1)));
     123      Parameters.Add(new FixedValueParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality.", new DoubleValue(1000)));
    116124      Parameters.Add(new ValueParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments.", new DoubleArray()));
    117125      Parameters.Add(new ValueParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations.", new DoubleArray()));
     
    183191    #region Helpers
    184192    [StorableHook(HookType.AfterDeserialization)]
    185     private void AfterDeserializationHook() {
     193    private void AfterDeserialization() {
    186194      AttachEventHandlers();
    187195    }
     
    220228      }
    221229      foreach (var op in Operators.OfType<IGQAPEvaluationOperator>()) {
     230        op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;
     231        op.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name;
     232        op.OverbookedCapacityPenaltyParameter.ActualName = OverbookedCapacityPenaltyParameter.Name;
    222233        op.WeightsParameter.ActualName = WeightsParameter.Name;
    223234        op.DistancesParameter.ActualName = DistancesParameter.Name;
    224235        op.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name;
    225         op.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name;
    226236        op.DemandsParameter.ActualName = DemandsParameter.Name;
    227237        op.CapacitiesParameter.ActualName = CapacitiesParameter.Name;
    228         op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;
    229238      }
    230239      foreach (var op in Operators.OfType<IGQAPLocalImprovementOperator>()) {
     240        op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;
     241        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     242        op.FlowDistanceQualityParameter.ActualName = Evaluator.FlowDistanceQualityParameter.ActualName;
     243        op.InstallationQualityParameter.ActualName = Evaluator.InstallationQualityParameter.ActualName;
     244        op.OverbookedCapacityParameter.ActualName = Evaluator.OverbookedCapacityParameter.ActualName;
     245        op.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name;
     246        op.OverbookedCapacityPenaltyParameter.ActualName = OverbookedCapacityPenaltyParameter.Name;
    231247        op.WeightsParameter.ActualName = WeightsParameter.Name;
    232248        op.DistancesParameter.ActualName = DistancesParameter.Name;
    233249        op.InstallationCostsParameter.ActualName = InstallationCostsParameter.Name;
    234         op.TransportationCostsParameter.ActualName = TransportationCostsParameter.Name;
    235250        op.DemandsParameter.ActualName = DemandsParameter.Name;
    236251        op.CapacitiesParameter.ActualName = CapacitiesParameter.Name;
    237         op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;
    238         op.InfeasibilityParameter.ActualName = Evaluator.InfeasibilityParameter.ActualName;
    239252      }
    240253      foreach (var op in Operators.OfType<IGQAPManipulator>()) {
    241254        op.IntegerVectorParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;
     255      }
     256      foreach (var op in Operators.OfType<IGQAPMerger>()) {
     257        op.AssignmentParameter.ActualName = SolutionCreator.AssignmentParameter.ActualName;
     258        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     259        op.MaximizationParameter.ActualName = MaximizationParameter.Name;
    242260      }
    243261      foreach (var op in Operators.OfType<IGQAPMoveOperator>()) {
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj

    r7407 r7412  
    9494    <Compile Include="Evaluators\GQAPEvaluator.cs" />
    9595    <Compile Include="GeneralizedQuadraticAssignmentProblem.cs" />
     96    <Compile Include="GQAPIntegerVectorProximityCalculator.cs" />
     97    <Compile Include="Interfaces\IGQAPMerger.cs" />
    9698    <Compile Include="Interfaces\IGQAPNMoveEvaluator.cs" />
    9799    <Compile Include="Interfaces\IEquipmentAwareGQAPOperator.cs" />
     
    120122    <Compile Include="Operators\GQAPSolutionCreator.cs" />
    121123    <Compile Include="Operators\GreedyRandomizedSolutionCreator.cs" />
     124    <Compile Include="Operators\QualitySimilarityMerger.cs" />
    122125    <Compile Include="Operators\RandomSolutionCreator.cs" />
    123126    <Compile Include="Operators\RelocateEquipmentManipluator.cs" />
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPEvaluationOperator.cs

    r7407 r7412  
    2929    ILookupParameter<DoubleMatrix> DistancesParameter { get; }
    3030    ILookupParameter<DoubleMatrix> InstallationCostsParameter { get; }
    31     ILookupParameter<DoubleValue> TransportationCostsParameter { get; }
    3231    ILookupParameter<DoubleArray> DemandsParameter { get; }
    3332    ILookupParameter<DoubleArray> CapacitiesParameter { get; }
    3433    ILookupParameter<IntegerVector> AssignmentParameter { get; }
     34
     35    IValueLookupParameter<DoubleValue> TransportationCostsParameter { get; }
     36    IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter { get; }
    3537  }
    3638}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPEvaluator.cs

    r7407 r7412  
    2626namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment {
    2727  public interface IGQAPEvaluator : IGQAPEvaluationOperator, ISingleObjectiveEvaluator {
    28     ILookupParameter<DoubleValue> InfeasibilityParameter { get; }
     28    ILookupParameter<DoubleValue> FlowDistanceQualityParameter { get; }
     29    ILookupParameter<DoubleValue> InstallationQualityParameter { get; }
     30    ILookupParameter<DoubleValue> OverbookedCapacityParameter { get; }
    2931  }
    3032}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPLocalImprovementOperator.cs

    r7407 r7412  
    2828  public interface IGQAPLocalImprovementOperator : IGQAPOperator, ILocalImprovementOperator {
    2929    ILookupParameter<DoubleValue> QualityParameter { get; }
    30     ILookupParameter<DoubleValue> InfeasibilityParameter { get; }
    31     ILookupParameter<ResultCollection> ResultsParameter { get; }
     30    ILookupParameter<DoubleValue> FlowDistanceQualityParameter { get; }
     31    ILookupParameter<DoubleValue> InstallationQualityParameter { get; }
     32    ILookupParameter<DoubleValue> OverbookedCapacityParameter { get; }
    3233    IValueLookupParameter<IntValue> MaximumCandidateListSizeParameter { get; }
    3334    IValueLookupParameter<IntValue> MaximumSampleSizeParameter { get; }
     
    3637    ILookupParameter<DoubleMatrix> DistancesParameter { get; }
    3738    ILookupParameter<DoubleMatrix> InstallationCostsParameter { get; }
    38     ILookupParameter<DoubleValue> TransportationCostsParameter { get; }
    3939    ILookupParameter<DoubleArray> DemandsParameter { get; }
    4040    ILookupParameter<DoubleArray> CapacitiesParameter { get; }
     41    IValueLookupParameter<DoubleValue> TransportationCostsParameter { get; }
     42    IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter { get; }
    4143  }
    4244}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Interfaces/IGQAPMoveEvaluator.cs

    r7407 r7412  
    2020#endregion
    2121
     22using HeuristicLab.Core;
     23using HeuristicLab.Data;
    2224using HeuristicLab.Optimization;
    2325
    2426namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment {
    25   public interface IGQAPMoveEvaluator : IGQAPEvaluationOperator, ISingleObjectiveMoveEvaluator { }
     27  public interface IGQAPMoveEvaluator : IGQAPEvaluationOperator, ISingleObjectiveMoveEvaluator {
     28    ILookupParameter<DoubleValue> FlowDistanceQualityParameter { get; }
     29    ILookupParameter<DoubleValue> InstallationQualityParameter { get; }
     30    ILookupParameter<DoubleValue> OverbookedCapacityParameter { get; }
     31  }
    2632}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/NMoveMaker.cs

    r7407 r7412  
    4242      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    4343    }
    44     public ILookupParameter<DoubleValue> InfeasibilityParameter {
    45       get { return (ILookupParameter<DoubleValue>)Parameters["Infeasibility"]; }
     44    public ILookupParameter<DoubleValue> FlowDistanceQualityParameter {
     45      get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; }
     46    }
     47    public ILookupParameter<DoubleValue> InstallationQualityParameter {
     48      get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; }
     49    }
     50    public ILookupParameter<DoubleValue> OverbookedCapacityParameter {
     51      get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; }
    4652    }
    4753    public ILookupParameter<DoubleValue> MoveQualityParameter {
    4854      get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
    4955    }
    50     public ILookupParameter<DoubleValue> MoveInfeasibilityParameter {
    51       get { return (ILookupParameter<DoubleValue>)Parameters["MoveInfeasibility"]; }
     56    public ILookupParameter<DoubleValue> MoveFlowDistanceQualityParameter {
     57      get { return (ILookupParameter<DoubleValue>)Parameters["MoveFlowDistanceQuality"]; }
     58    }
     59    public ILookupParameter<DoubleValue> MoveInstallationQualityParameter {
     60      get { return (ILookupParameter<DoubleValue>)Parameters["MoveInstallationQuality"]; }
     61    }
     62    public ILookupParameter<DoubleValue> MoveOverbookedCapacityParameter {
     63      get { return (ILookupParameter<DoubleValue>)Parameters["MoveOverbookedCapacity"]; }
    5264    }
    5365
     
    6072      Parameters.Add(new LookupParameter<NMove>("Move", "The move to perform."));
    6173      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality."));
    62       Parameters.Add(new LookupParameter<DoubleValue>("Infeasibility", "The infeasibility of a solution."));
     74      Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria."));
     75      Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs."));
     76      Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location."));
    6377      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The quality of the move if it would be applied."));
    64       Parameters.Add(new LookupParameter<DoubleValue>("MoveInfeasibility", "The infeasibility of the move if it would be applied."));
     78      Parameters.Add(new LookupParameter<DoubleValue>("MoveFlowDistanceQuality", "The quality of the move regarding the flow-distance criteria."));
     79      Parameters.Add(new LookupParameter<DoubleValue>("MoveInstallationQuality", "The quality of the move regarding the installation costs."));
     80      Parameters.Add(new LookupParameter<DoubleValue>("MoveOverbookedCapacity", "The sum of the overbooked capacities of the move relative to the capacity of each location."));
    6581    }
    6682
     
    7894      Apply(AssignmentParameter.ActualValue, MoveParameter.ActualValue);
    7995      QualityParameter.ActualValue.Value = MoveQualityParameter.ActualValue.Value;
    80       InfeasibilityParameter.ActualValue.Value = MoveInfeasibilityParameter.ActualValue.Value;
     96      FlowDistanceQualityParameter.ActualValue.Value = MoveFlowDistanceQualityParameter.ActualValue.Value;
     97      InstallationQualityParameter.ActualValue.Value = MoveInstallationQualityParameter.ActualValue.Value;
     98      OverbookedCapacityParameter.ActualValue.Value = MoveOverbookedCapacityParameter.ActualValue.Value;
    8199      return base.Apply();
    82100    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveMultiMoveGenerator.cs

    r7407 r7412  
    6060    public static IEnumerable<NMove> Generate(IRandom random, IntegerVector assignment, int n, DoubleArray capacities, int sampleSize) {
    6161      for (int i = 0; i < sampleSize; i++)
    62         yield return StochasticNMoveSingleMoveGenerator.Generate(random, assignment, n, capacities);
     62        yield return StochasticNMoveSingleMoveGenerator.GenerateUpToN(random, assignment, n, capacities);
    6363    }
    6464
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs

    r7407 r7412  
    5454    }
    5555
    56     public static NMove Generate(IRandom random, IntegerVector assignment, int n, DoubleArray capacities) {
    57       int moving = random.Next(n) + 1;
    58       int[] equipments = new int[moving], locations = new int[moving];
     56    public static NMove GenerateUpToN(IRandom random, IntegerVector assignment, int n, DoubleArray capacities) {
     57      return GenerateExactlyN(random, assignment, random.Next(n) + 1, capacities);
     58    }
     59
     60    public static NMove GenerateExactlyN(IRandom random, IntegerVector assignment, int n, DoubleArray capacities) {
     61      int[] equipments = new int[n], locations = new int[n];
    5962      HashSet<int> chosenEquipments = new HashSet<int>();
    60       for (int i = 0; i < moving; i++) {
     63      for (int i = 0; i < n; i++) {
    6164        do {
    6265          equipments[i] = random.Next(assignment.Length);
     
    7174
    7275    public override IEnumerable<NMove> GenerateMoves(IntegerVector assignment, int n) {
    73       yield return Generate(RandomParameter.ActualValue, assignment, n, CapacitiesParameter.ActualValue);
     76      yield return GenerateUpToN(RandomParameter.ActualValue, assignment, n, CapacitiesParameter.ActualValue);
    7477    }
    7578  }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/ApproximateLocalSearch.cs

    r7407 r7412  
    5555      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    5656    }
    57     public ILookupParameter<DoubleValue> InfeasibilityParameter {
    58       get { return (ILookupParameter<DoubleValue>)Parameters["Infeasibility"]; }
     57    public ILookupParameter<DoubleValue> FlowDistanceQualityParameter {
     58      get { return (ILookupParameter<DoubleValue>)Parameters["FlowDistanceQuality"]; }
     59    }
     60    public ILookupParameter<DoubleValue> InstallationQualityParameter {
     61      get { return (ILookupParameter<DoubleValue>)Parameters["InstallationQuality"]; }
     62    }
     63    public ILookupParameter<DoubleValue> OverbookedCapacityParameter {
     64      get { return (ILookupParameter<DoubleValue>)Parameters["OverbookedCapacity"]; }
    5965    }
    6066    public ILookupParameter<ResultCollection> ResultsParameter {
     
    7985      get { return (ILookupParameter<DoubleMatrix>)Parameters["InstallationCosts"]; }
    8086    }
    81     public ILookupParameter<DoubleValue> TransportationCostsParameter {
    82       get { return (ILookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
    83     }
    8487    public ILookupParameter<DoubleArray> DemandsParameter {
    8588      get { return (ILookupParameter<DoubleArray>)Parameters["Demands"]; }
     
    8891      get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; }
    8992    }
    90 
     93    public IValueLookupParameter<DoubleValue> TransportationCostsParameter {
     94      get { return (IValueLookupParameter<DoubleValue>)Parameters["TransportationCosts"]; }
     95    }
     96    public IValueLookupParameter<DoubleValue> OverbookedCapacityPenaltyParameter {
     97      get { return (IValueLookupParameter<DoubleValue>)Parameters["OverbookedCapacityPenalty"]; }
     98    }
     99    public IValueLookupParameter<PercentValue> OneMoveProbabilityParameter {
     100      get { return (IValueLookupParameter<PercentValue>)Parameters["OneMoveProbability"]; }
     101    }
    91102
    92103    [StorableConstructor]
     
    99110      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solution equivalents."));
    100111      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The solution quality."));
    101       Parameters.Add(new LookupParameter<DoubleValue>("Infeasibility", "The infeasibility describes the sum of the overbooked capacities."));
     112      Parameters.Add(new LookupParameter<DoubleValue>("FlowDistanceQuality", "The quality regarding the flow-distance criteria."));
     113      Parameters.Add(new LookupParameter<DoubleValue>("InstallationQuality", "The quality regarding the installation costs."));
     114      Parameters.Add(new LookupParameter<DoubleValue>("OverbookedCapacity", "The sum of the overbooked capacities relative to the capacity of each location."));
    102115      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The result collection that stores the results."));
    103116      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumCandidateListSize", "The maximum number of candidates that should be found in each step.", new IntValue(10)));
     
    107120      Parameters.Add(new LookupParameter<DoubleMatrix>("Distances", "The distances matrix describes the distances between the locations at which the equipment can be installed."));
    108121      Parameters.Add(new LookupParameter<DoubleMatrix>("InstallationCosts", "The installation costs matrix describes the installation costs of installing equipment i at location j."));
    109       Parameters.Add(new LookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights matrix already."));
    110122      Parameters.Add(new LookupParameter<DoubleArray>("Demands", "The demands vector describes the space requirements of the equipments."));
    111123      Parameters.Add(new LookupParameter<DoubleArray>("Capacities", "The capacities vector describes the available space at the locations."));
     124      Parameters.Add(new ValueLookupParameter<DoubleValue>("TransportationCosts", "The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights matrix already."));
     125      Parameters.Add(new ValueLookupParameter<DoubleValue>("OverbookedCapacityPenalty", "The multiplier for the constraint violation when added to the quality."));
     126      Parameters.Add(new ValueLookupParameter<PercentValue>("OneMoveProbability", "The probability for performing a 1-move, which is the opposite of performing a 2-move.", new PercentValue(.5)));
    112127    }
    113128
     
    124139    /// <param name="assignment">The equipment-location assignment vector.</param>
    125140    /// <param name="quality">The solution quality.</param>
    126     /// <param name="infeasibility">The infeasibility describes the sum of the overbooked capacities.</param>
     141    /// <param name="flowDistanceQuality">The quality regarding the flow-distance criteria.</param>
     142    /// <param name="installationQuality">The quality regarding the installation costs.</param>
     143    /// <param name="overbookedCapacity">The sum of the overbooked capacities relative to the capacity of each location.</param>
    127144    /// <param name="maxCLS">The maximum number of candidates that should be found in each step.</param>
    128145    /// <param name="maxSampleSize">The maximum number of candidates that should be sampled in each step.</param>
    129146    /// <param name="maximumIterations">The maximum number of iterations that should be performed.</param>
    130     /// <param name="demands">The demands vector describes the space requirements of the equipments.</param>
    131     /// <param name="capacities">The capacities vector describes the available space at the locations.</param>
    132147    /// <param name="weights">The weights matrix describes the flows between the equipments.</param>
    133148    /// <param name="distances">The distances matrix describes the distances between the locations at which the equipment can be installed.</param>
    134149    /// <param name="installationCosts">The installation costs matrix describes the installation costs of installing equipment i at location j</param>
     150    /// <param name="demands">The demands vector describes the space requirements of the equipments.</param>
     151    /// <param name="capacities">The capacities vector describes the available space at the locations.</param>
    135152    /// <param name="transportationCosts">The transportation cost represents the flow-unit per distance-unit cost factor. This value can also be set to 1 if these costs are factored into the weights matrix already.</param>
    136     public static void Apply(IRandom random, IntegerVector assignment, DoubleValue quality, DoubleValue infeasibility,
    137                              IntValue maxCLS, IntValue maxSampleSize, IntValue maximumIterations,
    138                              DoubleArray demands, DoubleArray capacities,
    139                              DoubleMatrix weights, DoubleMatrix distances,
    140                              DoubleMatrix installationCosts,
    141                              DoubleValue transportationCosts) {
     153    /// <param name="overbookedCapacityPenalty"></param>
     154    /// <param name="oneMoveProbability">The probability for performing a 1-move, which is the opposite of performing a 2-move.</param>
     155    public static void Apply(IRandom random, IntegerVector assignment,
     156      DoubleValue quality, DoubleValue flowDistanceQuality, DoubleValue installationQuality, DoubleValue overbookedCapacity,
     157      IntValue maxCLS, IntValue maxSampleSize, IntValue maximumIterations,
     158      DoubleMatrix weights, DoubleMatrix distances, DoubleMatrix installationCosts, DoubleArray demands, DoubleArray capacities,
     159      DoubleValue transportationCosts, DoubleValue overbookedCapacityPenalty, PercentValue oneMoveProbability) {
     160
    142161      for (int i = 0; i < maximumIterations.Value; i++) {
    143162        int count = 0;
    144         var CLS = new List<Tuple<NMove, DoubleValue, DoubleValue>>();
     163        var CLS = new List<Tuple<NMove, double, double, double, double>>();
    145164        double sum = 0.0;
    146165        do {
    147           var move = StochasticNMoveSingleMoveGenerator.Generate(random, assignment, 2, capacities);
    148           DoubleValue moveInfeasibility;
    149           var moveQuality = GQAPNMoveEvaluator.Evaluate(move, assignment, quality,
    150             demands, capacities, weights, distances,
    151             installationCosts, transportationCosts, out moveInfeasibility);
    152           if (moveInfeasibility.Value <= 0.0 && moveQuality.Value < quality.Value) {
    153             CLS.Add(Tuple.Create(move, moveQuality, moveInfeasibility));
    154             sum += 1.0 / moveQuality.Value;
     166          NMove move;
     167          if (random.NextDouble() < oneMoveProbability.Value)
     168            move = StochasticNMoveSingleMoveGenerator.GenerateExactlyN(random, assignment, 1, capacities);
     169          else move = StochasticNMoveSingleMoveGenerator.GenerateExactlyN(random, assignment, 2, capacities);
     170
     171          double moveFlowDistanceQuality, moveInstallationQuality, moveOverbookedCapacity;
     172          GQAPNMoveEvaluator.Evaluate(move, assignment, weights, distances, installationCosts,
     173            demands, capacities, out moveFlowDistanceQuality, out moveInstallationQuality, out moveOverbookedCapacity);
     174          double moveQuality = GQAPEvaluator.GetCombinedQuality(moveFlowDistanceQuality, moveInstallationQuality, moveOverbookedCapacity,
     175            transportationCosts.Value, overbookedCapacityPenalty.Value);
     176
     177          if (moveOverbookedCapacity <= 0.0 && moveQuality < 0.0) {
     178            CLS.Add(Tuple.Create(move, moveQuality, moveFlowDistanceQuality, moveInstallationQuality, moveOverbookedCapacity));
     179            sum += 1.0 / moveQuality;
    155180          }
    156181          count++;
    157182        } while (CLS.Count < maxCLS.Value && count < maxSampleSize.Value);
    158         if (CLS.Count == 0) return; // END
     183
     184        if (CLS.Count == 0)
     185          return; // END
    159186        else {
    160187          var ball = random.NextDouble() * sum;
    161188          var selected = CLS.Last();
    162189          foreach (var candidate in CLS) {
    163             ball -= 1.0 / candidate.Item2.Value;
     190            ball -= 1.0 / candidate.Item2;
    164191            if (ball <= 0.0) {
    165192              selected = candidate;
     
    168195          }
    169196          NMoveMaker.Apply(assignment, selected.Item1);
    170           quality.Value = selected.Item2.Value;
    171           infeasibility.Value = selected.Item3.Value;
     197          quality.Value += selected.Item2;
     198          flowDistanceQuality.Value += selected.Item3;
     199          installationQuality.Value += selected.Item4;
     200          overbookedCapacity.Value += selected.Item5;
    172201        }
    173202      }
     
    178207        AssignmentParameter.ActualValue,
    179208        QualityParameter.ActualValue,
    180         InfeasibilityParameter.ActualValue,
     209        FlowDistanceQualityParameter.ActualValue,
     210        InstallationQualityParameter.ActualValue,
     211        OverbookedCapacityParameter.ActualValue,
    181212        MaximumCandidateListSizeParameter.ActualValue,
    182213        MaximumSampleSizeParameter.ActualValue,
    183214        MaximumIterationsParameter.ActualValue,
    184         DemandsParameter.ActualValue, CapacitiesParameter.ActualValue,
    185215        WeightsParameter.ActualValue, DistancesParameter.ActualValue,
    186216        InstallationCostsParameter.ActualValue,
    187         TransportationCostsParameter.ActualValue);
     217        DemandsParameter.ActualValue, CapacitiesParameter.ActualValue,
     218        TransportationCostsParameter.ActualValue,
     219        OverbookedCapacityPenaltyParameter.ActualValue,
     220        OneMoveProbabilityParameter.ActualValue);
    188221      return base.Apply();
    189222    }
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GreedyRandomizedSolutionCreator.cs

    r7407 r7412  
    6060      while (tries < maxTries) {
    6161        assignment.Clear();
    62         demands.Select((v, i) => slack[i] = v).Enumerate();
     62        capacities.Select((v, i) => slack[i] = v).Enumerate();
    6363        HashSet<int> CF = new HashSet<int>(), // set of chosen facilities / equipments
    6464          T = new HashSet<int>(), // set of facilities / equpiments that can be assigned to the set of chosen locations (CL)
Note: See TracChangeset for help on using the changeset viewer.