- Timestamp:
- 07/10/15 16:38:17 (9 years ago)
- 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 2 2 obj 3 3 Plugin.cs 4 *.DotSettings
-
- Property svn:ignore
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Analyzers/BestOrienteeringSolutionAnalyzer.cs
r12693 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 32 32 namespace HeuristicLab.Problems.Orienteering { 33 public sealed class BestOrienteeringSolutionAnaly ser : SingleSuccessorOperator, IAnalyzer {33 public sealed class BestOrienteeringSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer { 34 34 public bool EnabledByDefault { 35 35 get { return true; } … … 78 78 79 79 [StorableConstructor] 80 private BestOrienteeringSolutionAnaly ser(bool deserializing) : base(deserializing) { }81 private BestOrienteeringSolutionAnaly ser(BestOrienteeringSolutionAnalyser original, Cloner cloner) : base(original, cloner) { }80 private BestOrienteeringSolutionAnalyzer(bool deserializing) : base(deserializing) { } 81 private BestOrienteeringSolutionAnalyzer(BestOrienteeringSolutionAnalyzer original, Cloner cloner) : base(original, cloner) { } 82 82 public override IDeepCloneable Clone(Cloner cloner) { 83 return new BestOrienteeringSolutionAnaly ser(this, cloner);83 return new BestOrienteeringSolutionAnalyzer(this, cloner); 84 84 } 85 public BestOrienteeringSolutionAnaly ser()85 public BestOrienteeringSolutionAnalyzer() 86 86 : base() { 87 87 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 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 30 30 31 31 namespace 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.")] 37 41 [StorableClass] 38 42 public sealed class GreedyOrienteeringTourCreator : IntegerVectorCreator, IOrienteeringSolutionCreator { … … 80 84 } 81 85 82 protected override IntegerVector Create(IRandom _, IntValue __, IntMatrix ___) {86 protected override IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds) { 83 87 int startPoint = StartingPointParameter.ActualValue.Value; 84 88 int endPoint = TerminalPointParameter.ActualValue.Value; … … 105 109 endPoint 106 110 }; 107 double length = distances[startPoint, endPoint];111 double tourLength = distances[startPoint, endPoint]; 108 112 109 113 // Add points in a greedy way … … 118 122 119 123 // If the insertion would be feasible, perform it 120 if ( length + detour <= maxDistance) {124 if (tourLength + detour <= maxDistance) { 121 125 tour.Insert(insertPosition, feasiblePoints[i]); 122 length += detour;126 tourLength += detour; 123 127 feasiblePoints.RemoveAt(i); 124 128 insertionPerformed = true; -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/DistanceMatrix.cs
r11320 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Evaluators/OrienteeringEvaluator.cs
r11327 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 30 30 31 31 namespace HeuristicLab.Problems.Orienteering { 32 [Item("OrienteeringEvaluator", "Operator to evaluate a solution to the orienteering problem.")] 33 [StorableClass] 32 34 public class OrienteeringEvaluator : InstrumentedOperator, IOrienteeringEvaluator { 33 35 … … 82 84 } 83 85 84 public static OrienteeringEvaluation Apply(IntegerVector solution, DoubleArray scores,86 public static OrienteeringEvaluationResult Apply(IntegerVector solution, DoubleArray scores, 85 87 DistanceMatrix distances, double maximumDistance, double pointVisitingCosts, double distancePenaltyFactor) { 86 88 … … 95 97 double quality = score - penalty; 96 98 97 return new OrienteeringEvaluation {99 return new OrienteeringEvaluationResult { 98 100 Quality = new DoubleValue(quality), 99 101 Penalty = new DoubleValue(penalty), … … 113 115 } 114 116 115 public OrienteeringEvaluation Evaluate(IntegerVector solution, DoubleArray scores,117 public OrienteeringEvaluationResult Evaluate(IntegerVector solution, DoubleArray scores, 116 118 DistanceMatrix distances, double maximumDistance, double pointVisitingCosts) { 117 119 return Apply(solution, scores, distances, maximumDistance, pointVisitingCosts, -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj
r11327 r12721 10 10 <RootNamespace>HeuristicLab.Problems.Orienteering</RootNamespace> 11 11 <AssemblyName>HeuristicLab.Problems.Orienteering-3.3</AssemblyName> 12 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>12 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 13 13 <FileAlignment>512</FileAlignment> 14 <TargetFrameworkProfile /> 14 15 </PropertyGroup> 15 16 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 21 22 <ErrorReport>prompt</ErrorReport> 22 23 <WarningLevel>4</WarningLevel> 24 <Prefer32Bit>false</Prefer32Bit> 23 25 </PropertyGroup> 24 26 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 29 31 <ErrorReport>prompt</ErrorReport> 30 32 <WarningLevel>4</WarningLevel> 33 <Prefer32Bit>false</Prefer32Bit> 31 34 </PropertyGroup> 32 35 <PropertyGroup> … … 41 44 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> 42 45 <DebugSymbols>true</DebugSymbols> 43 <OutputPath> bin\x64\Debug\</OutputPath>46 <OutputPath>..\..\bin\</OutputPath> 44 47 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 48 <DebugType>full</DebugType> … … 47 50 <ErrorReport>prompt</ErrorReport> 48 51 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 52 <Prefer32Bit>false</Prefer32Bit> 49 53 </PropertyGroup> 50 54 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> 51 <OutputPath> bin\x64\Release\</OutputPath>55 <OutputPath>..\..\bin\</OutputPath> 52 56 <DefineConstants>TRACE</DefineConstants> 53 57 <Optimize>true</Optimize> … … 56 60 <ErrorReport>prompt</ErrorReport> 57 61 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 62 <Prefer32Bit>false</Prefer32Bit> 58 63 </PropertyGroup> 59 64 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 60 65 <DebugSymbols>true</DebugSymbols> 61 <OutputPath> bin\x86\Debug\</OutputPath>66 <OutputPath>..\..\bin\</OutputPath> 62 67 <DefineConstants>DEBUG;TRACE</DefineConstants> 63 68 <DebugType>full</DebugType> … … 65 70 <ErrorReport>prompt</ErrorReport> 66 71 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 72 <Prefer32Bit>false</Prefer32Bit> 67 73 </PropertyGroup> 68 74 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 69 <OutputPath> bin\x86\Release\</OutputPath>75 <OutputPath>..\..\bin\</OutputPath> 70 76 <DefineConstants>TRACE</DefineConstants> 71 77 <Optimize>true</Optimize> … … 74 80 <ErrorReport>prompt</ErrorReport> 75 81 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 82 <Prefer32Bit>false</Prefer32Bit> 76 83 </PropertyGroup> 77 84 <ItemGroup> … … 82 89 </ItemGroup> 83 90 <ItemGroup> 84 <Compile Include="Analyzers\BestOrienteeringSolutionAnaly ser.cs" />91 <Compile Include="Analyzers\BestOrienteeringSolutionAnalyzer.cs" /> 85 92 <Compile Include="Creators\GreedyOrienteeringTourCreator.cs" /> 86 93 <Compile Include="DistanceMatrix.cs" /> 87 <Compile Include="OrienteeringEvaluation .cs" />94 <Compile Include="OrienteeringEvaluationResult.cs" /> 88 95 <Compile Include="Improvers\OrienteeringLocalImprovementOperator.cs" /> 89 96 <Compile Include="Interfaces\IOrienteeringEvaluator.cs" /> … … 91 98 <Compile Include="Interfaces\IOrienteeringSolutionCreator.cs" /> 92 99 <Compile Include="OrienteeringProblem.cs" /> 93 <Compile Include="OrienteeringScript.cs" />94 100 <Compile Include="OrienteeringSolution.cs" /> 95 101 <Compile Include="Plugin.cs" /> -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs
r11323 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Linq; … … 33 32 34 33 namespace 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.")] 38 40 [StorableClass] 39 41 public sealed class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator { … … 125 127 bool useMaxBlockLength = UseMaximumBlockLengthParmeter.Value.Value; 126 128 127 bool optimizationDone= true;129 bool solutionChanged = true; 128 130 129 131 var tour = IntegerVectorParameter.ActualValue.ToList(); … … 137 139 138 140 // 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; 141 143 142 144 if (localIterations.Value == 0) … … 152 154 IncludeNewPoints(tour, visitablePoints, 153 155 distances, pointVisitingCosts, maxLength, scores, 154 ref tourLength, ref tourScore, ref evaluations, ref optimizationDone);156 ref tourLength, ref tourScore, ref evaluations, ref solutionChanged); 155 157 156 158 // Determine if any of the visitable points can take the place of an already visited point in the tour to improve the scores 157 159 ReplacePoints(tour, visitablePoints, 158 160 distances, maxLength, scores, 159 ref tourLength, ref tourScore, ref evaluations, ref optimizationDone);161 ref tourLength, ref tourScore, ref evaluations, ref solutionChanged); 160 162 161 163 localIterations.Value++; … … 173 175 174 176 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; 176 178 int pathSize = tour.Count; 177 179 maxBlockLength = (useMaxBlockLength && (pathSize > maxBlockLength + 1)) ? maxBlockLength : (pathSize - 2); 178 180 179 181 // Perform a 2-opt 180 while (optimizationDone){181 optimizationDone= false;182 do { 183 solutionChanged = false; 182 184 183 185 for (int blockLength = 2; blockLength < maxBlockLength; blockLength++) { 184 186 // If an optimization has been done, start from the beginning 185 if ( optimizationDone) break;187 if (solutionChanged) break; 186 188 187 189 for (int position = 1; position < (pathSize - blockLength); position++) { 188 190 // If an optimization has been done, start from the beginning 189 if ( optimizationDone) break;191 if (solutionChanged) break; 190 192 191 193 evaluations++; … … 198 200 newLength += distances[tour[position], tour[position + blockLength]]; 199 201 200 if (newLength < tourLength - 0.00001) { // Avoid cycling caused by precision 202 if (newLength < tourLength - 0.00001) { 203 // Avoid cycling caused by precision 201 204 var reversePart = tour.GetRange(position, blockLength).AsEnumerable().Reverse(); 202 205 … … 207 210 208 211 // Re-run the optimization 209 optimizationDone= true;212 solutionChanged = true; 210 213 } 211 214 } 212 215 } 213 } 214 } 216 } while (solutionChanged); 217 } 218 215 219 private void IncludeNewPoints(List<int> tour, List<int> visitablePoints, 216 220 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) { 218 222 219 223 for (int tourPosition = 1; tourPosition < tour.Count; tourPosition++) { 220 224 // If an optimization has been done, start from the beginning 221 if ( optimizationDone) break;225 if (solutionChanged) break; 222 226 223 227 for (int i = 0; i < visitablePoints.Count; i++) { 224 228 // If an optimization has been done, start from the beginning 225 if ( optimizationDone) break;229 if (solutionChanged) break; 226 230 227 231 evaluations++; … … 239 243 240 244 // Re-run this optimization 241 optimizationDone= true;245 solutionChanged = true; 242 246 } 243 247 } 244 248 } 245 249 } 250 246 251 private void ReplacePoints(List<int> tour, List<int> visitablePoints, 247 252 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) { 249 254 250 255 for (int tourPosition = 1; tourPosition < tour.Count - 1; tourPosition++) { 251 256 // If an optimization has been done, start from the beginning 252 if ( optimizationDone) break;257 if (solutionChanged) break; 253 258 254 259 for (int i = 0; i < visitablePoints.Count; i++) { 255 260 // If an optimization has been done, start from the beginning 256 if ( optimizationDone) break;261 if (solutionChanged) break; 257 262 258 263 evaluations++; … … 274 279 275 280 // Re-run this optimization 276 optimizationDone= true;281 solutionChanged = true; 277 282 } 278 283 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Interfaces/IOrienteeringEvaluator.cs
r11327 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 34 34 ILookupParameter<DoubleValue> PenaltyParameter { get; } 35 35 36 OrienteeringEvaluation Evaluate(IntegerVector solution, DoubleArray scores,36 OrienteeringEvaluationResult Evaluate(IntegerVector solution, DoubleArray scores, 37 37 DistanceMatrix distances, double maximumDistance, double pointVisitingCosts); 38 38 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Interfaces/IOrienteeringSolutionCreator.cs
r11321 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * 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 1 22 using HeuristicLab.Data; 2 23 3 24 namespace HeuristicLab.Problems.Orienteering { 4 public class OrienteeringEvaluation {25 public class OrienteeringEvaluationResult { 5 26 public DoubleValue Quality; 6 27 public DoubleValue Penalty; -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs
r11328 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 34 34 35 35 namespace 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)] 39 38 [StorableClass] 40 39 public sealed class OrienteeringProblem … … 106 105 set { BestKnownSolutionParameter.Value = value; } 107 106 } 108 private BestOrienteeringSolutionAnaly ser BestOrienteeringSolutionAnalyser {109 get { return Operators.OfType<BestOrienteeringSolutionAnaly ser>().SingleOrDefault(); }107 private BestOrienteeringSolutionAnalyzer BestOrienteeringSolutionAnalyser { 108 get { return Operators.OfType<BestOrienteeringSolutionAnalyzer>().SingleOrDefault(); } 110 109 } 111 110 #endregion … … 268 267 } 269 268 private void InitializeOperators() { 270 Operators.Add(new BestOrienteeringSolutionAnaly ser());269 Operators.Add(new BestOrienteeringSolutionAnalyzer()); 271 270 ParameterizeAnalyzer(); 272 271 -
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 1 22 using System; 2 23 using System.Drawing; -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Plugin.cs.frame
r11307 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 /// Plugin class for HeuristicLab.Problems.Orienteering. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Problems.Orienteering", "3.3.1 0.$WCREV$")]28 [Plugin("HeuristicLab.Problems.Orienteering", "3.3.11.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.Orienteering-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Properties/AssemblyInfo.cs.frame
r11185 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [assembly: AssemblyCompany("")] 32 32 [assembly: AssemblyProduct("HeuristicLab")] 33 [assembly: AssemblyCopyright("(c) 2002-201 4HEAL")]33 [assembly: AssemblyCopyright("(c) 2002-2015 HEAL")] 34 34 [assembly: AssemblyTrademark("")] 35 35 [assembly: AssemblyCulture("")] … … 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.3.0.0")] 55 [assembly: AssemblyFileVersion("3.3.1 0.$WCREV$")]55 [assembly: AssemblyFileVersion("3.3.11.$WCREV$")] -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Shakers/OrienteeringShakingOperator.cs
r11320 r12721 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 33 33 namespace 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.")] 47 50 [StorableClass] 48 51 public sealed class OrienteeringShakingOperator : SingleSuccessorOperator, IMultiNeighborhoodShakingOperator, IStochasticOperator { … … 131 134 int maximumNeighborhood = initialTour.Length - 2; // neighborhood limit within [0, changable tour length - 1) 132 135 maximumNeighborhood = (maximumNeighborhood > currentNeighborhood) ? currentNeighborhood : maximumNeighborhood; 133 int neighborhood = maximumNeighborhood; //random.Next(maximumNeighborhood) + 1;136 int neighborhood = maximumNeighborhood; 134 137 135 138 // Find all points that are not yet included in the tour and are … … 165 168 return base.Apply(); 166 169 } 170 167 171 private void InsertPoints(List<int> actualTour, IntegerVector initialTour, 168 172 int neighborhood, List<int> visitablePoints, IRandom random) { … … 208 212 } 209 213 } 214 210 215 private void CleanupTour(List<int> actualTour, DistanceMatrix distances, double maxDistance, double pointVisitingCosts) { 211 216 // Sort the points on the tour according to their costs savings when removed … … 235 240 } 236 241 } 237 // 242 238 243 private class SavingInfo { 239 244 public int Index;
Note: See TracChangeset
for help on using the changeset viewer.