Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/10/15 16:38:17 (9 years ago)
Author:
abeham
Message:

#2208:

  • Added missing license headers
  • Updates copyright year
  • Renamed analyzer (us spelling)
  • Removed script
  • Implemented samples unit test
  • Changed solution view to use horizontal splitting, removed viewhosts
  • Updated instance provider to use .NET45 zip compression
  • Restructuring and reformatting
Location:
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3
Files:
1 deleted
13 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3

    • Property svn:ignore
      •  

        old new  
        22obj
        33Plugin.cs
         4*.DotSettings
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Analyzers/BestOrienteeringSolutionAnalyzer.cs

    r12693 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131
    3232namespace HeuristicLab.Problems.Orienteering {
    33   public sealed class BestOrienteeringSolutionAnalyser : SingleSuccessorOperator, IAnalyzer {
     33  public sealed class BestOrienteeringSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
    3434    public bool EnabledByDefault {
    3535      get { return true; }
     
    7878
    7979    [StorableConstructor]
    80     private BestOrienteeringSolutionAnalyser(bool deserializing) : base(deserializing) { }
    81     private BestOrienteeringSolutionAnalyser(BestOrienteeringSolutionAnalyser original, Cloner cloner) : base(original, cloner) { }
     80    private BestOrienteeringSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     81    private BestOrienteeringSolutionAnalyzer(BestOrienteeringSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { }
    8282    public override IDeepCloneable Clone(Cloner cloner) {
    83       return new BestOrienteeringSolutionAnalyser(this, cloner);
     83      return new BestOrienteeringSolutionAnalyzer(this, cloner);
    8484    }
    85     public BestOrienteeringSolutionAnalyser()
     85    public BestOrienteeringSolutionAnalyzer()
    8686      : base() {
    8787      Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("IntegerVector", "The Orienteering solutions which should be analysed."));
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.cs

    r11321 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3030
    3131namespace HeuristicLab.Problems.Orienteering {
    32   [Item("GreedyOrienteeringTourCreator", @"The initial solution for P-VNS is generated by means of a greedy algorithm that takes into
    33 account all vertices vi that are located within the cost limit Tmax. These points are sorted
    34 in descending order regarding the sum of their objective values. Afterwards, the algorithm
    35 starts with a tour only including the starting and ending point and successively inserts the
    36 points from this list at the first position in which they can feasibly be inserted. (Schilde et. al. 2009)")]
     32  /// <summary>
     33  /// The initial solution for P-VNS is generated by means of a greedy algorithm that takes into
     34  /// account all vertices vi that are located within the cost limit Tmax. These points are sorted
     35  /// in descending order regarding the sum of their objective values. Afterwards, the algorithm
     36  /// starts with a tour only including the starting and ending point and successively inserts the
     37  /// points from this list at the first position in which they can feasibly be inserted.
     38  /// (Schilde et. al. 2009)
     39  /// </summary>
     40  [Item("GreedyOrienteeringTourCreator", @"Implements the solution creation procedure described in Schilde M., Doerner K.F., Hartl R.F., Kiechle G. 2009. Metaheuristics for the bi-objective orienteering problem. Swarm Intelligence, Volume 3, Issue 3, pp 179-201.")]
    3741  [StorableClass]
    3842  public sealed class GreedyOrienteeringTourCreator : IntegerVectorCreator, IOrienteeringSolutionCreator {
     
    8084    }
    8185
    82     protected override IntegerVector Create(IRandom _, IntValue __, IntMatrix ___) {
     86    protected override IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds) {
    8387      int startPoint = StartingPointParameter.ActualValue.Value;
    8488      int endPoint = TerminalPointParameter.ActualValue.Value;
     
    105109        endPoint
    106110      };
    107       double length = distances[startPoint, endPoint];
     111      double tourLength = distances[startPoint, endPoint];
    108112
    109113      // Add points in a greedy way
     
    118122
    119123            // If the insertion would be feasible, perform it
    120             if (length + detour <= maxDistance) {
     124            if (tourLength + detour <= maxDistance) {
    121125              tour.Insert(insertPosition, feasiblePoints[i]);
    122               length += detour;
     126              tourLength += detour;
    123127              feasiblePoints.RemoveAt(i);
    124128              insertionPerformed = true;
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/DistanceMatrix.cs

    r11320 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Evaluators/OrienteeringEvaluator.cs

    r11327 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3030
    3131namespace HeuristicLab.Problems.Orienteering {
     32  [Item("OrienteeringEvaluator", "Operator to evaluate a solution to the orienteering problem.")]
     33  [StorableClass]
    3234  public class OrienteeringEvaluator : InstrumentedOperator, IOrienteeringEvaluator {
    3335
     
    8284    }
    8385
    84     public static OrienteeringEvaluation Apply(IntegerVector solution, DoubleArray scores,
     86    public static OrienteeringEvaluationResult Apply(IntegerVector solution, DoubleArray scores,
    8587      DistanceMatrix distances, double maximumDistance, double pointVisitingCosts, double distancePenaltyFactor) {
    8688
     
    9597      double quality = score - penalty;
    9698
    97       return new OrienteeringEvaluation {
     99      return new OrienteeringEvaluationResult {
    98100        Quality = new DoubleValue(quality),
    99101        Penalty = new DoubleValue(penalty),
     
    113115    }
    114116
    115     public OrienteeringEvaluation Evaluate(IntegerVector solution, DoubleArray scores,
     117    public OrienteeringEvaluationResult Evaluate(IntegerVector solution, DoubleArray scores,
    116118      DistanceMatrix distances, double maximumDistance, double pointVisitingCosts) {
    117119      return Apply(solution, scores, distances, maximumDistance, pointVisitingCosts,
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj

    r11327 r12721  
    1010    <RootNamespace>HeuristicLab.Problems.Orienteering</RootNamespace>
    1111    <AssemblyName>HeuristicLab.Problems.Orienteering-3.3</AssemblyName>
    12     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     12    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1313    <FileAlignment>512</FileAlignment>
     14    <TargetFrameworkProfile />
    1415  </PropertyGroup>
    1516  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    2122    <ErrorReport>prompt</ErrorReport>
    2223    <WarningLevel>4</WarningLevel>
     24    <Prefer32Bit>false</Prefer32Bit>
    2325  </PropertyGroup>
    2426  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    2931    <ErrorReport>prompt</ErrorReport>
    3032    <WarningLevel>4</WarningLevel>
     33    <Prefer32Bit>false</Prefer32Bit>
    3134  </PropertyGroup>
    3235  <PropertyGroup>
     
    4144  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    4245    <DebugSymbols>true</DebugSymbols>
    43     <OutputPath>bin\x64\Debug\</OutputPath>
     46    <OutputPath>..\..\bin\</OutputPath>
    4447    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4548    <DebugType>full</DebugType>
     
    4750    <ErrorReport>prompt</ErrorReport>
    4851    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     52    <Prefer32Bit>false</Prefer32Bit>
    4953  </PropertyGroup>
    5054  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    51     <OutputPath>bin\x64\Release\</OutputPath>
     55    <OutputPath>..\..\bin\</OutputPath>
    5256    <DefineConstants>TRACE</DefineConstants>
    5357    <Optimize>true</Optimize>
     
    5660    <ErrorReport>prompt</ErrorReport>
    5761    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     62    <Prefer32Bit>false</Prefer32Bit>
    5863  </PropertyGroup>
    5964  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    6065    <DebugSymbols>true</DebugSymbols>
    61     <OutputPath>bin\x86\Debug\</OutputPath>
     66    <OutputPath>..\..\bin\</OutputPath>
    6267    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6368    <DebugType>full</DebugType>
     
    6570    <ErrorReport>prompt</ErrorReport>
    6671    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     72    <Prefer32Bit>false</Prefer32Bit>
    6773  </PropertyGroup>
    6874  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    69     <OutputPath>bin\x86\Release\</OutputPath>
     75    <OutputPath>..\..\bin\</OutputPath>
    7076    <DefineConstants>TRACE</DefineConstants>
    7177    <Optimize>true</Optimize>
     
    7480    <ErrorReport>prompt</ErrorReport>
    7581    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     82    <Prefer32Bit>false</Prefer32Bit>
    7683  </PropertyGroup>
    7784  <ItemGroup>
     
    8289  </ItemGroup>
    8390  <ItemGroup>
    84     <Compile Include="Analyzers\BestOrienteeringSolutionAnalyser.cs" />
     91    <Compile Include="Analyzers\BestOrienteeringSolutionAnalyzer.cs" />
    8592    <Compile Include="Creators\GreedyOrienteeringTourCreator.cs" />
    8693    <Compile Include="DistanceMatrix.cs" />
    87     <Compile Include="OrienteeringEvaluation.cs" />
     94    <Compile Include="OrienteeringEvaluationResult.cs" />
    8895    <Compile Include="Improvers\OrienteeringLocalImprovementOperator.cs" />
    8996    <Compile Include="Interfaces\IOrienteeringEvaluator.cs" />
     
    9198    <Compile Include="Interfaces\IOrienteeringSolutionCreator.cs" />
    9299    <Compile Include="OrienteeringProblem.cs" />
    93     <Compile Include="OrienteeringScript.cs" />
    94100    <Compile Include="OrienteeringSolution.cs" />
    95101    <Compile Include="Plugin.cs" />
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs

    r11323 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
     
    3332
    3433namespace HeuristicLab.Problems.Orienteering {
    35   [Item("OrienteeringLocalImprovementOperator", @"Iterative improvement consists of three basic operators: shortening, vertex insert and vertex
    36 exchange. The shortening operator tries to rearrange the vertices within a tour in order to
    37 minimize the cost of the tour. As shortening operator a 2-opt is applied. (Schilde et. al. 2009)")]
     34  /// <summary>
     35  /// Iterative improvement consists of three basic operators: shortening, vertex insert and vertex
     36  /// exchange. The shortening operator tries to rearrange the vertices within a tour in order to
     37  /// minimize the cost of the tour. As shortening operator a 2-opt is applied. (Schilde et. al. 2009)
     38  /// </summary>
     39  [Item("OrienteeringLocalImprovementOperator", @"Implements the iterative improvement procedure described in Schilde M., Doerner K.F., Hartl R.F., Kiechle G. 2009. Metaheuristics for the bi-objective orienteering problem. Swarm Intelligence, Volume 3, Issue 3, pp 179-201.")]
    3840  [StorableClass]
    3941  public sealed class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator {
     
    125127      bool useMaxBlockLength = UseMaximumBlockLengthParmeter.Value.Value;
    126128
    127       bool optimizationDone = true;
     129      bool solutionChanged = true;
    128130
    129131      var tour = IntegerVectorParameter.ActualValue.ToList();
     
    137139
    138140      // Check if the tour can be improved by adding or replacing points
    139       while (optimizationDone && localIterations.Value < maxIterations) {
    140         optimizationDone = false;
     141      while (solutionChanged && localIterations.Value < maxIterations) {
     142        solutionChanged = false;
    141143
    142144        if (localIterations.Value == 0)
     
    152154        IncludeNewPoints(tour, visitablePoints,
    153155          distances, pointVisitingCosts, maxLength, scores,
    154           ref tourLength, ref tourScore, ref evaluations, ref optimizationDone);
     156          ref tourLength, ref tourScore, ref evaluations, ref solutionChanged);
    155157
    156158        // Determine if any of the visitable points can take the place of an already visited point in the tour to improve the scores
    157159        ReplacePoints(tour, visitablePoints,
    158160          distances, maxLength, scores,
    159           ref tourLength, ref tourScore, ref evaluations, ref optimizationDone);
     161          ref tourLength, ref tourScore, ref evaluations, ref solutionChanged);
    160162
    161163        localIterations.Value++;
     
    173175
    174176    private void ShortenPath(List<int> tour, DistanceMatrix distances, int maxBlockLength, bool useMaxBlockLength, ref double tourLength, ref int evaluations) {
    175       bool optimizationDone = true;
     177      bool solutionChanged;
    176178      int pathSize = tour.Count;
    177179      maxBlockLength = (useMaxBlockLength && (pathSize > maxBlockLength + 1)) ? maxBlockLength : (pathSize - 2);
    178180
    179181      // Perform a 2-opt
    180       while (optimizationDone) {
    181         optimizationDone = false;
     182      do {
     183        solutionChanged = false;
    182184
    183185        for (int blockLength = 2; blockLength < maxBlockLength; blockLength++) {
    184186          // If an optimization has been done, start from the beginning
    185           if (optimizationDone) break;
     187          if (solutionChanged) break;
    186188
    187189          for (int position = 1; position < (pathSize - blockLength); position++) {
    188190            // If an optimization has been done, start from the beginning
    189             if (optimizationDone) break;
     191            if (solutionChanged) break;
    190192
    191193            evaluations++;
     
    198200            newLength += distances[tour[position], tour[position + blockLength]];
    199201
    200             if (newLength < tourLength - 0.00001) { // Avoid cycling caused by precision
     202            if (newLength < tourLength - 0.00001) {
     203              // Avoid cycling caused by precision
    201204              var reversePart = tour.GetRange(position, blockLength).AsEnumerable().Reverse();
    202205
     
    207210
    208211              // Re-run the optimization
    209               optimizationDone = true;
     212              solutionChanged = true;
    210213            }
    211214          }
    212215        }
    213       }
    214     }
     216      } while (solutionChanged);
     217    }
     218
    215219    private void IncludeNewPoints(List<int> tour, List<int> visitablePoints,
    216220      DistanceMatrix distances, double pointVisitingCosts, double maxLength, DoubleArray scores,
    217       ref double tourLength, ref double tourScore, ref int evaluations, ref bool optimizationDone) {
     221      ref double tourLength, ref double tourScore, ref int evaluations, ref bool solutionChanged) {
    218222
    219223      for (int tourPosition = 1; tourPosition < tour.Count; tourPosition++) {
    220224        // If an optimization has been done, start from the beginning
    221         if (optimizationDone) break;
     225        if (solutionChanged) break;
    222226
    223227        for (int i = 0; i < visitablePoints.Count; i++) {
    224228          // If an optimization has been done, start from the beginning
    225           if (optimizationDone) break;
     229          if (solutionChanged) break;
    226230
    227231          evaluations++;
     
    239243
    240244            // Re-run this optimization
    241             optimizationDone = true;
     245            solutionChanged = true;
    242246          }
    243247        }
    244248      }
    245249    }
     250
    246251    private void ReplacePoints(List<int> tour, List<int> visitablePoints,
    247252      DistanceMatrix distances, double maxLength, DoubleArray scores,
    248       ref double tourLength, ref double tourScore, ref int evaluations, ref bool optimizationDone) {
     253      ref double tourLength, ref double tourScore, ref int evaluations, ref bool solutionChanged) {
    249254
    250255      for (int tourPosition = 1; tourPosition < tour.Count - 1; tourPosition++) {
    251256        // If an optimization has been done, start from the beginning
    252         if (optimizationDone) break;
     257        if (solutionChanged) break;
    253258
    254259        for (int i = 0; i < visitablePoints.Count; i++) {
    255260          // If an optimization has been done, start from the beginning
    256           if (optimizationDone) break;
     261          if (solutionChanged) break;
    257262
    258263          evaluations++;
     
    274279
    275280            // Re-run this optimization
    276             optimizationDone = true;
     281            solutionChanged = true;
    277282          }
    278283        }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Interfaces/IOrienteeringEvaluator.cs

    r11327 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3434    ILookupParameter<DoubleValue> PenaltyParameter { get; }
    3535
    36     OrienteeringEvaluation Evaluate(IntegerVector solution, DoubleArray scores,
     36    OrienteeringEvaluationResult Evaluate(IntegerVector solution, DoubleArray scores,
    3737      DistanceMatrix distances, double maximumDistance, double pointVisitingCosts);
    3838  }
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Interfaces/IOrienteeringSolutionCreator.cs

    r11321 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringEvaluationResult.cs

    r12693 r12721  
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 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
    122using HeuristicLab.Data;
    223
    324namespace HeuristicLab.Problems.Orienteering {
    4   public class OrienteeringEvaluation {
     25  public class OrienteeringEvaluationResult {
    526    public DoubleValue Quality;
    627    public DoubleValue Penalty;
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs

    r11328 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3434
    3535namespace HeuristicLab.Problems.Orienteering {
    36 
    37   [Item("Orienteering Problem", "Represents a single objective Orienteering Problem.")]
    38   [Creatable("Problems")]
     36  [Item("Orienteering Problem", "Represents a single-objective Orienteering Problem.")]
     37  [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 115)]
    3938  [StorableClass]
    4039  public sealed class OrienteeringProblem
     
    106105      set { BestKnownSolutionParameter.Value = value; }
    107106    }
    108     private BestOrienteeringSolutionAnalyser BestOrienteeringSolutionAnalyser {
    109       get { return Operators.OfType<BestOrienteeringSolutionAnalyser>().SingleOrDefault(); }
     107    private BestOrienteeringSolutionAnalyzer BestOrienteeringSolutionAnalyser {
     108      get { return Operators.OfType<BestOrienteeringSolutionAnalyzer>().SingleOrDefault(); }
    110109    }
    111110    #endregion
     
    268267    }
    269268    private void InitializeOperators() {
    270       Operators.Add(new BestOrienteeringSolutionAnalyser());
     269      Operators.Add(new BestOrienteeringSolutionAnalyzer());
    271270      ParameterizeAnalyzer();
    272271
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringSolution.cs

    r11327 r12721  
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 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
    122using System;
    223using System.Drawing;
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Plugin.cs.frame

    r11307 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2626  /// Plugin class for HeuristicLab.Problems.Orienteering.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Problems.Orienteering", "3.3.10.$WCREV$")]
     28  [Plugin("HeuristicLab.Problems.Orienteering", "3.3.11.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.Orienteering-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Properties/AssemblyInfo.cs.frame

    r11185 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131[assembly: AssemblyCompany("")]
    3232[assembly: AssemblyProduct("HeuristicLab")]
    33 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
     33[assembly: AssemblyCopyright("(c) 2002-2015 HEAL")]
    3434[assembly: AssemblyTrademark("")]
    3535[assembly: AssemblyCulture("")]
     
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.3.0.0")]
    55 [assembly: AssemblyFileVersion("3.3.10.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Shakers/OrienteeringShakingOperator.cs

    r11320 r12721  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232
    3333namespace HeuristicLab.Problems.Orienteering {
    34   [Item("OrienteeringShakingOperator", @"The used neighborhood operator is based on a two point exchange move. A move in
    35 the k-th neighborhood consists of removing k consecutive vertices from the tour, starting
    36 at a randomly selected position. Afterwards, a sorted list of all vertices not yet included
    37 in the current tour is built. The vertices are sorted in descending order with respect to the
    38 objective value increase using the current weights. Out of the first three entries with the
    39 highest ranking in this list, one randomly selected vertex is reinserted into the current tour
    40 at the same position as the removed vertices. This way, l new vertices are inserted into the
    41 tour. The largest neighborhood is a complete exchange of all vertices on the tour.
    42 The shaking procedure does not guarantee that the new tour does not exceed the cost
    43 limit Tmax. Therefore, in a repair step, a sorted list of all vertices in the tour is created. The
    44 vertices are sorted in descending order with respect to costs saved when removing the vertex
    45 from the tour. Vertices are removed as long as the cost limit is violated.
    46 (Schilde et. al. 2009)")]
     34  /// <summary>
     35  /// The used neighborhood operator is based on a two point exchange move. A move in
     36  /// the k-th neighborhood consists of removing k consecutive vertices from the tour, starting
     37  /// at a randomly selected position. Afterwards, a sorted list of all vertices not yet included
     38  /// in the current tour is built. The vertices are sorted in descending order with respect to the
     39  /// objective value increase using the current weights. Out of the first three entries with the
     40  /// highest ranking in this list, one randomly selected vertex is reinserted into the current tour
     41  /// at the same position as the removed vertices. This way, l new vertices are inserted into the
     42  /// tour. The largest neighborhood is a complete exchange of all vertices on the tour.
     43  /// The shaking procedure does not guarantee that the new tour does not exceed the cost
     44  /// limit Tmax. Therefore, in a repair step, a sorted list of all vertices in the tour is created. The
     45  /// vertices are sorted in descending order with respect to costs saved when removing the vertex
     46  /// from the tour. Vertices are removed as long as the cost limit is violated.
     47  /// (Schilde et. al. 2009)
     48  /// </summary>
     49  [Item("OrienteeringShakingOperator", @"Implements the shaking procedure described in Schilde M., Doerner K.F., Hartl R.F., Kiechle G. 2009. Metaheuristics for the bi-objective orienteering problem. Swarm Intelligence, Volume 3, Issue 3, pp 179-201.")]
    4750  [StorableClass]
    4851  public sealed class OrienteeringShakingOperator : SingleSuccessorOperator, IMultiNeighborhoodShakingOperator, IStochasticOperator {
     
    131134        int maximumNeighborhood = initialTour.Length - 2; // neighborhood limit within [0, changable tour length - 1)
    132135        maximumNeighborhood = (maximumNeighborhood > currentNeighborhood) ? currentNeighborhood : maximumNeighborhood;
    133         int neighborhood = maximumNeighborhood;//random.Next(maximumNeighborhood) + 1;
     136        int neighborhood = maximumNeighborhood;
    134137
    135138        // Find all points that are not yet included in the tour and are
     
    165168      return base.Apply();
    166169    }
     170
    167171    private void InsertPoints(List<int> actualTour, IntegerVector initialTour,
    168172      int neighborhood, List<int> visitablePoints, IRandom random) {
     
    208212      }
    209213    }
     214
    210215    private void CleanupTour(List<int> actualTour, DistanceMatrix distances, double maxDistance, double pointVisitingCosts) {
    211216      // Sort the points on the tour according to their costs savings when removed
     
    235240      }
    236241    }
    237     //
     242
    238243    private class SavingInfo {
    239244      public int Index;
Note: See TracChangeset for help on using the changeset viewer.