def objective(self, nu): # compute the availabilities and the objective at nu self.check_nu(nu) # compute the combined routing matrix and the combined rate lam = self.phi + nu tmp = np.dot(np.diag(nu), self.kappa) + np.dot(np.diag(self.phi), self.delta) inverse_lam = np.divide(np.ones(self.N,), lam) r = np.dot(np.diag(inverse_lam), tmp) # compute the availabilities pi = r_2_pi(r) a = pi_2_a(pi, lam) # compute the objective obj = np.sum(np.multiply(self.w, a)) return obj, a
def objective(self, nu): # compute the availabilities and the objective at nu self.check_nu(nu) # compute the combined routing matrix and the combined rate lam = self.phi + nu tmp = np.dot(np.diag(nu), self.kappa) + np.dot(np.diag(self.phi), self.delta) inverse_lam = np.divide(np.ones(self.N, ), lam) r = np.dot(np.diag(inverse_lam), tmp) # compute the availabilities pi = r_2_pi(r) a = pi_2_a(pi, lam) # compute the objective obj = np.sum(np.multiply(self.w, a)) return obj, a
def new_availabilities(self, eps=1e-8): # get asymptotic availabilities at each station after the attacks return pi_2_a(self.new_throughputs(eps), self.new_rates)
def availabilities(self, eps=1e-8): # get asymptotic availabilities at each station before the attacks return pi_2_a(self.throughputs(eps), self.rates)