25 #ifndef SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_DISCRETIZATION_GRIDS_FINITE_DIFFERENCES_VARIABLE_GRID_H_ 26 #define SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_DISCRETIZATION_GRIDS_FINITE_DIFFERENCES_VARIABLE_GRID_H_ 37 using Ptr = std::shared_ptr<FiniteDifferencesVariableGrid>;
38 using UPtr = std::unique_ptr<FiniteDifferencesVariableGrid>;
58 #ifdef MESSAGE_SUPPORT 59 void fromMessage(
const messages::FiniteDifferencesVariableGrid& message, std::stringstream* issues);
60 void toMessage(messages::FiniteDifferencesVariableGrid& message)
const;
62 void fromMessage(
const messages::DiscretizationGrid& message, std::stringstream* issues)
override 64 fromMessage(message.finite_differences_variable_grid(), issues);
66 void toMessage(messages::DiscretizationGrid& message)
const override { toMessage(*message.mutable_finite_differences_variable_grid()); }
92 #endif // SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_DISCRETIZATION_GRIDS_FINITE_DIFFERENCES_VARIABLE_GRID_H_ void setDtBounds(double dt_lb, double dt_ub)
std::unique_ptr< DiscretizationGridInterface > UPtr
virtual ~FiniteDifferencesVariableGrid()=default
bool adaptGridTimeBasedAggressiveEstimate(NlpFunctions &nlp_fun)
bool adaptGrid(bool new_run, NlpFunctions &nlp_fun) override
bool isDtFixedIntended() const override
#define FACTORY_REGISTER_DISCRETIZATION_GRID(type)
bool adaptGridSimpleShrinkingHorizon(NlpFunctions &nlp_fun)
void setGridAdaptSimpleShrinkingHorizon(bool adapt_first_iter=false)
bool isMovingHorizonWarmStartActive() const override
bool adaptGridTimeBasedSingleStep(NlpFunctions &nlp_fun)
GridAdaptStrategy _grid_adapt
static Factory< DiscretizationGridInterface > & getFactory()
Get access to the associated factory.
static Factory & instance()
< Retrieve static instance of the factory
void setGridAdaptTimeBasedSingleStep(int n_max, double dt_hyst_ratio=0.1, bool adapt_first_iter=false)
void disableGridAdaptation()
void setGridAdaptTimeBasedAggressiveEstimate(int n_max, double dt_hyst_ratio=0.1, bool adapt_first_iter=false)
std::shared_ptr< DiscretizationGridInterface > Ptr
FiniteDifferencesVariableGrid()=default
DiscretizationGridInterface::Ptr getInstance() const override
Return a newly created shared instance of the implemented class.
bool isGridAdaptActive() const override