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

A segment of a trajectory. More...

#include <TrajSeg.hh>

Public Member Functions

unsigned long min_cycle () const
 MC cycle of the first snapshot.
 
unsigned long max_cycle () const
 MC cycle of the last snapshot.
 
unsigned long interval () const
 Interval in MC cycles between adjacent snapshots.
 
unsigned long first_block () const
 Integer index assigned to the first block or snapshot.
 
unsigned long last_block () const
 Integer idex corresponding to the last block.
 
void set_block_id_offset (unsigned l)
 Set offset for the integer indexes of the data blocks.
 
unsigned long n_blocks () const
 Number of blocks or snapshots.
 
void truncate_in_t_range (unsigned long t0, unsigned long t1)
 Select only a set of blocks in a certain range in MC time.
 
void truncate_in_block_range (unsigned t0, unsigned t1)
 Select a set of blocks identified by their block ids.
 
bool get_block (unsigned iblk, TrajSnapshot &snp)
 Retrieve a certain block or snapshot.
 
bool get_block_at_mct (unsigned long mct, TrajSnapshot &snp)
 Search for a block of a certain MC time and retrieve it.
 
bool sleep ()
 Put segment to sleep.
 
bool wake_up ()
 (Re-)open file handle to read snapshot data again
 
prf_xml::XML_Nodexml_map ()
 An XML map containing information which applies to all snapshots.
 

Detailed Description

A TrajSeg is a segment of a PROFASI "trajectory" represented by the prf_traj::Trajectory class. A segment is generated by saving a series of snapshots (prf_traj::TrajSnapshot) until the run is finished or suspended because of run-time restrictions. When a run is continued after being suspended, a new segment is created.

A segment is a series of snapshots. But the segment contains additional data to help interpret the snapshots, such as the sequence of chains in the population, box size etc. The data in the snapshots taken together with this information should suffice to reconstruct all properties of the simulated system.

A PROFASI trajectory segment file also contains information about the machine where the simulation ran. It is therefore possible to interpret segment files generated on one machine in another.

The prf_traj::Trajectory class interacts with segments with only a generic interface which does involve details of data layout in the file. Retrieving data from the file and interpreting it is handled by an object of type prf_traj::prf_raw_conf . In the future prf_raw_conf will be sub-classed to enable using alternative binary storage formats like HDF5.

See Also
prf_traj::TrajSnapshot, prf_traj::Trajectory, prf_traj::prf_raw_conf

Member Function Documentation

unsigned long prf_traj::TrajSeg::first_block ( ) const
inline

A segment expects to be one of a series of segments. Therefore, the first block of data in a segment might be the 153rd block in a long simultion. This returns the block id of the first block. Of course, the segment can not know it on its own. This has to be set with the set_block_id_offset() function.

bool TrajSeg::get_block_at_mct ( unsigned long  mct,
TrajSnapshot snp 
)

If the requested MC cycle is outside the currently active MC time range for the segment, the return value is false. If it is within the range but does not correspond to the MC time of any snapshot, the snapshot with the nearest MC time before the requested time is returned.

bool TrajSeg::sleep ( )

Sleep means closing the file handle while keeping all meta data. When wake_up is called after sleep, no initialisation is needed.

void TrajSeg::truncate_in_t_range ( unsigned long  t0,
unsigned long  t1 
)

This function discards snapshots in the beginning and end of the segment, so that TrajSeg pretends they don't exist for subsequent querries. It does not delete data in the files. Only ignores them.

bool TrajSeg::wake_up ( )

If initialisation was done before, wake_up simply opens the file handle to the data file and returns. If initialisation has never happened, init() is called.


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