20#ifndef FILTERPARTICLE_H
21#define FILTERPARTICLE_H
27#include <meteoio/thirdParty/tinyexpr.h>
414 FilterParticle(
const std::vector< std::pair<std::string, std::string> >& vecArgs,
const std::string& name,
const Config& cfg);
415 virtual void process(
const unsigned int& param,
const std::vector<MeteoData>& ivec,
416 std::vector<MeteoData>& ovec);
420 bool checkInitialState(
const std::vector<MeteoData>& ivec,
const size_t& param);
421 void initFunctionVars(te_variable* vars,
const std::vector<std::string>& names,
const std::vector<double>& meteo)
const;
422 te_expr* compileExpression(
const std::string& expression,
const te_variable* te_vars,
const size_t& sz)
const;
423 void parseSubstitutionStrings(std::string& line_m, std::string& line_o, std::vector<std::string>& sub_expr,
424 std::vector<std::string>& sub_params)
const;
425 void parseBracketExpression(std::string& line, std::vector<std::string>& sub_expr,
426 std::vector<std::string>& sub_params)
const;
427 void dumpInternalStates(
Matrix& particles,
Matrix& weights)
const;
428 bool readInternalStates(
Matrix& particles,
Matrix& weights)
const;
429 void dumpParticlePaths(
Matrix& particles)
const;
430 std::vector<double> buildTimeVector(
const std::vector<MeteoData>& ivec)
const;
431 void parse_args(
const std::vector< std::pair<std::string, std::string> >& vecArgs);
434 void vecMeteoToMatrix(
const std::vector<MeteoData>& vec,
Matrix& mat,
const unsigned int& param)
const;
435 void readLineToVec(
const std::string& line_in, std::vector<uint64_t>& vec_out)
const;
436 bool isNan(
const double& xx)
const;
438 typedef enum PF_FILTER_ALGORITHM {
441 } pf_filter_algorithm;
442 typedef enum PF_RESAMPLE_ALGORITHM {
445 } pf_resample_algorithm;
446 typedef enum PF_ESTIMATION_MEASURE {
449 } pf_estimation_measure;
451 pf_filter_algorithm filter_alg;
452 pf_resample_algorithm resample_alg;
455 bool path_resampling;
457 std::string model_expression;
458 std::string obs_model_expression;
459 std::string fit_expression;
460 std::string fit_param;
461 unsigned int fit_degree;
464 double resample_percentile;
465 pf_estimation_measure estim_measure;
467 struct rng_settings {
470 std::vector<double> parameters;
471 std::vector<uint64_t> seed;
477 struct rng_settings rng_model;
478 struct rng_settings rng_obs;
479 struct rng_settings rng_prior;
480 std::vector<uint64_t> resample_seed;
483 std::string unrecognized_keys;
484 std::string dump_particles_file;
485 std::string dump_states_file;
486 std::string input_states_file;
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
A Monte Carlo sampling method: the particle filter.
Definition: FilterParticle.h:412
FilterParticle(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: FilterParticle.cc:32
virtual void process(const unsigned int ¶m, const std::vector< MeteoData > &ivec, std::vector< MeteoData > &ovec)
The filtering routine as called by the processing toolchain.
Definition: FilterParticle.cc:48
This class implements the basic operations on matrices. Elements are access in matrix notation: that ...
Definition: Matrix.h:42
The base class for all filters that provides the interface and a few helper methods.
Definition: ProcessingBlock.h:67
Definition: RandomNumberGenerator.h:1231
RNG_TYPE
Definition: RandomNumberGenerator.h:1234
@ RNG_XOR
Combined generator.
Definition: RandomNumberGenerator.h:1235
RNG_DISTR
Definition: RandomNumberGenerator.h:1242
@ RNG_GAUSS
Gaussian deviates.
Definition: RandomNumberGenerator.h:1244