add_sampling_case

Class method.

do_mpc.sampling.samplingplanner.SamplingPlanner.add_sampling_case(self, **kwargs)

Manually add sampling case with user-defined values. Create a sampling case by choosing values for the previously introduced sampling variables (with set_sampling_var()).

Method takes arbitrary (keyword, argument) pairs, where the keywords must refer to previously introduced sampling variables. add_sampling_case() will automatically augment the sampling case with values for variables that are not passed as arguments. This only works if these variables were created with the argument fun_var_pdf.

Example:

sp = do_mpc.sampling.SamplingPlanner()

# Plan with two variables alpha and beta:
sp.set_sampling_var('alpha', np.random.randn)
sp.set_sampling_var('beta', lambda: np.random.randint(0,5))

# Create two new sampling cases, missing variable is auto-generated:
sp.add_sampling_case(alpha=1)
sp.add_sampling_case(beta= 0)

This page is auto-generated. Page source is not available on Github.