def update(self, arm, reward):
    self.sw_arm.append(arm)
    self.sw_r.append(reward)
    self.r[arm] += reward
    self.returns += reward
    self.n[arm] += 1
    tau_prime = torch.min(torch.ceil((self.lamb * (self.t ** self.alpha))), self.t)
    delta_tau = (tau_prime - self.tau)
    if (delta_tau < 1.0):
        arm = self.sw_arm.pop(0)
        self.r[arm] -= [self.sw_r.pop(0)]
        self.n[arm] -= 1
    self.tau = tau_prime
def update(self, arm, reward):
    self.sw_arm.append(arm)
    self.sw_r.append(reward)
    self.r[arm] += reward
    self.returns += reward
    self.n[arm] += 1
    tau_prime = torch.min(torch.ceil((self.lamb * (self.t ** self.alpha))), self.t)
    delta_tau = (tau_prime - self.tau)
    if (delta_tau < 1.0):
        arm = self.sw_arm.pop(0)
        self.r[arm] -= [self.sw_r.pop(0)]
        self.n[arm] -= 1
    self.tau = tau_prime