8 #ifndef IMPCORE_MONTE_CARLO_H
9 #define IMPCORE_MONTE_CARLO_H
11 #include <IMP/core/core_config.h>
18 #include <IMP/internal/container_helpers.h>
22 #include <boost/random/uniform_real.hpp>
24 IMPCORE_BEGIN_NAMESPACE
27 #define IMP_CORE_HAS_MONTE_CARLO_MOVER 1
65 void set_kt(
Float t) {
83 <<
" requires return best being on.");
91 return stat_forward_steps_taken_;
95 return stat_upward_steps_taken_;
108 double get_maximum_difference()
const {
109 return max_difference_;
118 IMP_LIST_ACTION(
public, Mover, Movers, mover, movers,
133 void set_incremental_scoring_function(IncrementalScoringFunction *isf);
134 bool get_use_incremental_scoring_function()
const {
137 IncrementalScoringFunction* get_incremental_scoring_function()
const {
144 ParticleIndexes get_movable_particles()
const;
149 bool do_accept_or_reject_move(
double score,
double last,
150 double proposal_ratio);
151 bool do_accept_or_reject_move(
double score,
double proposal_ratio)
153 return do_accept_or_reject_move(score, get_last_accepted_energy(),
157 MonteCarloMoverResult do_move();
159 virtual void do_step();
176 isf_->set_moved_particles(moved);
178 if (get_maximum_difference() <
NO_MAX) {
180 ->evaluate_if_below(
false, last_energy_+max_difference_);
190 double max_difference_;
191 unsigned int stat_forward_steps_taken_;
192 unsigned int stat_upward_steps_taken_;
193 unsigned int stat_num_failures_;
195 IMP::OwnerPointer<Configuration> best_;
196 ::boost::uniform_real<> rand_;
198 Pointer<IncrementalScoringFunction> isf_;
206 IMP::OwnerPointer<Optimizer> opt_;
207 unsigned int num_local_;
212 unsigned int get_number_of_steps()
const {
221 virtual void do_step() IMP_OVERRIDE;
240 virtual void do_step() IMP_OVERRIDE;
245 IMPCORE_END_NAMESPACE