def configure(self, base=None, nsuccess=None, nfailure=None, timeout=None, **kwargs): """Configure rate adaptation parameters. :param base: Base rate used to initialize `RateAdapt` component [default=0]. :param nsuccess: Threshold for number of consecutive ACKs that must be received prior to increasing the data rate. :param nfailure: Threshold for number of consecutive ACK failures that will trigger a decrease in the data rate. :param timeout: Timeout that can automatically trigger """ DCF.configure(self, **kwargs) if base is None: base = 0 if nsuccess is None: nsuccess = ARF_NSUCCESS if nfailure is None: nfailure = ARF_NFAILURE if timeout is None: timeout = ARF_TIMEOUT ra = self.newchild("ra", RateAdapt, base=base, tracename=self.tracename+".RA") ra.set_rate(self.broadcast) # use default base rate for broadcast # create FSM to manage ARF fsm = self.newchild("manager", FSM, tracename=self.tracename+".MGR") fsm.goto(self.MGR) # set other parameters self.nsuccess = nsuccess self.nfailure = nfailure self.timeout = timeout self.ackcount = {} self.arftimer = {} self.probation = {}
def configure(self, base=None, thresh=None, **kwargs): """Configure rate adaptation parameters. :param base: Base rate used to initialize `RateAdapt` component [default=0]. :param thresh: Dictionary containing minimum SNR threshold corresponding to rate specific index [default=`RBAR_THRESHOLD`]. """ DCF.configure(self, **kwargs) if base is None: base = 0 if thresh is None: thresh = RBAR_THRESHOLD ra = self.newchild("ra", RateAdapt, base=base, tracename=self.tracename+".RA") ra.set_rate(self.broadcast) # use default base rate for broadcast self.thresh = thresh