ns-allinone-2.35/ns-2.35/dccp/dccp_tcplike.cc
bool DCCPTCPlikeAgent::checkAckRatio(){
	bool result = false;
	int temp = cwnd_ / 2;
	if (cwnd_ % 2 > 0)
		temp++;

	//ackratio is never greater than half cwnd (rounded up)
	if(recv_ack_ratio_ > temp){  
		recv_ack_ratio_ = temp;
		result = true;
	}
	//ack ratio always >= 2 for cwnd >= 4
	if (cwnd_ >= 4 && recv_ack_ratio_ < 2){
		recv_ack_ratio_ = 2;
		result = true;
	} else if (recv_ack_ratio_ == 0){  //always an integer > 0
		recv_ack_ratio_ = 1;
		result = true;
	}

	return result;
}
/* Check the constraints on the ack ratio (recv_ack_ratio_)
 * ret: true if the ack ratio was changed due to constraints
 *      false otherwise
 */
Check the constraints on the ack ratio (recv_ack_ratio_)
ret: true if the ack ratio was changed due to constraints
false otherwise
Check the constraints on the ack ratio ( recv_ack_ratio_ ) ret : true if the ack ratio was changed due to constraints false otherwise
bool DCCPTCPlikeAgent::checkAckRatio(){
	bool result = false;
	int temp = cwnd_ / 2;
	if (cwnd_ % 2 > 0)
		temp++;
	if(recv_ack_ratio_ > temp){  
		recv_ack_ratio_ = temp;
		result = true;
	}
	if (cwnd_ >= 4 && recv_ack_ratio_ < 2){
		recv_ack_ratio_ = 2;
		result = true;
	} else if (recv_ack_ratio_ == 0){  
		recv_ack_ratio_ = 1;
		result = true;
	}
	return result;
}
bool DCCPTCPlikeAgent :: checkAckRatio ( ) { bool result = false ; int temp = cwnd_ / 2 ; if ( cwnd_ % 2 > 0 ) temp ++ ; if ( recv_ack_ratio_ > temp ) { recv_ack_ratio_ = temp ; result = true ; } if ( cwnd_ >= 4 && recv_ack_ratio_ < 2 ) { recv_ack_ratio_ = 2 ; result = true ; } else if ( recv_ack_ratio_ == 0 ) { recv_ack_ratio_ = 1 ; result = true ; } return result ; }
Check the constraints on the ack ratio (recv_ack_ratio_)
 ret: true if the ack ratio was changed due to constraints
      false otherwise
Check the constraints on the ack ratio ( recv_ack_ratio_ ) ret : true if the ack ratio was changed due to constraints false otherwise
//ackratio is never greater than half cwnd (rounded up) //ack ratio always >= 2 for cwnd >= 4 //always an integer > 0