Beispiel #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())
Beispiel #2
0
 def test_param_accessors(self):
     controller = AcrobotSpongController()
     context = controller.CreateDefaultContext()
     controller.get_mutable_parameters(context).set_k_e(1.)
     actual_parameters = controller.get_parameters(context)
     self.assertEqual(actual_parameters.k_e(), 1.)