@Override protected void updateEstimator(long measuredRTT, int estimatorType, RemoteEndpoint endpoint) { long RTTVAR = Math.round((double)(1-BETA)*endpoint.getxRTTVAR(estimatorType)) + Math.round((double)(BETA*Math.abs(endpoint.getxRTT(estimatorType)-measuredRTT))); long RTT = Math.round((double)(endpoint.getxRTT(estimatorType)*(1-ALPHA))) + Math.round((double)(measuredRTT*ALPHA)); long RTO = RTT + kValue[estimatorType-1]*RTTVAR; long newRTO = Math.round((double)RTO*(weighting[estimatorType-1]) + Math.round((double)(endpoint.getRTO()*(1-weighting[estimatorType-1])))); endpoint.setEstimatorValues(RTO, RTT, RTTVAR, estimatorType); endpoint.setRTOtimestamp(System.currentTimeMillis(), estimatorType); endpoint.setRTOtimestamp(System.currentTimeMillis(), OVERALLRTOTYPE); //System.out.println("RTO:" + RTO + " RTT:" + RTT + " RTTVAR:" + RTTVAR + " (Type:" + estimatorType + ")"); endpoint.updateRTO(newRTO); }
@Override protected void updateEstimator(long measuredRTT, int estimatorType, RemoteEndpoint endpoint) { long RTTVAR = Math.round((double)(1-BETA)*endpoint.getxRTTVAR(estimatorType)) + Math.round((double)(BETA*Math.abs(endpoint.getxRTT(estimatorType)-measuredRTT))); long RTT = Math.round((double)(endpoint.getxRTT(estimatorType)*(1-ALPHA))) + Math.round((double)(measuredRTT*ALPHA)); long RTO = RTT + kValue[estimatorType-1]*RTTVAR; long newRTO = Math.round((double)RTO*(weighting[estimatorType-1]) + Math.round((double)(endpoint.getRTO()*(1-weighting[estimatorType-1])))); endpoint.setEstimatorValues(RTO, RTT, RTTVAR, estimatorType); endpoint.setRTOtimestamp(System.currentTimeMillis(), estimatorType); endpoint.setRTOtimestamp(System.currentTimeMillis(), OVERALLRTOTYPE); //System.out.println("RTO:" + RTO + " RTT:" + RTT + " RTTVAR:" + RTTVAR + " (Type:" + estimatorType + ")"); endpoint.updateRTO(newRTO); }