示例#1
0
def test_make_lindynamics(
    n_state: int,
    n_ctrl: int,
    horizon: int,
    stationary: bool,
    passive_eigval_range: tuple[float, float],
    controllable: bool,
    transition_bias: bool,
    seed: int,
):
    dynamics = make_lindynamics(
        n_state,
        n_ctrl,
        horizon,
        stationary=stationary,
        passive_eigval_range=passive_eigval_range,
        controllable=controllable,
        bias=transition_bias,
        rng=seed,
    )
    check_dynamics(
        dynamics,
        n_state,
        n_ctrl,
        horizon,
        stationary=stationary,
        controllable=controllable,
        transition_bias=transition_bias,
        sample_covariance=False,
    )
示例#2
0
def stationary_deterministic_dynamics(n_state: int, n_ctrl: int, horizon: int,
                                      seed: int):
    return make_lindynamics(n_state,
                            n_ctrl,
                            horizon,
                            stationary=True,
                            rng=seed)
示例#3
0
 def dynamics(self, n_state: int, n_ctrl: int, horizon: int, seed: int,
              stationary: bool) -> LinSDynamics:
     # pylint:disable=too-many-arguments
     linear = make_lindynamics(n_state,
                               n_ctrl,
                               horizon,
                               stationary=stationary,
                               rng=seed)
     return make_linsdynamics(linear, stationary=stationary, rng=seed)
示例#4
0
 def reset_parameters(self):
     """Default parameter initialization."""
     linear = make_lindynamics(self.n_state,
                               self.n_ctrl,
                               self.horizon,
                               stationary=self.stationary)
     dynamics = make_linsdynamics(linear, stationary=self.stationary)
     self.copy_(dynamics)
     self.cov_cholesky.reset_parameters()
示例#5
0
def dynamics(n_state: int, n_ctrl: int, horizon: int,
             rng: RNG) -> lqr.LinSDynamics:
    return make_linsdynamics(
        make_lindynamics(
            n_state,
            n_ctrl,
            horizon,
            stationary=True,
            passive_eigval_range=(0.5, 1.5),
            rng=rng,
        ),
        stationary=True,
        rng=rng,
    )
示例#6
0
 def dynamics(
     self, n_state: int, n_ctrl: int, horizon: int, seed: int
 ) -> lqr.LinSDynamics:
     dyn = make_lindynamics(
         n_state,
         n_ctrl,
         horizon,
         stationary=True,
         passive_eigval_range=(0.5, 1.5),
         controllable=True,
         bias=False,
         rng=seed,
     )
     return make_linsdynamics(dyn, stationary=True, rng=seed)
示例#7
0
def dynamics(n_state: int, n_ctrl: int, horizon: int,
             seed: int) -> LinSDynamics:
    lin = make_lindynamics(n_state, n_ctrl, horizon, rng=seed)
    dyn = make_linsdynamics(lin, rng=seed)
    return dyn
示例#8
0
def dynamics(n_state: int, n_ctrl: int, horizon: int) -> lqr.LinSDynamics:
    dynamics = make_lindynamics(n_state, n_ctrl, horizon, stationary=True)
    return make_linsdynamics(dynamics, stationary=True)
示例#9
0
def lindynamics(n_state: int, n_ctrl: int, horizon: int,
                seed: int) -> LinDynamics:
    return make_lindynamics(n_state, n_ctrl, horizon, rng=seed)