43 #ifndef ILQGAMES_COST_FINAL_TIME_COST_H 44 #define ILQGAMES_COST_FINAL_TIME_COST_H 46 #include <ilqgames/cost/cost.h> 47 #include <ilqgames/utils/types.h> 49 #include <glog/logging.h> 58 FinalTimeCost(
const std::shared_ptr<const Cost>& cost, Time threshold_time,
59 const std::string& name =
"")
60 :
Cost(0.0, name), cost_(cost), threshold_time_(threshold_time) {
61 CHECK_NOTNULL(cost.get());
65 float Evaluate(Time t,
const VectorXf& input)
const {
66 return (t >= initial_time_ + threshold_time_) ? cost_->Evaluate(t, input)
72 void Quadraticize(Time t,
const VectorXf& input, MatrixXf* hess,
73 VectorXf* grad)
const {
74 if (t < initial_time_ + threshold_time_)
return;
75 cost_->Quadraticize(t, input, hess, grad);
80 const std::shared_ptr<const Cost> cost_;
83 const Time threshold_time_;