Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/11/15 10:11:47 (9 years ago)
Author:
ascheibe
Message:

#2388 merged trunk into branch

Location:
branches/HiveStatistics/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/Plugin.cs.frame

    r12012 r12843  
    2323
    2424namespace HeuristicLab.Problems.QuadraticAssignment.Algorithms {
    25   [Plugin("HeuristicLab.Problems.QuadraticAssignment.Algorithms", "3.3.11.$WCREV$")]
     25  [Plugin("HeuristicLab.Problems.QuadraticAssignment.Algorithms", "3.3.12.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Problems.QuadraticAssignment.Algorithms-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/HiveStatistics/sources/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/Properties/AssemblyInfo.cs.frame

    r12012 r12843  
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
  • branches/HiveStatistics/sources/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSeachOperator.cs

    r12012 r12843  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    9091    private ILookupParameter<BoolValue> AllMovesTabuParameter {
    9192      get { return (ILookupParameter<BoolValue>)Parameters["AllMovesTabu"]; }
     93    }
     94
     95    public ILookupParameter<IntValue> EvaluatedSolutionsParameter {
     96      get { return (ILookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
     97    }
     98
     99    public ILookupParameter<DoubleValue> EvaluatedSolutionEquivalentsParameter {
     100      get { return (ILookupParameter<DoubleValue>)Parameters["EvaluatedSolutionEquivalents"]; }
    92101    }
    93102    #endregion
     
    117126      Parameters.Add(new ValueLookupParameter<IntValue>("AlternativeAspirationTenure", "The time t that a move will be remembered for the alternative aspiration condition."));
    118127      Parameters.Add(new LookupParameter<BoolValue>("AllMovesTabu", "Indicates that all moves are tabu."));
     128      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
     129      Parameters.Add(new LookupParameter<DoubleValue>("EvaluatedSolutionEquivalents", "The number of evaluated solution equivalents."));
    119130    }
    120131
     
    129140      if (!Parameters.ContainsKey("AllMovesTabu")) {
    130141        Parameters.Add(new LookupParameter<BoolValue>("AllMovesTabu", "Indicates that all moves are tabu."));
     142      }
     143      if (!Parameters.ContainsKey("EvaluatedSolutions")) {
     144        Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
     145      }
     146      if (!Parameters.ContainsKey("EvaluatedSolutionEquivalents")) {
     147        Parameters.Add(new LookupParameter<DoubleValue>("EvaluatedSolutionEquivalents", "The number of evaluated solution equivalents."));
    131148      }
    132149      #endregion
     
    163180      bool already_aspired = false;
    164181
     182      double evaluations = EvaluatedSolutionsParameter.ActualValue.Value;
    165183      foreach (Swap2Move move in ExhaustiveSwap2MoveGenerator.Generate(solution)) {
    166184        double moveQuality;
    167         if (lastMove == null)
     185        if (lastMove == null) {
    168186          moveQuality = QAPSwap2MoveEvaluator.Apply(solution, move, weights, distances);
    169         else if (allMovesTabu) moveQuality = moveQualityMatrix[move.Index1, move.Index2];
    170         else moveQuality = QAPSwap2MoveEvaluator.Apply(solution, move, moveQualityMatrix[move.Index1, move.Index2], weights, distances, lastMove);
     187          evaluations += 4.0 / solution.Length;
     188        } else if (allMovesTabu) moveQuality = moveQualityMatrix[move.Index1, move.Index2];
     189        else {
     190          moveQuality = QAPSwap2MoveEvaluator.Apply(solution, move, moveQualityMatrix[move.Index1, move.Index2], weights, distances, lastMove);
     191          if (move.Index1 == lastMove.Index1 || move.Index2 == lastMove.Index1 || move.Index1 == lastMove.Index2 || move.Index2 == lastMove.Index2)
     192            evaluations += 4.0 / solution.Length;
     193          else evaluations += 2.0 / (solution.Length * solution.Length);
     194        }
    171195
    172196        moveQualityMatrix[move.Index1, move.Index2] = moveQuality;
     
    200224        }
    201225      }
     226
     227      EvaluatedSolutionEquivalentsParameter.ActualValue.Value = evaluations;
     228      EvaluatedSolutionsParameter.ActualValue.Value = (int)Math.Ceiling(evaluations);
    202229
    203230      allMovesTabu = bestMove == null;
  • branches/HiveStatistics/sources/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSearch.cs

    r12515 r12843  
    168168      VariableCreator variableCreator = new VariableCreator();
    169169      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
     170      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(1)));
     171      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("EvaluatedSolutionEquivalents", new DoubleValue(1)));
    170172
    171173      ResultsCollector resultsCollector = new ResultsCollector();
    172174      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations", "The actual iteration."));
     175      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "Number of evaluated solutions."));
    173176
    174177      solutionsCreator = new SolutionsCreator();
     
    194197      mainOperator.ShortTermMemoryParameter.ActualName = "ShortTermMemory";
    195198      mainOperator.UseAlternativeAspirationParameter.ActualName = UseAlternativeAspirationParameter.Name;
     199      mainOperator.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     200      mainOperator.EvaluatedSolutionEquivalentsParameter.ActualName = "EvaluatedSolutionEquivalents";
    196201
    197202      ConditionalBranch qualityStopBranch = new ConditionalBranch();
Note: See TracChangeset for help on using the changeset viewer.