1#ifndef RPC_MC_MOVE_MANAGER_TPP
2#define RPC_MC_MOVE_MANAGER_TPP
12#include <rpc/fts/montecarlo/McMoveManager.h>
13#include <rpc/fts/montecarlo/McMoveFactory.h>
14#include <rpc/fts/montecarlo/McSimulator.h>
16#include <util/random/Random.h>
30 simulatorPtr_(&simulator),
32 randomPtr_(&simulator.random())
57 probabilities_.allocate(size());
58 double totalProbability = 0.0;
60 for (iMove = 0; iMove < size(); ++iMove) {
61 probabilities_[iMove] = (*this)[iMove].probability();
62 totalProbability += probabilities_[iMove];
66 for (iMove = 0; iMove < size(); ++iMove) {
67 probabilities_[iMove] = probabilities_[iMove]/totalProbability;
68 (*this)[iMove].setProbability(probabilities_[iMove]);
78 for (
int iMove = 0; iMove < size(); ++iMove) {
79 (*this)[iMove].setup();
90 iMove = randomPtr_->drawFrom(&probabilities_[0], size());
91 return (*
this)[iMove];
100 for (
int i=0; i< size(); i++) {
111 for (
int i=0; i< size(); i++) {
112 (*this)[i].outputTimers(out);
122 for (
int i=0; i< size(); i++) {
123 (*this)[i].clearTimers();
133 for (
int i=0; i< size(); i++) {
134 if((*
this)[i].needsCc()){
147 for (
int i=0; i< size(); i++) {
148 if((*
this)[i].needsDc()){
Factory for subclasses of McMove.
Manager for a set of McMove objects.
void setup()
Initialize at beginning of system run.
McMoveManager(McSimulator< D > &simulator, System< D > &system)
Constructor.
bool needsCc()
Decide whether any move needs to store cc fields.
void outputTimers(std::ostream &out) const
Log output timing results.
~McMoveManager()
Destructor.
McMove< D > & chooseMove()
Choose an McMove at random, using specified probabilities.
void output() const
Output statistics for all moves.
virtual void readParameters(std::istream &in)
Read instructions for creating McMove objects.
bool needsDc()
Decide whether any move needs to store dc fields.
void clearTimers()
Clear timers.
McMove is an abstract base class for Monte Carlo moves.
Monte-Carlo simulation coordinator.
Main class for SCFT or PS-FTS simulation of one system.
Template container for pointers to objects with a common base class.
void setClassName(const char *className)
Set class name string.
File containing preprocessor macros for error handling.
PSCF package top-level namespace.
Utility classes for scientific computation.