Generated on Tue Dec 16 13:34:49 2008 for ell-3.0.0 by doxygen 1.5.1

ell::LT_AutoFlood Class Reference

#include <LT_AutoFlood.hh>

Inheritance diagram for ell::LT_AutoFlood:

Inheritance graph
[legend]

Detailed Description

An instance of this class wrappes another LandscapeTopology.

For each added minimum it floods the corresponding gradient basin up to a given maximal energy relative to the minimum's energy.

The minimal saddle found (if any) is used to perform a gradient walk into the neighbored basin to identify the local minimum that is reachable via this lowest barrier. If the neighbored minimum has LOWER energy (is smaller according to State::less operator) than the current one, the detected saddle between the minima is added. If the minimum is not already part of the topology it is added before.

NOTE: This is a recursive scheme if the identified neighbored minimum to add is not already part of the topology. The recursion ends if (a) no saddle is found within the energy threshold or (b) the neighbored minimum reachable via the lowest saddle is known or not smaller according to the State::less operator.

Author:
Martin Mann

Definition at line 35 of file LT_AutoFlood.hh.

Public Types

typedef std::map< int, size_t > Int2SizeT_MAP

Public Member Functions

virtual const size_t addMin (const State *const m)
virtual bool addSaddle (const State *const m_i, const State *const m_j, const State *const s)
virtual bool addSaddle (const size_t i, const size_t j, const State *const s)
virtual void clear ()
virtual double getDistance (const LandscapeTopology *const lt) const
virtual const State *const getMFEState () const
virtual const State *const getMin (size_t i) const
virtual const size_t getMinCount () const
virtual const size_t getMinIndex (const State *const m) const
virtual bool isSorted () const
 LT_AutoFlood (LandscapeTopology *lt, const double floodMaxHeight, const double floodDeltaE, const size_t floodMaxToStore, const bool deleteLT=false)
virtual std::pair< int, std::string > read (std::istream &in, const State *const templateState)
virtual void sort ()
virtual void write (std::ostream &out, const bool writeGraph=false) const
virtual ~LT_AutoFlood ()

Static Public Member Functions

static std::pair< int, std::string > parseBarrier (LandscapeTopology &toFill, const std::string &line, const State *const templateState, const Int2SizeT_MAP &idx2min)
static std::pair< int, std::string > parseHeader (const std::string &line, std::string &LT_ID, size_t &minNumber, std::string &StateDescription)
static std::pair< int, std::string > parseMinimum (LandscapeTopology &toFill, const std::string &line, const State *const templateState, Int2SizeT_MAP &idx2min)
static std::pair< int, std::string > parseSaddle (LandscapeTopology &toFill, const std::string &line, const State *const templateState, const Int2SizeT_MAP &idx2min)
static void writeBarrier (std::ostream &out, const State *const barrier, const size_t index, const std::vector< size_t > &minConnected)
static void writeHeader (std::ostream &out, const std::string &LT_ID, const size_t minNumber, const std::string &StateDescription)
static void writeMinimum (std::ostream &out, const std::vector< const State * > &minima, const size_t index)
static void writeMinimum (std::ostream &out, const State *const minimum, const size_t index)
static void writeSaddle (std::ostream &out, const State *const saddle, const size_t index, const std::vector< size_t > &minConnected)

Static Public Attributes

static const double AVOGADRO_CONSTANT_NA
static const double BOLTZMANN_CONSTANT_KB
static double BOLTZMANN_KT
static const double GAS_CONSTANT_R
static const size_t INVALID_INDEX
static double MISSING_MINIMUM_PENALTY

Static Protected Member Functions

static double getSortedMinimaDistance (const std::vector< const State * > &m1, const std::vector< const State * > &m2)
static std::pair< State *,
std::string > 
parseConnection (const std::string &line, const State *const templateState, const Int2SizeT_MAP &idx2min, const std::string &connectionKey, std::vector< size_t > &connectedMinima)
static void writeConnection (std::ostream &out, const State *const connectionState, const size_t index, const std::vector< size_t > &minConnected, const std::string &connectionKey)

Protected Attributes

const bool deleteLT
const double floodDeltaE
const size_t floodMaxToStore
LandscapeTopologylt
double maxFloodHeight

Static Protected Attributes

static const std::string OUTPUT_KEY_BARRIER
static const std::string OUTPUT_KEY_ELL_HEAD
static const std::string OUTPUT_KEY_MINIMUM
static const std::string OUTPUT_KEY_SADDLE


Member Typedef Documentation

typedef std::map< int, size_t > ell::LandscapeTopology::Int2SizeT_MAP [inherited]

Definition at line 30 of file LandscapeTopology.hh.


Constructor & Destructor Documentation

ell::LT_AutoFlood::LT_AutoFlood ( LandscapeTopology lt,
const double  floodMaxHeight,
const double  floodDeltaE,
const size_t  floodMaxToStore,
const bool  deleteLT = false 
)

Construction

Parameters:
lt the wrapped landscape topology
floodMaxHeight the relative maximal energy height to flood above each minimum added
floodDeltaE the delta E to lower maxE in case too many states are in the queue during flooding (see Basin_F class)
floodMaxToStore the maximal number of elements to store in the queue during flooding (see Basin_F class)
deleteLT whether or not the lt should be deleted when life cycle of this object ends

virtual ell::LT_AutoFlood::~LT_AutoFlood (  )  [virtual]


Member Function Documentation

virtual const size_t ell::LT_AutoFlood::addMin ( const State *const  m  )  [virtual]

Adds an UNKNOWN minimum to the wrapped topology.

FURTHERMORE : the basin of the minimum is flooded up to a given maximal energy and the lowest saddle below that is identified. If existing the neighbored minimum is calculated using a gradient walk and the detected saddle between the minima is added. If the neighbored minimum was not part of the topology a recursive call of addMin(neighMin) is done before addSaddle is called.

Parameters:
m the minimum to add
Returns:
the index of the minimum in the landscape

Implements ell::LandscapeTopology.

virtual bool ell::LT_AutoFlood::addSaddle ( const State *const  m_i,
const State *const  m_j,
const State *const  s 
) [virtual]

Sets a saddle point that connects two minima

Parameters:
m_i the first minimum to connect
m_j the second minimum to connect
s the State representating the saddle point
Returns:
whether or not the data structure has been changed

Implements ell::LandscapeTopology.

virtual bool ell::LT_AutoFlood::addSaddle ( const size_t  i,
const size_t  j,
const State *const  s 
) [virtual]

Sets a saddle point that connects two minima

Parameters:
i index of the first minimum to connect
j index of the second minimum to connect
s the State representating the saddle point
Returns:
whether or not the data structure has been changed

Implements ell::LandscapeTopology.

virtual void ell::LT_AutoFlood::clear (  )  [virtual]

Clears the wrapped topology to be filled again afterwards.

Implements ell::LandscapeTopology.

virtual double ell::LT_AutoFlood::getDistance ( const LandscapeTopology *const  lt  )  const [virtual]

Calculates the relative 'distance' between landscape topologies.

Parameters:
lt the landscape topology to calculate the distance to
Returns:
the distance

Reimplemented from ell::LandscapeTopology.

virtual const State* const ell::LT_AutoFlood::getMFEState (  )  const [virtual]

Access to the global minimum of the wrapped landscape with minimal energy.

Returns:
the minimum with smallest energy (and smallest string representation for tiebreaking)

Implements ell::LandscapeTopology.

virtual const State* const ell::LT_AutoFlood::getMin ( size_t  i  )  const [virtual]

Access to a minimum.

Parameters:
i index of the minimum to access
Returns:
the State with the specified minimum index

Implements ell::LandscapeTopology.

virtual const size_t ell::LT_AutoFlood::getMinCount (  )  const [virtual]

Access to the number of stored minima.

Returns:
the number of minima

Implements ell::LandscapeTopology.

virtual const size_t ell::LT_AutoFlood::getMinIndex ( const State *const  m  )  const [virtual]

Access to the minimum index.

Parameters:
m the minimum of that the index should be accessed
Returns:
the index of the minimum, or INVALID_INDEX if 'm' is no known minimum

Implements ell::LandscapeTopology.

double ell::LandscapeTopology::getSortedMinimaDistance ( const std::vector< const State * > &  m1,
const std::vector< const State * > &  m2 
) [static, protected, inherited]

Definition at line 121 of file LandscapeTopology.cc.

virtual bool ell::LT_AutoFlood::isSorted (  )  const [virtual]

Check if the minima of the wrapped landscape are sorted ascendingly by the State::less operator.

Implements ell::LandscapeTopology.

std::pair< int, std::string > ell::LandscapeTopology::parseBarrier ( LandscapeTopology toFill,
const std::string &  line,
const State *const  templateState,
const Int2SizeT_MAP idx2min 
) [static, inherited]

Parses a barrier string encoding produced by 'writeBarrier' method and adds the encoded BARRIER as a SADDLE to the topology given.

Parameters:
toFill the landscape topology to add the barrier to
line the string that encodes the barrier (encoding follows 'write' method)
templateState the State template to create new State objects via its 'fromString' function
idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
Returns:
an error encoding and an error string : 0 = no error occured, read was successfull -3 = read error (see error string)

Definition at line 458 of file LandscapeTopology.cc.

std::pair< State *, std::string > ell::LandscapeTopology::parseConnection ( const std::string &  line,
const State *const  templateState,
const Int2SizeT_MAP idx2min,
const std::string &  connectionKey,
std::vector< size_t > &  connectedMinima 
) [static, protected, inherited]

Parses a string encoding of a minima connection of a topology produced by 'writeBarrier' method and returns the connection state and the list of minima connected.

Parameters:
line the string that encodes the connection (encoding follows 'write' method)
templateState the State template to create new State objects via its 'fromString' function
idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
connectionKey the key used to encode the connection
connectedMinima OUTPUT parameter where the indices of the connected minima of the parsed connection are stored to
Returns:
a the parsed connection State and an error string if an error occured and the State is NULL

Definition at line 533 of file LandscapeTopology.cc.

std::pair< int, std::string > ell::LandscapeTopology::parseHeader ( const std::string &  line,
std::string &  LT_ID,
size_t &  minNumber,
std::string &  StateDescription 
) [static, inherited]

Parses the descriptive header of a landscape topology produced by 'writeHeader' method.

Parameters:
line the string that encodes the header information (encoding follows 'write' method)
LT_ID the ID string of the topology in stream
minNumber the number of minima the topology in stream holds, if minima are grouped in the topology the number of groups is given.
StateDescription a string description of the State model represented by the topology in the stream
Returns:
an error encoding and an error string : 0 = no error occured, read was successfull, the string contains the remaining line content, -3 = read error (see error string)

Definition at line 204 of file LandscapeTopology.cc.

std::pair< int, std::string > ell::LandscapeTopology::parseMinimum ( LandscapeTopology toFill,
const std::string &  line,
const State *const  templateState,
Int2SizeT_MAP idx2min 
) [static, inherited]

Parses a minimum string encoding produced by 'writeMinimum' method and adds the encoded minimum state to the given topology. Furthermore, it returns the remaining line content that can contain further minima that were merged with the first (already added) 'main' minimum. Thus a further parsing can be done later if necessary.

Parameters:
toFill the barrier tree to add the barrier to
line the string that encodes the minimum (encoding follows 'write' method)
templateState the State template to create new State objects via its 'fromString' function
idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
Returns:
an error encoding and an error string : 0 = no error occured, read was successfull, the string contains the remaining line content, -3 = read error (see error string)

Definition at line 315 of file LandscapeTopology.cc.

std::pair< int, std::string > ell::LandscapeTopology::parseSaddle ( LandscapeTopology toFill,
const std::string &  line,
const State *const  templateState,
const Int2SizeT_MAP idx2min 
) [static, inherited]

Parses a saddle string encoding produced by 'writeBarrier' method and adds the encoded direct saddle to the topology given.

Parameters:
toFill the landscape topology to add the saddle to
line the string that encodes the saddle (encoding follows 'write' method)
templateState the State template to create new State objects via its 'fromString' function
idx2min the mapping of minima indices in the string to the indices in the given landscape topology 'toFill'
Returns:
an error encoding and an error string : 0 = no error occured, read was successfull -3 = read error (see error string)

Definition at line 494 of file LandscapeTopology.cc.

virtual std::pair<int,std::string> ell::LT_AutoFlood::read ( std::istream &  in,
const State *const  templateState 
) [virtual]

Fills wrapped the landscape topology from stream.

Parameters:
in the input stream to read from.
templateState the State template to create new State objects via its 'fromString' function
Returns:
an error encoding and an error string : 0 = no error occured, read was successfull -1 = landscape topology type not supported -2 = state description differs from the given one -3 = other read errors

Implements ell::LandscapeTopology.

virtual void ell::LT_AutoFlood::sort (  )  [virtual]

Sorts the wrapped minima ascending by their energy (mfe minimum gets index 0) using the State::less operator.

Implements ell::LandscapeTopology.

virtual void ell::LT_AutoFlood::write ( std::ostream &  out,
const bool  writeGraph = false 
) const [virtual]

Writes the wrapped landscape topology to stream.

Parameters:
out the output stream to write to.
writeGraph whether or not the output should contain a graph representation of the topology in graphviz DOT format

Implements ell::LandscapeTopology.

void ell::LandscapeTopology::writeBarrier ( std::ostream &  out,
const State *const  barrier,
const size_t  index,
const std::vector< size_t > &  minConnected 
) [static, inherited]

Writes a barrier of a landscape topology to stream.

Parameters:
out the output stream to write to.
barrier the barrier to add
index the index of the barrier
minConnected the minima connected by the barrier

Definition at line 398 of file LandscapeTopology.cc.

void ell::LandscapeTopology::writeConnection ( std::ostream &  out,
const State *const  connectionState,
const size_t  index,
const std::vector< size_t > &  minConnected,
const std::string &  connectionKey 
) [static, protected, inherited]

Writes a minima connection of a landscape topology to stream.

Parameters:
out the output stream to write to.
connectionState the State representing the connection
index the index of the connection
minConnected the minima connected
connectionKey the key used to encode the connection

Definition at line 430 of file LandscapeTopology.cc.

void ell::LandscapeTopology::writeHeader ( std::ostream &  out,
const std::string &  LT_ID,
const size_t  minNumber,
const std::string &  StateDescription 
) [static, inherited]

Writes the descriptive header of a landscape topology to stream.

Parameters:
out the output stream to write to.
LT_ID the ID string of the topology to write
minNumber the number of minima the topology holds, if minima are grouped in the topology the number of groups has to be given.
StateDescription a string description of the State model represented by the topology

Definition at line 188 of file LandscapeTopology.cc.

void ell::LandscapeTopology::writeMinimum ( std::ostream &  out,
const std::vector< const State * > &  minima,
const size_t  index 
) [static, inherited]

Writes a group of minima of a landscape topology to stream. NOTE: The FIRST minimum is the only one read by the read function and thus the representative for the whole group!

Parameters:
out the output stream to write to.
minima the minima to add
index the index of the minimum

Definition at line 296 of file LandscapeTopology.cc.

void ell::LandscapeTopology::writeMinimum ( std::ostream &  out,
const State *const  minimum,
const size_t  index 
) [static, inherited]

Writes a minimum of a landscape topology to stream.

Parameters:
out the output stream to write to.
minimum the minimum to add
index the index of the minimum

Definition at line 280 of file LandscapeTopology.cc.

void ell::LandscapeTopology::writeSaddle ( std::ostream &  out,
const State *const  saddle,
const size_t  index,
const std::vector< size_t > &  minConnected 
) [static, inherited]

Writes a saddle of a landscape topology to stream.

Parameters:
out the output stream to write to.
saddle the saddle to write
index the index of the saddle
minConnected the minima connected by the saddle

Definition at line 414 of file LandscapeTopology.cc.


Field Documentation

const double ell::LandscapeTopology::AVOGADRO_CONSTANT_NA [static, inherited]

Avogadro constant N_A = 6.02214179 * 10^(23) unit : 1/mol

Definition at line 41 of file LandscapeTopology.hh.

const double ell::LandscapeTopology::BOLTZMANN_CONSTANT_KB [static, inherited]

Boltzmann constant K_b = R / N_A = 1.3806504 * 10^(-23) unit : Joule / Kelvin

Definition at line 47 of file LandscapeTopology.hh.

double ell::LandscapeTopology::BOLTZMANN_KT [static, inherited]

The kT value used to calculate the Boltzmann weight e^(-E/kT) of a state in the landscape with an energy of E. NOTE: Has to be set according to the used energy function !!!

Definition at line 54 of file LandscapeTopology.hh.

const bool ell::LT_AutoFlood::deleteLT [protected]

whether or not the lt should be deleted when life cycle of this object ends

Definition at line 55 of file LT_AutoFlood.hh.

const double ell::LT_AutoFlood::floodDeltaE [protected]

the delta E to lower maxE in case too many states are in the queue during flooding (see Basin_F class)

Definition at line 48 of file LT_AutoFlood.hh.

const size_t ell::LT_AutoFlood::floodMaxToStore [protected]

the maximal number of elements to store in the queue during flooding (see Basin_F class)

Definition at line 51 of file LT_AutoFlood.hh.

const double ell::LandscapeTopology::GAS_CONSTANT_R [static, inherited]

Gas constant R = 8.314472 unit : Joule / (Kelvin * mol)

Definition at line 44 of file LandscapeTopology.hh.

const size_t ell::LandscapeTopology::INVALID_INDEX [static, inherited]

Index value that is used to propagate the information about invalid indexing.

Definition at line 37 of file LandscapeTopology.hh.

the wrapped landscape topology

Definition at line 40 of file LT_AutoFlood.hh.

the maximal energy height to flood according to the minimum started from

Definition at line 44 of file LT_AutoFlood.hh.

The penalty used to score a missing minimum when comparing two landscape topologies using the 'getDistance' method. NOTE: Has to be set according to the used energy function and the weighting of missing minima in the distance score. If missing minima are of no relevance set this value to 0.0!

Definition at line 61 of file LandscapeTopology.hh.

const std::string ell::LandscapeTopology::OUTPUT_KEY_BARRIER [static, protected, inherited]

keyword used by the read and write method to identify information on a barrier

Definition at line 347 of file LandscapeTopology.hh.

const std::string ell::LandscapeTopology::OUTPUT_KEY_ELL_HEAD [static, protected, inherited]

keyword used by the read and write method to identify information on the landscape topology type etc.

Definition at line 341 of file LandscapeTopology.hh.

const std::string ell::LandscapeTopology::OUTPUT_KEY_MINIMUM [static, protected, inherited]

keyword used by the read and write method to identify information on a minimum

Definition at line 344 of file LandscapeTopology.hh.

const std::string ell::LandscapeTopology::OUTPUT_KEY_SADDLE [static, protected, inherited]

keyword used by the read and write method to identify information on a saddle point

Definition at line 350 of file LandscapeTopology.hh.


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