prf::Observable Class Reference
[Measurements]

An observable is in principle anything that is named and has a value. More...

#include <Observable.hh>

Inherits prf::Named.

Inherited by ContactOrder, prf::AtomDistance, prf::Chi, prf::ContactMap, prf::Energy, prf::MCTotEnergy, prf::NativenessQ, prf::OligoOrient, prf::ProteinRMSD, prf::RC_phi, prf::RC_psi, prf::RCAngleRMSD, prf::RCBin, and prf::Rg.

Inheritance diagram for prf::Observable:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void set (std::string cmd)
 Give the object an instruction to process during initialization.
virtual int init_obs ()
 All observables must implement one initialize routine.
virtual void refresh (int tindx=0)
 Necessary before an observable value is used.
virtual void rangeEstimate (double &x1, double &x2)
 Estimate a range in which values of this observable are expected.
double operator() ()
 Retrieve the value of the observable.
double Value ()
 Retrieve the value of the observable.

Detailed Description

Common interface for a variety of "observables". In PROFASI, an Observable is simply anything that has a name and a value. All kinds of energies, RMSD, secondary structure content ... may fall in this category. While the method by which each individual observable is calculated may vary, as well as its role in the program as a whole, for an outside analysis, such details often don't matter. So, it is often desired to make an array of observables and do one common operation on them. This would not be possible if, for instance, Energy and ProteinRMSD were incompatible types. But since both inherit from this observable class, they are compatible classes as far as the properties defined here are concerned. If you wish to implement a new observable and use it like other Observables of PROFASI, just inherit from this class, and make sure you implement a refresh() function. The refresh function should calculate the value and assign it to a member variable called obsval. Sometimes, the value would be calculated in some other context. But nevertheless, it is necessary to implement this refresh function, even if all it does is to assign the already calculated value to obsval.


Member Function Documentation

int Observable::init_obs (  )  [virtual]

Even if it seems that one particular observable might need additional arguments during initialization, it is advantageous to have a uniform syntax for all of them. So, when additional arguments are needed, one should provide them in a separate function called before initialization, and then call init_obs without arguments. The name init_obs instead of a more natural "init" or "initialize" is because an Observable often inherits from other classes which represent its character more fundamentally. So, the names such as "init" are kept free for such base classes.

Reimplemented in prf::AtomDistance, prf::ContactMap, ContactOrder, prf::NativenessQ, prf::OligoOrient, prf::ProteinRMSD, prf::RCAngleRMSD, prf::Rg, and prf::RCBin.

void Observable::refresh ( int  tindx = 0  )  [virtual]

This is done because complex observables like RMSD are not evaluated at every step. A call to refresh() would make sure that the Observable has its most current value. The optional argument tindx was introduced in version 1.1 when management of histograms was relocated from ObsHandler class to the Observable class. The argument tells the Observable object about a "temperature index" which it can use to put the current data in the appropriate histogram block.

Reimplemented in prf::MCTotEnergy, prf::Energy, prf::AtomDistance, prf::ContactMap, ContactOrder, prf::NativenessQ, prf::OligoOrient, prf::ProteinRMSD, prf::RCAngleRMSD, prf::Rg, and prf::RCBin.

void Observable::rangeEstimate ( double &  x1,
double &  x2 
) [virtual]

The default is between 0 and 1. So, for observables with values always between 0 and 1, you need not over-write this virtual function. Sometimes the observable will have a different fixed range, determined by its definition. Sometimes the range can not be determined perfectly. In such a case, let this function just return something reasonable.

Reimplemented in prf::MCTotEnergy, prf::Bias, prf::Energy, prf::ExVol, prf::HBMM, prf::HBMS, prf::Hydrophobicity, prf::LocExVol, prf::AtomDistance, prf::ContactMap, ContactOrder, prf::OligoOrient, prf::RC_phi, prf::RC_psi, prf::Chi, prf::ProteinRMSD, prf::RCAngleRMSD, prf::Rg, and prf::RCBin.


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

PROFASI: Protein Folding and Aggregation Simulator, Version 1.1
© (2005-2008) Anders Irbäck and Sandipan Mohanty
Documentation generated on 10 Oct 2008 using Doxygen version 1.5.0