1#ifndef ITERATIVE_ALGORITHM_CONTROLLER_H
2#define ITERATIVE_ALGORITHM_CONTROLLER_H
142 uint_t current_iteration_idx_;
145 bool show_iterations_;
146 bool track_residuals_;
151 : max_iterations_(max_iterations), exit_tolerance_(exit_tolerance), current_iteration_idx_(0),
152 n_threads_(1), current_res_(std::numeric_limits<
real_t>::max()), show_iterations_(false),
153 track_residuals_(false)
uint_t get_current_iteration() const
Returns the current iteration index.
Definition iterative_algorithm_controller.h:96
real_t get_residual() const
get_residual
Definition iterative_algorithm_controller.h:117
bool track_residuals() const
track_residuals
Definition iterative_algorithm_controller.h:63
IterativeAlgorithmController(uint_t maxIterations, real_t exitTolerance)
Constructor.
Definition iterative_algorithm_controller.h:149
real_t get_exit_tolerance() const
Returns the exit tolerance for the algorithm.
Definition iterative_algorithm_controller.h:101
uint_t get_num_threads() const
Get the number of threads used.
Definition iterative_algorithm_controller.h:111
uint_t get_max_iterations() const
Return the maximum number of iterations.
Definition iterative_algorithm_controller.h:106
~IterativeAlgorithmController()=default
Destructor.
IterativeAlgorithmController & operator=(const IterativeAlgorithmController &)=default
copy assignement
void set_tolerance(real_t tol)
set_tolerance
Definition iterative_algorithm_controller.h:69
void set_num_threads(uint_t nthreads)
Set the number of threads.
Definition iterative_algorithm_controller.h:85
void set_track_residuals_flag(bool flag)
set_track_residuals_flag
Definition iterative_algorithm_controller.h:80
IterativeAlgorithmResult get_state() const
Returns the state of the controller.
IterativeAlgorithmController(const IterativeAlgorithmController &)=default
Copy constructor.
void set_max_itrs(uint_t max_itrs)
set_max_itrs
Definition iterative_algorithm_controller.h:91
IterativeAlgorithmController(IterativeAlgorithmController &&)=default
Move copy constructor.
bool continue_iterations()
Returns true if the iterations of the algorithm should be continued.
void reset(const IterativeAlgorithmController &control)
reset
IterativeAlgorithmController & operator=(IterativeAlgorithmController &&)=default
move copy assignement
void update_residual(real_t res)
Update the residual.
Definition iterative_algorithm_controller.h:127
bool show_iterations() const
show iterations
Definition iterative_algorithm_controller.h:57
void set_show_iterations_flag(bool flag)
show iterations
Definition iterative_algorithm_controller.h:74
Definition bitrl_concepts.h:22
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
Controllers: PID controllers, line following, a quadrotor flight controller, a fixed wing autopilot,...
Definition control_module.h:18
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
The IterativeAlgorithmResult struct. Helper struct to assemble the result of an iterative algorithm.
Definition iterative_algorithm_result.h:19