15 #include "nlohmann/json.h" 20 template <
typename InType,
typename OutType>
39 const std::vector<Real> & ci_levels,
40 unsigned int ci_replicates,
41 unsigned int ci_seed);
44 virtual void storeInfo(nlohmann::json & json)
const override;
54 std::unique_ptr<StochasticTools::Calculator<InType, OutType>>
_calc_ptr;
57 std::unique_ptr<StochasticTools::BootstrapCalculator<InType, OutType>>
_ci_calc_ptr =
nullptr;
60 template <
typename InType,
typename OutType>
64 ReporterState<std::pair<OutType, std::vector<OutType>>> & state,
75 template <
typename InType,
typename OutType>
79 ReporterState<std::pair<OutType, std::vector<OutType>>> & state,
84 const std::vector<Real> & ci_levels,
85 unsigned int ci_replicates,
89 _ci_calc_ptr = StochasticTools::makeBootstrapCalculator<InType, OutType>(
90 ci_method, other, ci_levels, ci_replicates, ci_seed, *
_calc_ptr);
93 template <
typename InType,
typename OutType>
102 this->_state.value().second =
109 template <
typename InType,
typename OutType>
114 json[
"stat"] = _calc_ptr->name();
141 virtual void store(nlohmann::json & json)
const override;
167 template <
typename InType,
typename OutType>
virtual void finalize() final
const ReporterProducerEnum & _data_mode
Mode in which the above data was produced.
StatisticsReporter(const InputParameters ¶meters)
const InType & _data
Data used for the statistic calculation.
virtual void storeInfo(nlohmann::json &json) const override
const ReporterState< std::pair< OutType, std::vector< OutType > > > & state() const
ReporterContext that utilizes a Calculator object to compute its value and confidence levels...
const unsigned int & _ci_seed
Compute several metrics for supplied data.
void declareValueHelper(const ReporterName &r_name)
Helper for adding statistic reporter values.
virtual void execute() final
Not used; all operations are wrapped in the ReporterStatisticsContext.
virtual void store(nlohmann::json &json) const override
const std::vector< Real > & _ci_levels
std::unique_ptr< StochasticTools::BootstrapCalculator< InType, OutType > > _ci_calc_ptr
Storage for the BootstrapCalculator for the desired confidence interval calculations (optional) ...
const unsigned int & _ci_replicates
bool _initialized
Whether or not initialize() has been called for reporter value declaration.
ReporterStatisticsContext(const libMesh::ParallelObject &other, const MooseObject &producer, ReporterState< std::pair< OutType, std::vector< OutType >>> &state, const InType &data, const ReporterProducerEnum &mode, const MooseEnumItem &stat)
static InputParameters validParams()
const ReporterMode REPORTER_MODE_DISTRIBUTED
virtual void finalize() override
const MooseEnum & _ci_method
std::unique_ptr< StochasticTools::Calculator< InType, OutType > > _calc_ptr
Storage for the Calculator object for the desired stat, this is created in constructor.
virtual void initialize() final
This is where the reporter values are declared Note: unfortunetly this cannot be in the constructor s...
const InputParameters & parameters() const
const MultiMooseEnum & _compute_stats