27 #include <corbo-communication/utilities.h> 136 int new_n = std::round((
double)n * (dt /
_dt_ref));
144 if (new_n == n)
return false;
#define PRINT_ERROR_NAMED(msg)
bool isTimeVariableGrid() const override
#define PRINT_WARNING_COND_NAMED(cond, msg)
bool adaptGridSimpleShrinkingHorizon(NlpFunctions &nlp_fun)
void setGridAdaptTimeBasedAggressiveEstimate(int n_max, double dt_hyst_ratio=0.1, bool adapt_first_iter=false)
Set grid adaptation strategy to 'aggressive'.
void setGridAdaptSimpleShrinkingHorizon(bool adapt_first_iter=false)
Set grid adaptation strategy to 'shrinking horizon'.
void setGridAdaptTimeBasedSingleStep(int n_max, double dt_hyst_ratio=0.1, bool adapt_first_iter=false)
Set grid adaptation strategy to 'single step'.
const NlpFunctions * _nlp_fun
GridAdaptStrategy _grid_adapt
int getN() const override
get current horizon length
virtual void resampleTrajectory(int n_new)
bool adaptGridTimeBasedAggressiveEstimate(NlpFunctions &nlp_fun)
bool adaptGrid(bool new_run, NlpFunctions &nlp_fun) override
double getDt() const
get current temporal resolution
bool adaptGridTimeBasedSingleStep(NlpFunctions &nlp_fun)
void setDtBounds(double dt_lb, double dt_ub)
Set lower and upper bounds for the temporal resolution.