48 #ifndef ILQGAMES_UTILS_STRATEGY_H 49 #define ILQGAMES_UTILS_STRATEGY_H 51 #include <ilqgames/utils/operating_point.h> 52 #include <ilqgames/utils/types.h> 54 #include <glog/logging.h> 60 std::vector<MatrixXf> Ps;
61 std::vector<VectorXf> alphas;
64 Strategy(
size_t horizon, Dimension xdim, Dimension udim)
65 : Ps(horizon), alphas(horizon) {
66 for (
size_t ii = 0; ii < horizon; ii++) {
67 Ps[ii] = MatrixXf::Zero(udim, xdim);
68 alphas[ii] = VectorXf::Zero(udim);
73 VectorXf operator()(
size_t time_index,
const VectorXf& delta_x,
74 const VectorXf& u_ref)
const {
75 return u_ref - Ps[time_index] * delta_x - alphas[time_index];
79 size_t NumVariables()
const {
80 const size_t horizon = Ps.size();
81 CHECK_EQ(horizon, alphas.size());
83 return horizon * (Ps.front().size() + alphas.front().size());