PROFASI
Version 1.5

MC class handles the Markov Chain Monte Carlo evolution. More...
#include <MC.hh>
Inherits HandlerBase.
Inherited by prf::GMC.
Public Member Functions  
MC ()  
default constructor  
UpdatesHandler *  updates_hander () 
Return pointer to the manager of conformational updates.  
FFHandler *  forcefield_handler () 
Return pointer to the force field manager.  
void  forcefield_handler (FFHandler *fh) 
Introduce the force field manager.  
RandomNumberBase *  RandomNumberGenerator () 
Return a pointer to the random number generator for other use.  
void  RandomNumberGenerator (RandomNumberBase *grn) 
Force use of a different a random number generator.  
double  temperature () const 
Get temperature in dimensionless ProFASi units.  
void  temperature (double x) 
Set temperature in dimensionless ProFASi units.  
double  temperature_in_kelvin () const 
Get MC temperature in Kelvin.  
void  temperature_in_kelvin (double val) 
Assign a temperature in kelvin for the simulation.  
void  SetBeta (double be) 
Set inverse temperature (model units for temperature)  
void  Connect (Population *p) 
Tell MC what population of proteins it needs to evolve.  
virtual int  Setup () 
Initialize.  
virtual int  SimpleStep () 
Perform one Monte Carlo step: naive version.  
virtual int  Step () 
One Monte Carlo Step, as used in PROFASI.  
void  Step (int nstps) 
Perform nstps Monte Carlo steps.  
void  RunCycle () 
Run a Monte Carlo cycle or sweep.  
void  SetCycleLength (int i) 
Set length of cycle to i.  
virtual int  parseCommand (InstructionString s) 
Execute an instruction.  
Public Member Functions inherited from HandlerBase  
virtual void  parseCommands (std::list< InstructionString > &cmds, int argc, char *argv[]) 
Parse commands passed as a deque of InstructionString objects.  
The MC class accumulates information about the force field and updates and the population of proteins. It then performs the Markov Chain evolution of that system, using predefined probabilities for the updates. MC as such performs only fixedtemperature simulations. For most practical purposes this would be inadequate. But it works as a good base class for other methods such as the Simulated Tempering (SimTemp class) or Simulated Annealing (SimAnneal class).
The acceptance probability for a proposed update is very much like the Metropolis probability, but with a prefactor. For certain updates, like BGS, it is necessary to use an additional factor in the probability to ensure detail balance.
In version 1.5 handling of energy terms is delegated to a new force field handler class, FFHandler. Similarly operations relating to the conformational updates are delegated to the UpdatesHandler. Both these handlers are members of the MC class. Using the handler classes help maintain a modular structure in the code. These measures are also the first step towards making MC algorithms such as parallel tempering, simulated tempering or simulated annealing available as a pure template library, independent of the rest of ProFASi. Such a library could be useful for arbitrary systems not necessarily related to proteins.
Another change relative to earlier versions of ProFASI, made to bring the MC class closer to a pure representation of the Markov chain Monte Carlo algorithm was to rid it of the responsibility of keeping track of the number of temperatures and the temperature index for simulated tempering, parallel tempering and simulated annealing. Although these variables are common to these three algorithm, they do not belong to the concept of the basic Monte Carlo algorithm.

virtual 
The MC class handles some instructions of its own, as well as forwarding instructions meant for the UpdatesHandler. Instructions for the MC class are:
Reimplemented in prf::WangLandau, and prf::ParTemp.

inline 
A Monte Carlo sweep or cycle consists of a preconfigured number of Monte Carlo steps. The default number of steps ( ProFASi v 1.5 ) is the number of degrees of freedom in the population. This may be changed to any value using the command "steps_per_cycle N". This function is a shorthand to call Step() many times.
void MC::SetCycleLength  (  int  i  ) 
If a positive value is passed, cycle length is set to that value. If a negative number or 0 is passed, cycle length is set equal to the number of degrees of freedom in the system.

virtual 
After this function, the MC object should be ready to do Monte Carlo steps.
Reimplemented in prf::ParTemp.

virtual 
Select an update. Find energy change. Ask the Metropolis question. Decide whether or not to accept the update, and do so.This function, is not used in ProFASi, except during debugging.

virtual 
Similar to the SimpleStep function, but with a speed up trick. The random number to be used for the Metropolis question is completely independent of the energy calculations. In this version of the Monte Carlo step, that random number is generated before the energy calculations (but after the conformational update). Using it, and the temperature, a maximum acceptable energy increase is calculated before doing anything with the energy terms. This value is passed to the force field handler for the delta E calculations. It is understood that if the energy change is greater than this limit, it need not be calculated precisely. The conformational update will be rejected anyway! So, the FFHandler gets a license to return any (too) large value, if it has ascertained that the correct value lies beyond the limit passed to it. See the documentation of the deltaE_with_limit() function in FFHandler for a little more on this.
Reimplemented in prf::WangLandau.