/** Perform rollouts, i.e. given a set of samples, determine all the variables that are relevant * to evaluating the cost function. * This version does so for parallel optimization, where multiple distributions are updated. * \param[in] samples_vec The samples, a vector with one element per distribution * \param[out] cost_vars The variables relevant to computing the cost. * \todo Compare to other functions */ void performRollouts(const std::vector<Eigen::MatrixXd>& samples_vec, Eigen::MatrixXd& cost_vars) const { Eigen::MatrixXd task_parameters(0,0); performRollouts(samples_vec,task_parameters,cost_vars); }
/** Perform rollouts, i.e. given a set of samples, determine all the variables that are relevant to evaluating the cost function. * \param[in] samples The samples * \param[out] cost_vars The variables relevant to computing the cost. * \todo Compare to other functions */ inline void performRollouts(const Eigen::MatrixXd& samples, Eigen::MatrixXd& cost_vars) const { Eigen::MatrixXd task_parameters(0,0); performRollouts(samples,task_parameters,cost_vars); };
/** The cost function which defines the task. * See also \ref sec_cost_components and \ref sec_bbo_task_and_task_solver * * \param[in] cost_vars All the variables relevant to computing the cost. These are determined by TaskSolver::performRollout(). For further information see the section on \ref sec_bbo_task_and_task_solver * \param[in] sample The sample from which cost_vars was generated. Required for regularization. * \param[out] costs The cost for these cost_vars. The first element cost[0] should be the total cost. The others may be the individual cost components that consitute the total cost, e.g. cost[0] = cost[1] + cost[2] ... */ virtual void evaluateRollout(const Eigen::MatrixXd& cost_vars, const Eigen::VectorXd& sample, Eigen::VectorXd& costs) const { int n_task_pars = 0; Eigen::VectorXd task_parameters(n_task_pars); evaluateRollout(cost_vars,sample,task_parameters,costs); };
/** The cost function which defines the task. * * \param[in] cost_vars All the variables relevant to computing the cost. These are determined by TaskSolver::performRollouts(). For further information see the section on \ref sec_bbo_task_and_task_solver * \param[out] costs The scalar cost for each sample. */ virtual void evaluate(const Eigen::MatrixXd& cost_vars, Eigen::VectorXd& costs) const { int n_task_pars = 0; Eigen::MatrixXd task_parameters(cost_vars.rows(),n_task_pars); return evaluate(cost_vars,task_parameters, costs); };