Esempio n. 1
0
def sample_abs_state(abs_state,
                     A,
                     system_params):

    samples = system_params.sampler.sample(abs_state, A, system_params, A.num_samples)

    total_num_samples = samples.n

    x_array = samples.x_array
    s_array = samples.s_array

    # print s_array

    t_array = samples.t_array
    pi_array = samples.pi_array
    ci_array = samples.ci_array

    d = np.array([abs_state.plant_state.d])
    pvt = np.array([abs_state.plant_state.pvt])

    d_array = np.repeat(d, samples.n, axis=0)
    pvt_array = np.repeat(pvt, samples.n, axis=0)

    # sanity check
    assert(len(d_array) == total_num_samples)
    assert(len(pvt_array) == total_num_samples)
    assert(len(x_array) == total_num_samples)
    assert(len(s_array) == total_num_samples)
    assert(len(t_array) == total_num_samples)



    # can not use None because of a check in
    # get_abs_state_from_concrete_state() which silently makes
    # the entire abstract state None if a None is encountered
    # in either plant or contorller abs state.
    (s_array_, u_array) = U.inf_list(0), U.inf_list(0)

    state = st.StateArray(
        t=t_array,
        x=x_array,
        d=d_array,
        pvt=pvt_array,
        s=s_array_,
        u=u_array,
        pi=pi_array,
        ci=ci_array,
        )

    return state
Esempio n. 2
0
def compute_concrete_controller_output(*args):
    return U.inf_list(0), U.inf_list(0)
Esempio n. 3
0
def compute_concrete_controller_output(*args):
    return U.inf_list(0), U.inf_list(0)