示例#1
0
 def test_endpoint(self):
     size = 1000
     poly = Polymer(size)
     poly.make_environment()
     poly.compute_actions()
     path = poly.compute_path()
     end = poly.compute_endpoint()
     self.assertTrue(abs(path[-1] - end) <= 1)
示例#2
0
 def test_endpoint(self):
     size = 1000
     poly = Polymer(size)
     poly.make_environment()
     poly.compute_actions()
     path = poly.compute_path()
     end = poly.compute_endpoint()
     self.assertTrue(abs(path[-1] - end) <= 1)
示例#3
0
 def test_tau(self):
     size = 1000
     poly = Polymer(size)
     poly.make_environment()
     poly.compute_actions()
     path = poly.compute_path()
     end = poly.compute_endpoint()
     tau = poly.compute_tau()
     self.assertTrue(abs(end) > abs(path[tau-1])) 
示例#4
0
 def test_tau(self):
     size = 1000
     poly = Polymer(size)
     poly.make_environment()
     poly.compute_actions()
     path = poly.compute_path()
     end = poly.compute_endpoint()
     tau = poly.compute_tau()
     self.assertTrue(abs(end) > abs(path[tau - 1]))
示例#5
0
 def test_end_discrepancy(self):
     size = 1000
     exponent = 0.5
     constant = 10
     poly = Polymer(size)
     poly.make_environment()
     poly.compute_actions()
     path = poly.compute_path()
     end = poly.compute_endpoint()
     self.assertTrue(poly.discrepancy(end) < constant*pow(abs(float(end)), -exponent) )
示例#6
0
 def test_end_discrepancy(self):
     size = 1000
     exponent = 0.5
     constant = 10
     poly = Polymer(size)
     poly.make_environment()
     poly.compute_actions()
     path = poly.compute_path()
     end = poly.compute_endpoint()
     self.assertTrue(
         poly.discrepancy(end) < constant * pow(abs(float(end)), -exponent))