コード例 #1
0
ファイル: testAgent.py プロジェクト: rcalsaverini/PyAuthority
 def testAveragePathLengthEmpty(self):
     agent = Agent(n=10, topology='Empty')
     self.assertEqual(agent.averagePathLength(), Inf)
コード例 #2
0
ファイル: testAgent.py プロジェクト: rcalsaverini/PyAuthority
 def testAveragePathLengthStar(self):
     for j in xrange(5,20):
         n = float(j)
         agent = Agent(n=j, topology='Star')
         self.assertEqual(agent.averagePathLength(),(n-1)*2.0/n )
コード例 #3
0
ファイル: testAgent.py プロジェクト: rcalsaverini/PyAuthority
 def testAveragePathLengthFull(self):
     agent = Agent(n=10, topology='Full')
     self.assertEqual(1.0, agent.averagePathLength())