Beispiel #1
0
 def setUp(self):
     self.list_a = [1.0, 2.1, 3]
     self.list_b = [3.1, 4, -1.4]
     self.list_c = [8.6, 9]
     self.obj_a = MetricObject()
     self.obj_b = MetricObject()
     self.obj_c = MetricObject()
Beispiel #2
0
 def test_solve(self):
     self.agent.time_vary = ["vary_1"]
     self.agent.time_inv = ["inv_1"]
     self.agent.vary_1 = [1.1, 1.2, 1.3, 1.4]
     self.agent.inv_1 = 1.05
     # to test the superclass we create a dummy solve_one_period function
     # for our agent, which doesn't do anything, instead of using a NullFunc
     self.agent.solve_one_period = lambda vary_1: MetricObject()
     self.agent.solve()
     self.assertEqual(len(self.agent.solution), 4)
     self.assertTrue(isinstance(self.agent.solution[0], MetricObject))
Beispiel #3
0
 def setUp(self):
     # similar test to distance_metric
     self.obj_a = MetricObject()
     self.obj_b = MetricObject()
     self.obj_c = MetricObject()