Changeset 11194 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs
- Timestamp:
- 07/16/14 14:39:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs
r11193 r11194 37 37 minimize the cost of the tour. As shortening operator a 2-opt is applied. (Schilde et. al. 2009)")] 38 38 [StorableClass] 39 public class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator , IStochasticOperator{39 public class OrienteeringLocalImprovementOperator : SingleSuccessorOperator, ILocalImprovementOperator { 40 40 #region IGenericLocalImprovementOperator Properties 41 41 public Type ProblemType { get { return typeof(OrienteeringProblem); } } … … 81 81 get { return (ILookupParameter<DoubleValue>)Parameters["FixedPenalty"]; } 82 82 } 83 public ILookupParameter<IRandom> RandomParameter {84 get { return (ILookupParameter<IRandom>)Parameters["Random"]; }85 }86 83 #region ILocalImprovementOperator Parameters 87 84 public IValueLookupParameter<IntValue> MaximumIterationsParameter { … … 106 103 public OrienteeringLocalImprovementOperator() 107 104 : base() { 105 Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The Orienteering Solution given in path representation.")); 108 106 Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the points.")); 109 107 Parameters.Add(new LookupParameter<DoubleArray>("Scores", "The scores of the points.")); … … 112 110 Parameters.Add(new LookupParameter<IntValue>("TerminusPoint", "Index of the ending point.")); 113 111 Parameters.Add(new LookupParameter<DoubleValue>("FixedPenalty", "The penalty for each visited vertex.")); 114 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));115 112 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.", new IntValue(150))); 116 113 Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated moves.")); … … 130 127 131 128 public override IOperation Apply() { 129 // TODO Use LocalImprovementorOperator Parameters 130 132 131 int numPoints = ScoresParameter.ActualValue.Length; 133 132 var distances = DistanceMatrixParameter.ActualValue; … … 136 135 137 136 bool optimizationDone = true; 138 bool isFeasible = true;139 137 140 138 // Find the maximum distance restriction … … 227 225 if (optimizationDone) break; 228 226 229 double detour = distances.CalculateInsertionCost (tour, tourPosition, visitablePoints[i], fixedPenalty);227 double detour = distances.CalculateInsertionCosts(tour, tourPosition, visitablePoints[i], fixedPenalty); 230 228 231 229 // Determine if including the point does not violate any constraint … … 255 253 if (optimizationDone) break; 256 254 257 double detour = distances.CalculateReplacementCost (tour, tourPosition, visitablePoints[i]);255 double detour = distances.CalculateReplacementCosts(tour, tourPosition, visitablePoints[i]); 258 256 259 257 double oldPointScore = scores[tour[tourPosition]];
Note: See TracChangeset
for help on using the changeset viewer.