コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
ファイル: MAS_network.py プロジェクト: megacell/MASS-attacks
 def throughputs(self, eps=1e-8):
     # get throughputs by solving the balanced equations before attacks
     return r_2_pi(self.routing, eps)
コード例 #4
0
ファイル: MAS_network.py プロジェクト: megacell/MASS-attacks
 def new_throughputs(self, eps=1e-8):
     # get throughputs by solving the balanced equations after attacks
     return r_2_pi(self.new_routing, eps)
コード例 #5
0
ファイル: MAS_network.py プロジェクト: megacell/MASS-attacks
 def throughputs(self, eps=1e-8):
     # get throughputs by solving the balanced equations before attacks
     return r_2_pi(self.routing, eps)
コード例 #6
0
ファイル: MAS_network.py プロジェクト: megacell/MASS-attacks
 def new_throughputs(self, eps=1e-8):
     # get throughputs by solving the balanced equations after attacks
     return r_2_pi(self.new_routing, eps)