def test_random_sources_deprecated(self): with catch_drake_warnings(expected_count=1): UniformRandomSource(num_outputs=2, sampling_interval_sec=0.01) with catch_drake_warnings(expected_count=1): GaussianRandomSource(num_outputs=3, sampling_interval_sec=0.01) with catch_drake_warnings(expected_count=1): ExponentialRandomSource(num_outputs=4, sampling_interval_sec=0.1)
def test_random_sources(self): uniform_source = UniformRandomSource(num_outputs=2, sampling_interval_sec=0.01) self.assertEqual(uniform_source.get_output_port(0).size(), 2) gaussian_source = GaussianRandomSource(num_outputs=3, sampling_interval_sec=0.01) self.assertEqual(gaussian_source.get_output_port(0).size(), 3) exponential_source = ExponentialRandomSource(num_outputs=4, sampling_interval_sec=0.1) self.assertEqual(exponential_source.get_output_port(0).size(), 4) builder = DiagramBuilder() # Note: There are no random inputs to add to the empty diagram, but it # confirms the API works. AddRandomInputs(sampling_interval_sec=0.01, builder=builder)