PROFASI
Version 1.5

Snapshot of program state. More...
#include <TrajSnapshot.hh>
Public Member Functions  
TrajSnapshot ()  
Default constructor.  
TrajSnapshot (const TrajSnapshot &t)  
Copy constructor.  
TrajSnapshot &  operator= (const TrajSnapshot &t) 
Snapshots can be assigned.  
void  fill (BinStream &bst) 
Read in properties from a BinStream object.  
Snapshot property access  
unsigned long  MC_time () const 
double  energy () const 
int  T_index () const 
std::vector< double > &  coordinates () 
long  random_number_seed () const 
unsigned long  random_number_ncalls () const 
Setting individual fields  
void  set_MC_time (unsigned long t) 
void  set_energy (double e) 
void  set_T_index (int i) 
void  set_coordinates (const std::vector< double > &crds) 
void  set_n_coordinates (size_t i) 
void  set_random_number_seed (long c) 
void  set_random_number_ncalls (unsigned long ncl) 
This class represents a minimal block of information representing the state of an MC run with PROFASI at a certain MC sweep. The snapshot contains an identifying unsigned long integer representing the MC sweep, an integer index for the temperature, a double precision energy value for crosschecks, a couple of numbers representing the state of the random number generator and values of all degrees of freedom in the system.
The integer temperature index is unnecessary for a canonnical MC run with BasicMCRun. But it is written there anyway to keep a fixed format. The index refers to the temperature values in an array stored elsewhere.
The energy value can be calculated from the coordinates, but storing at least the sum in the snapshot gives an easy check that the coordinate values are interpreted in the same way when they are read as when they are written.
Two numbers are used to store the state of the random number generators. A long integer seed, and an unsigned long integer representing how many random number calls had been made until the snapshot point. Using these two the random number generator can be restored to the exact same point in its history.
The degrees of freedom values are stored as one single array of double precision values. Information about chains in population and the box length in the simulation have to be provided separately for the DOF info to make sense. The reason why sequence information is not appended to every snapshot (to make it selfsufficient) is that it does not change during the simulation. A snapshot is a record of the changeables in a simulation, which must be augmented with the constants.
void TrajSnapshot::fill  (  BinStream &  bst  ) 
The BinStream is assumed to have already read the bytes corresponding to the snapshot. In this function, the bytes are converted into integers, doubles etc and assigned to the respective fields.