- Timestamp:
- 03/26/15 16:14:52 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPEstimatedInversionMovePathEvaluator.cs
r12219 r12261 100 100 // find nearest predecessor in realization if source edge 101 101 while(realization[permutation.GetCircular(indices[i]-j)].Value==0) { 102 j --;102 j++; 103 103 } 104 104 aPosteriori[i] = permutation.GetCircular(indices[i] - j); … … 113 113 } 114 114 // compute cost difference between the two a posteriori solutions 115 moveQuality += distanceMatrix[aPosteriori[0], aPosteriori[2]] + distanceMatrix[aPosteriori[1], aPosteriori[3]]; 116 moveQuality -= distanceMatrix[aPosteriori[0], aPosteriori[1]] - distanceMatrix[aPosteriori[2], aPosteriori[3]]; 115 if (!(aPosteriori[0] == aPosteriori[2] && aPosteriori[1] == aPosteriori[3])) { 116 moveQuality = moveQuality + distanceMatrix[aPosteriori[0], aPosteriori[2]] + distanceMatrix[aPosteriori[1], aPosteriori[3]] - distanceMatrix[aPosteriori[0], aPosteriori[1]] - distanceMatrix[aPosteriori[2], aPosteriori[3]]; 117 } 118 Array.Clear(aPosteriori, 0, aPosteriori.Length); 117 119 } 118 120 // return average of cost differences 119 return moveQuality/ realizations.Capacity;121 return Math.Abs(moveQuality) / realizations.Capacity; 120 122 } 121 123
Note: See TracChangeset
for help on using the changeset viewer.