- Timestamp:
- 03/19/15 17:16:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPAnalyticalInversionMovePathEvaluator.cs
r12219 r12228 35 35 public class PTSPAnalyticalInversionMovePathEvaluator : PTSPPathMoveEvaluator, IPermutationInversionMoveOperator { 36 36 37 private static ItemList<DoubleValue>probabilities;37 private static DoubleArray probabilities; 38 38 private static DoubleMatrix A; 39 39 private static DoubleMatrix B; … … 46 46 } 47 47 48 public IValueParameter< ItemList<DoubleValue>> ProbabilitiesParameter {49 get { return (IValueParameter< ItemList<DoubleValue>>)Parameters["Probabilities"]; }48 public IValueParameter<DoubleArray> ProbabilitiesParameter { 49 get { return (IValueParameter<DoubleArray>)Parameters["Probabilities"]; } 50 50 } 51 51 … … 103 103 case 1: 104 104 if (j == i + 1) { 105 return (1/(1-probabilities[i+1] .Value))*A[i,2]+(1 - probabilities[i].Value)*(A[i+1,1]-A[i+1,probabilities.Capacity-1]);105 return (1/(1-probabilities[i+1]))*A[i,2]+(1 - probabilities[i])*(A[i+1,1]-A[i+1,probabilities.Length-1]); 106 106 } else if (i == j) { 107 107 return A[i,1]; 108 108 } else { 109 109 // Equation 25 110 return ((1 - probabilities[i] .Value) / (1 - probabilities[j].Value)) * RecursiveExpectedCost(1, i + 1, j - 1) + (1 - probabilities[i].Value) * (1);110 return ((1 - probabilities[i]) / (1 - probabilities[j])) * RecursiveExpectedCost(1, i + 1, j - 1) + (1 - probabilities[i]) * (1); 111 111 } 112 112 113 113 case 2: 114 114 if (j == i + 1) { 115 return (1 - probabilities[i + 1] .Value) * (B[i, 1] - B[i, probabilities.Capacity - 1]) + (1 / (1 - probabilities[i].Value)) * (B[i + 1, 2]);115 return (1 - probabilities[i + 1]) * (B[i, 1] - B[i, probabilities.Length - 1]) + (1 / (1 - probabilities[i])) * (B[i + 1, 2]); 116 116 } else if (i == j) { 117 117 return B[i,1]; … … 123 123 case 3: 124 124 if (j == i + 1) { 125 return A[i, 2] + A[i + 1, 1] - A[i + 1, probabilities. Capacity - 1] + B[i, 1] - B[i, probabilities.Capacity- 1] + B[i + 1, 2];125 return A[i, 2] + A[i + 1, 1] - A[i + 1, probabilities.Length - 1] + B[i, 1] - B[i, probabilities.Length - 1] + B[i + 1, 2]; 126 126 } else if (i == j) { 127 127 return A[i,1]+B[i,1];
Note: See TracChangeset
for help on using the changeset viewer.