示例#1
0
 def test_reset_integrator_from_flags(self):
     for T in (float, AutoDiffXd):
         source = ConstantVectorSource_[T]([2, 3])
         simulator = Simulator_[T](source)
         result = ResetIntegratorFromFlags(simulator=simulator,
                                           scheme="runge_kutta2",
                                           max_step_size=0.001)
示例#2
0
    def test_simulator_flags(self):
        system = ConstantVectorSource([1])
        simulator = Simulator(system)

        ResetIntegratorFromFlags(simulator, "runge_kutta2", 0.00123)
        integrator = simulator.get_integrator()
        self.assertEqual(type(integrator), RungeKutta2Integrator)
        self.assertEqual(integrator.get_maximum_step_size(), 0.00123)

        self.assertGreater(len(GetIntegrationSchemes()), 5)
示例#3
0
    def test_simulator_flags(self):
        # TODO(eric.cousineau): Move this to `analysis_test.py`.
        system = ConstantVectorSource([1])
        simulator = Simulator(system)

        ResetIntegratorFromFlags(simulator, "runge_kutta2", 0.00123)
        integrator = simulator.get_integrator()
        self.assertEqual(type(integrator), RungeKutta2Integrator)
        self.assertEqual(integrator.get_maximum_step_size(), 0.00123)

        self.assertGreater(len(GetIntegrationSchemes()), 5)