Bayes Filters Library
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
bfl::ParticleFilter Class Referenceabstract

#include <ParticleFilter.h>

Inheritance diagram for bfl::ParticleFilter:
[legend]

Public Member Functions

virtual ~ParticleFilter () noexcept=default
 
bool skip (const std::string &what_step, const bool status) override
 
bool boot () override
 
void run () override
 
bool wait () override
 
void reset () override
 
void reboot () override
 
bool teardown () override
 
unsigned int step_number () override
 
bool is_running () override
 
bool enable_log (const std::string &folder_path, const std::string &file_name_prefix)
 
bool disable_log ()
 
std::string get_folder_path () const
 
std::string get_file_name_prefix () const
 
template<typename DatumType >
void logger (DatumType datum)
 
template<typename... DataType>
void logger (DataType... data)
 
template<typename DatumType >
void logger (DatumType datum) const
 
template<typename... DataType>
void logger (DataType... data) const
 

Protected Member Functions

 ParticleFilter (std::unique_ptr< ParticleSetInitialization > initialization, std::unique_ptr< PFPrediction > prediction, std::unique_ptr< PFCorrection > correction, std::unique_ptr< Resampling > resampling) noexcept
 
 ParticleFilter (const ParticleFilter &filter) noexcept=delete
 
ParticleFilteroperator= (const ParticleFilter &filter) noexcept=delete
 
 ParticleFilter (ParticleFilter &&filter) noexcept=delete
 
ParticleFilteroperator= (ParticleFilter &&filter) noexcept=delete
 
ParticleSetInitializationinitialization ()
 
PFPredictionprediction ()
 
PFCorrectioncorrection ()
 
Resamplingresampling ()
 
virtual bool initialization_step ()=0
 
virtual void filtering_step ()=0
 
virtual bool run_condition ()=0
 
virtual std::vector< std::string > log_file_names (const std::string &folder_path, const std::string &file_name_prefix)
 
virtual void log ()
 

Private Member Functions

void filtering_recursion ()
 
template<typename DatumType >
void logger_helper (const size_t pos, DatumType datum)
 
template<typename DatumType , typename... DataType>
void logger_helper (const size_t pos, DatumType datum, DataType... data)
 
template<typename DatumType >
void logger_helper (const size_t pos, DatumType datum) const
 
template<typename DatumType , typename... DataType>
void logger_helper (const size_t pos, DatumType datum, DataType... data) const
 

Private Attributes

std::unique_ptr< ParticleSetInitializationinitialization_
 
std::unique_ptr< PFPredictionprediction_
 
std::unique_ptr< PFCorrectioncorrection_
 
std::unique_ptr< Resamplingresampling_
 
unsigned int filtering_step_ = 0
 
std::thread filtering_thread_
 
std::mutex mtx_run_
 
std::condition_variable cv_run_
 
bool run_ = false
 
bool reset_ = false
 
bool teardown_ = false
 
std::string folder_path_
 
std::string file_name_prefix_
 
std::vector< std::string > file_names_
 
bool log_enabled_ = false
 
std::vector< std::ofstream > log_files_
 

Detailed Description

Definition at line 24 of file ParticleFilter.h.

Constructor & Destructor Documentation

◆ ~ParticleFilter()

virtual bfl::ParticleFilter::~ParticleFilter ( )
virtualdefaultnoexcept

◆ ParticleFilter() [1/3]

ParticleFilter::ParticleFilter ( std::unique_ptr< ParticleSetInitialization initialization,
std::unique_ptr< PFPrediction prediction,
std::unique_ptr< PFCorrection correction,
std::unique_ptr< Resampling resampling 
)
protectednoexcept

Definition at line 14 of file ParticleFilter.cpp.

◆ ParticleFilter() [2/3]

bfl::ParticleFilter::ParticleFilter ( const ParticleFilter filter)
protecteddeletenoexcept

◆ ParticleFilter() [3/3]

bfl::ParticleFilter::ParticleFilter ( ParticleFilter &&  filter)
protecteddeletenoexcept

Member Function Documentation

◆ boot()

bool FilteringAlgorithm::boot ( )
overridevirtualinherited

Implements bfl::Filter.

Definition at line 15 of file FilteringAlgorithm.cpp.

References bfl::FilteringAlgorithm::filtering_recursion(), and bfl::FilteringAlgorithm::filtering_thread_.

Here is the call graph for this function:

◆ correction()

PFCorrection & ParticleFilter::correction ( )
protected

Definition at line 65 of file ParticleFilter.cpp.

References correction_.

◆ disable_log()

bool Logger::disable_log ( )
inherited

◆ enable_log()

bool Logger::enable_log ( const std::string &  folder_path,
const std::string &  file_name_prefix 
)
inherited

Definition at line 22 of file Logger.cpp.

References bfl::Logger::file_name_prefix_, bfl::Logger::file_names_, bfl::Logger::folder_path_, bfl::Logger::log_enabled_, bfl::Logger::log_file_names(), and bfl::Logger::log_files_.

Here is the call graph for this function:

◆ filtering_recursion()

void FilteringAlgorithm::filtering_recursion ( )
privateinherited

◆ filtering_step()

virtual void bfl::FilteringAlgorithm::filtering_step ( )
protectedpure virtualinherited

◆ get_file_name_prefix()

std::string Logger::get_file_name_prefix ( ) const
inherited

Definition at line 91 of file Logger.cpp.

References bfl::Logger::file_name_prefix_.

◆ get_folder_path()

std::string Logger::get_folder_path ( ) const
inherited

Definition at line 85 of file Logger.cpp.

References bfl::Logger::folder_path_.

◆ initialization()

ParticleSetInitialization & ParticleFilter::initialization ( )
protected

Definition at line 53 of file ParticleFilter.cpp.

References initialization_.

◆ initialization_step()

virtual bool bfl::FilteringAlgorithm::initialization_step ( )
protectedpure virtualinherited

◆ is_running()

bool FilteringAlgorithm::is_running ( )
overridevirtualinherited

Implements bfl::Filter.

Definition at line 96 of file FilteringAlgorithm.cpp.

References bfl::FilteringAlgorithm::run_.

◆ log()

void Logger::log ( )
protectedvirtualinherited

Reimplemented in bfl::SimulatedStateModel, bfl::SIS, and bfl::SimulatedLinearSensor.

Definition at line 109 of file Logger.cpp.

◆ log_file_names()

std::vector< std::string > Logger::log_file_names ( const std::string &  folder_path,
const std::string &  file_name_prefix 
)
protectedvirtualinherited

Reimplemented in bfl::LinearModel, bfl::SimulatedStateModel, and bfl::SIS.

Definition at line 97 of file Logger.cpp.

Referenced by bfl::Logger::enable_log().

◆ logger() [1/4]

template<typename... DataType>
void bfl::Logger::logger ( DataType...  data)
inlineinherited

Definition at line 42 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ logger() [2/4]

template<typename... DataType>
void bfl::Logger::logger ( DataType...  data) const
inlineinherited

Definition at line 56 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ logger() [3/4]

template<typename DatumType >
void bfl::Logger::logger ( DatumType  datum)
inlineinherited

Definition at line 35 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::log_files_.

Referenced by bfl::SimulatedLinearSensor::log().

◆ logger() [4/4]

template<typename DatumType >
void bfl::Logger::logger ( DatumType  datum) const
inlineinherited

Definition at line 49 of file Logger.h.

References bfl::Logger::log_enabled_, and bfl::Logger::log_files_.

◆ logger_helper() [1/4]

template<typename DatumType >
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum 
)
inlineprivateinherited

Definition at line 81 of file Logger.h.

References bfl::Logger::log_files_.

Referenced by bfl::Logger::logger(), and bfl::Logger::logger_helper().

◆ logger_helper() [2/4]

template<typename DatumType >
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum 
) const
inlineprivateinherited

Definition at line 95 of file Logger.h.

References bfl::Logger::log_files_.

◆ logger_helper() [3/4]

template<typename DatumType , typename... DataType>
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum,
DataType...  data 
)
inlineprivateinherited

Definition at line 87 of file Logger.h.

References bfl::Logger::log_files_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ logger_helper() [4/4]

template<typename DatumType , typename... DataType>
void bfl::Logger::logger_helper ( const size_t  pos,
DatumType  datum,
DataType...  data 
) const
inlineprivateinherited

Definition at line 101 of file Logger.h.

References bfl::Logger::log_files_, and bfl::Logger::logger_helper().

Here is the call graph for this function:

◆ operator=() [1/2]

ParticleFilter& bfl::ParticleFilter::operator= ( const ParticleFilter filter)
protecteddeletenoexcept

◆ operator=() [2/2]

ParticleFilter& bfl::ParticleFilter::operator= ( ParticleFilter &&  filter)
protecteddeletenoexcept

◆ prediction()

PFPrediction & ParticleFilter::prediction ( )
protected

Definition at line 59 of file ParticleFilter.cpp.

References prediction_.

◆ reboot()

void FilteringAlgorithm::reboot ( )
overridevirtualinherited

◆ resampling()

Resampling & ParticleFilter::resampling ( )
protected

Definition at line 71 of file ParticleFilter.cpp.

References resampling_.

◆ reset()

void FilteringAlgorithm::reset ( )
overridevirtualinherited

Implements bfl::Filter.

Definition at line 67 of file FilteringAlgorithm.cpp.

References bfl::FilteringAlgorithm::reset_.

◆ run()

void FilteringAlgorithm::run ( )
overridevirtualinherited

◆ run_condition()

virtual bool bfl::FilteringAlgorithm::run_condition ( )
protectedpure virtualinherited

◆ skip()

bool ParticleFilter::skip ( const std::string &  what_step,
const bool  status 
)
overridevirtual

Implements bfl::Skipper.

Definition at line 28 of file ParticleFilter.cpp.

References correction_, and prediction_.

◆ step_number()

unsigned int FilteringAlgorithm::step_number ( )
overridevirtualinherited

Implements bfl::Filter.

Definition at line 90 of file FilteringAlgorithm.cpp.

References bfl::FilteringAlgorithm::filtering_step_.

◆ teardown()

bool FilteringAlgorithm::teardown ( )
overridevirtualinherited

Implements bfl::Filter.

Definition at line 82 of file FilteringAlgorithm.cpp.

References bfl::FilteringAlgorithm::teardown_.

◆ wait()

bool FilteringAlgorithm::wait ( )
overridevirtualinherited

Implements bfl::Filter.

Definition at line 41 of file FilteringAlgorithm.cpp.

References bfl::FilteringAlgorithm::filtering_thread_.

Member Data Documentation

◆ correction_

std::unique_ptr<PFCorrection> bfl::ParticleFilter::correction_
private

Definition at line 58 of file ParticleFilter.h.

Referenced by correction(), and skip().

◆ cv_run_

std::condition_variable bfl::FilteringAlgorithm::cv_run_
privateinherited

◆ file_name_prefix_

std::string bfl::Logger::file_name_prefix_
privateinherited

Definition at line 72 of file Logger.h.

Referenced by bfl::Logger::enable_log(), and bfl::Logger::get_file_name_prefix().

◆ file_names_

std::vector<std::string> bfl::Logger::file_names_
privateinherited

Definition at line 74 of file Logger.h.

Referenced by bfl::Logger::disable_log(), and bfl::Logger::enable_log().

◆ filtering_step_

unsigned int bfl::FilteringAlgorithm::filtering_step_ = 0
privateinherited

◆ filtering_thread_

std::thread bfl::FilteringAlgorithm::filtering_thread_
privateinherited

◆ folder_path_

std::string bfl::Logger::folder_path_
privateinherited

Definition at line 70 of file Logger.h.

Referenced by bfl::Logger::enable_log(), and bfl::Logger::get_folder_path().

◆ initialization_

std::unique_ptr<ParticleSetInitialization> bfl::ParticleFilter::initialization_
private

Definition at line 54 of file ParticleFilter.h.

Referenced by initialization().

◆ log_enabled_

bool bfl::Logger::log_enabled_ = false
privateinherited

◆ log_files_

std::vector<std::ofstream> bfl::Logger::log_files_
mutableprivateinherited

◆ mtx_run_

std::mutex bfl::FilteringAlgorithm::mtx_run_
privateinherited

◆ prediction_

std::unique_ptr<PFPrediction> bfl::ParticleFilter::prediction_
private

Definition at line 56 of file ParticleFilter.h.

Referenced by prediction(), and skip().

◆ resampling_

std::unique_ptr<Resampling> bfl::ParticleFilter::resampling_
private

Definition at line 60 of file ParticleFilter.h.

Referenced by resampling().

◆ reset_

bool bfl::FilteringAlgorithm::reset_ = false
privateinherited

◆ run_

bool bfl::FilteringAlgorithm::run_ = false
privateinherited

◆ teardown_

bool bfl::FilteringAlgorithm::teardown_ = false
privateinherited

The documentation for this class was generated from the following files: