Пример #1
0
 def test_default_parameters(self):
     controller = AcrobotSpongController()
     context = controller.CreateDefaultContext()
     expected_parameters = SpongControllerParams()
     actual_parameters = controller.get_parameters(context)
     self.assertEqual(actual_parameters.k_e(), expected_parameters.k_e())
     self.assertEqual(actual_parameters.k_p(), expected_parameters.k_p())
     self.assertEqual(actual_parameters.k_d(), expected_parameters.k_d())
     self.assertEqual(actual_parameters.balancing_threshold(),
                      expected_parameters.balancing_threshold())
Пример #2
0
 def test_param_defaults(self):
     params = SpongControllerParams()
     self.assertEqual(params.k_e(), 5.)
     self.assertEqual(params.k_p(), 50.)
     self.assertEqual(params.k_d(), 5.)
     self.assertEqual(params.balancing_threshold(), 1000.)
Пример #3
0
 def test_param_accessors(self):
     params = SpongControllerParams()
     params.set_k_e(1.)
     params.set_k_p(2.)
     params.set_k_d(3.)
     params.set_balancing_threshold(4.)
     self.assertEqual(params.k_e(), 1.)
     self.assertEqual(params.k_p(), 2.)
     self.assertEqual(params.k_d(), 3.)
     self.assertEqual(params.balancing_threshold(), 4.)