11 double data_confidence,
13 m_must_converge(false),
14 m_conf(data_confidence),
15 m_data(data_initsize),
23 double data_confidence,
25 m_must_converge(true),
27 m_conf(data_confidence),
28 m_data(data_initsize),
43 std::string print_name,
44 double data_confidence,
46 MonteSampler(print_name, data_confidence, data_initsize),
47 m_property_name(_property_name) {}
58 std::string print_name,
60 double data_confidence,
62 MonteSampler(print_name, data_prec, data_confidence, data_initsize),
63 m_property_name(_property_name) {}
84 std::string print_name,
85 double data_confidence,
87 MonteSampler(print_name, data_confidence, data_initsize),
88 m_property_name(_property_name),
102 std::string print_name,
104 double data_confidence,
106 MonteSampler(print_name, data_prec, data_confidence, data_initsize),
107 m_property_name(_property_name),
121 m_formatter(formatter),
128 auto curr_sample = std::make_pair(counter.
pass(), counter.
step());
129 if(curr_sample != m_last_sample) {
131 m_last_sample = curr_sample;
138 std::shared_ptr<QueryMonteSampler::Formatter> formatter,
140 std::string print_name,
141 double data_confidence,
143 MonteSampler(print_name, data_confidence, data_initsize),
149 std::shared_ptr<QueryMonteSampler::Formatter> formatter,
151 std::string print_name,
153 double data_confidence,
155 MonteSampler(print_name, data_prec, data_confidence, data_initsize),
157 m_formatter(formatter) {}
177 std::string print_name,
178 double data_confidence,
180 MonteSampler(print_name, data_confidence, data_initsize),
182 m_comp_converter(_comp_converter) {}
195 std::string print_name,
197 double data_confidence,
199 MonteSampler(print_name, data_prec, data_confidence, data_initsize),
201 m_comp_converter(_comp_converter) {}
226 std::string print_name,
227 double data_confidence,
229 MonteSampler(print_name, data_confidence, data_initsize),
231 m_basis_size(_basis_size) {}
244 std::string print_name,
246 double data_confidence,
248 MonteSampler(print_name, data_prec, data_confidence, data_initsize),
250 m_basis_size(_basis_size) {}
270 std::string print_name,
271 double data_confidence,
273 MonteSampler(print_name, data_confidence, data_initsize),
275 m_vacancy_index(_vacancy_index) {}
288 std::string print_name,
290 double data_confidence,
292 MonteSampler(print_name, data_prec, data_confidence, data_initsize),
294 m_vacancy_index(_vacancy_index) {}
300 double atom_sum = 0.0;
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
SiteFracMonteSampler(size_type _index, size_type _basis_size, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
void push_back(double value)
Add an observation.
Eigen::VectorXd param_composition(const Eigen::VectorXd &n) const
Convert number of mol per prim, 'n' to parametric composition 'x'.
MonteSampler(const std::string &print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
const double & scalar_property(std::string property_name) const
const Access a particular scalar property
const Configuration & config() const
const Access current microstate
An abstract base class for sampling and storing data observations.
std::string m_property_name
Eigen::VectorXd comp(const Configuration &config)
Returns parametric composition, as calculated using PrimClex::param_comp.
std::shared_ptr< QueryMonteSampler::Formatter > m_formatter
Track the number of passes, steps and samples taken in a Monte Carlo calculation. ...
size_type pass() const
Number of complete passes performed.
Eigen::VectorXd comp_n(const ConfigDoF &configdof, const Supercell &scel)
Returns comp_n, the number of each molecule per primitive cell, ordered as Structure::get_struc_molec...
QueryMonteSampler(std::shared_ptr< QueryMonteSampler::Formatter > formatter, size_type _index, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
AtomFracMonteSampler(size_type _index, size_type _vacancy_index, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
CompMonteSampler(size_type _index, const CompositionConverter &_comp_converter, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
ScalarMonteSampler(std::string _property_name, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
size_type step() const
Number of steps into the current pass.
const MCData & data() const
const Access the raw data observation container
std::string m_property_name
T max(const T &A, const T &B)
MCData::size_type size_type
const Eigen::VectorXd & vector_property(std::string property_name) const
const Access a particular vector property
Interface base class for all types of Monte Carlo simulations (not meant to be used polymorphically) ...
Convert between number of species per unit cell and parametric composition.
void sample(const MonteCarlo &mc, const MonteCounter &counter)
Sample data from a MonteCarlo calculation.
CompositionConverter m_comp_converter
size_type m_vacancy_index
VectorMonteSampler(std::string _property_name, size_type _index, std::string print_name, double data_confidence, size_type data_initsize)
Construct sampler that does not need to converge.