irlc.ex02.dp_model.DPModel
- class irlc.ex02.dp_model.DPModel(N)[source]
Code for the base DP model class. The lecture notes contains further discussino about the distinction of models/environments/agents which I recommend reading first. Briefly, the role of the DP model is to define (in details) the basic N-step decision problem corresponding to the equations:
x_{k+1} = f_k(x_k, u_k, w_k) cost = g_k(x_k, u_k, w_k). terminal cost = g_N(x_N)
The above corresponds to the first 3 methods below. The rest of the functions specify the available states and actions (see definition of the basic problem in the lecture notes).
Methods
A(x, k)Pw(x, u, k)At step k, given x_k, u_k, compute the set of random noise disturbances w and their probabilities as a dict {..., w_i: pw_i, ...} such that
S(k)__init__(N)f(x, u, w, k)g(x, u, w, k)gN(x)w_rnd(x, u, k)generate random disturbances w ~ P_k(x, u) (useful for simulation)