PROFASI  Version 1.5
Public Member Functions | List of all members
prf_traj::TrajSnapshot Class Reference

Snapshot of program state. More...

#include <TrajSnapshot.hh>

Public Member Functions

 TrajSnapshot ()
 Default constructor.
 
 TrajSnapshot (const TrajSnapshot &t)
 Copy constructor.
 
TrajSnapshotoperator= (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)
 

Detailed Description

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 cross-checks, 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 self-sufficient) 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.

See Also
prf_traj::Trajectory, prf_traj::TrajSeg

Member Function Documentation

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.


The documentation for this class was generated from the following files:

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2