mcpele
1.0.0
The Monte Carlo Python Energy Landscape Explorer
|
00001 #ifndef _MCPELE_TAKE_STEP_PROBABILITIES_H__ 00002 #define _MCPELE_TAKE_STEP_PROBABILITIES_H__ 00003 00004 #include <vector> 00005 #include <random> 00006 00007 #include "mc.h" 00008 00009 namespace mcpele { 00010 00020 class TakeStepProbabilities : public TakeStep { 00021 private: 00022 std::vector<std::shared_ptr<TakeStep> > m_steps; 00023 std::vector<double> m_weights; 00024 std::discrete_distribution<size_t> m_distribution; 00025 std::mt19937_64 m_generator; 00026 size_t m_current_index; 00027 public: 00028 virtual ~TakeStepProbabilities() {} 00029 TakeStepProbabilities(const size_t seed); 00030 void add_step(std::shared_ptr<TakeStep> step_input, const double weight_input=1); 00031 void displace(pele::Array<double>& coords, MC* mc); 00032 void report(pele::Array<double>& old_coords, const double old_energy, 00033 pele::Array<double>& new_coords, const double new_energy, 00034 const bool success, MC* mc); 00035 std::vector<double> get_weights() const { return m_weights; } 00036 }; 00037 00038 } // namespace mcpele 00039 00040 #endif // #ifndef _MCPELE_TAKE_STEP_PROBABILITIES_H__