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

ell::S_Explicit Class Reference

#include <S_Explicit.hh>

Inheritance diagram for ell::S_Explicit:

Inheritance graph
[legend]

Detailed Description

An explicit energy landscape representation using a graph representation as the underlying data structure.

Definition at line 16 of file S_Explicit.hh.

Public Types

typedef biu::VirtualList<
State
NeighborList
typedef std::auto_ptr< NeighborListNeighborListPtr

Public Member Functions

virtual StateapplyNeighborChange (const size_t index, State *const copy) const
virtual S_Explicitclone (State *toFill=NULL) const
virtual CSequencecompress (CSequence &toFill) const
virtual CSequence compress (void) const
virtual StatefromString (const std::string &stringRep) const
virtual double getEnergy () const
virtual const std::string & getID (void) const
virtual unsigned int getMinimalDistance (const State &state2) const
virtual StategetNeighbor (const size_t index, State *neigh) const
virtual NeighborListPtr getNeighborList () const
virtual size_t getNeighborNumber (void) const
virtual StategetRandomNeighbor (State *inPlaceNeigh=NULL) const
virtual NeighborListPtr getRandomNeighborList () const
virtual bool operator!= (const State &state2) const
virtual bool operator< (const State &state2) const
virtual bool operator== (const State &state2) const
 S_Explicit (const LandscapeGraph *lg, const size_t nodeIndex)
virtual std::string & toString (std::string &toFill) const
virtual std::string toString () const
virtual Stateuncompress (const CSequence &cseq)
virtual Stateuncompress (const CSequence &cseq, State *toFill) const
virtual StateundoNeighborChange (const size_t index, State *const neigh) const
virtual ~S_Explicit ()

Static Public Member Functions

static bool less (const State *s1, const State *s2)

Static Public Attributes

static const std::string ID

Protected Attributes

const LandscapeGraphlg
size_t nodeIndex
size_t sRepLength

Static Protected Attributes

static const biu::Alphabet numberAlph

Data Structures

class  LandscapeGraph


Member Typedef Documentation

typedef biu::VirtualList<State> ell::State::NeighborList [inherited]

Virtual list of neighbor states which can be accessed by a STL-like iterator.

Definition at line 44 of file State.hh.

typedef std::auto_ptr<NeighborList> ell::State::NeighborListPtr [inherited]

An autopointer to a NeighborList.

Definition at line 47 of file State.hh.


Constructor & Destructor Documentation

ell::S_Explicit::S_Explicit ( const LandscapeGraph lg,
const size_t  nodeIndex 
)

Constructs a state that represents the node of the given index of the explicite landscape representation. The neighbors of the node are defined by the adjacent nodes in the LandscapeGraph.

Parameters:
lg the landscape graph representing the energy landscape
nodeIndex the index of the node this state is representing

Definition at line 14 of file S_Explicit.cc.

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

Destruction.

Definition at line 29 of file S_Explicit.cc.


Member Function Documentation

State * ell::S_Explicit::applyNeighborChange ( const size_t  index,
State *const   copy 
) const [virtual]

Applies the necessary changes to a given state to get the neighbor. Note: @copy is expected to be a copy (i.e. *this == *copy) and therefore direct changes are possible and != NULL.

Parameters:
index the neighbor to generate
copy a copy of *this the changes should be applied to
Returns:
copy = the neighbor state of the given index or NULL if the index is out of range

Implements ell::IterableNeighbors.

Definition at line 356 of file S_Explicit.cc.

S_Explicit * ell::S_Explicit::clone ( State toFill = NULL  )  const [virtual]

Returns a pointer to a clone of the current state.

Parameters:
toFill a State to make a copy of this, or NULL if a new State should be created
Returns:
a pointer to a copy of this state, if toFill is != NULL the return value corresponds to the updated state pointed to by toFill, otherwise a new object is created !!!

Implements ell::State.

Definition at line 119 of file S_Explicit.cc.

CSequence & ell::S_Explicit::compress ( CSequence toFill  )  const [virtual]

Access to a compressed sequence representation of the state.

Parameters:
toFill a data structure to write the compressed representation too
Returns:
the compressed sequence representation

Implements ell::State.

Definition at line 232 of file S_Explicit.cc.

CSequence ell::S_Explicit::compress ( void   )  const [virtual]

Access to a compressed sequence representation of the state.

Returns:
the compressed sequence representation

Implements ell::State.

Definition at line 220 of file S_Explicit.cc.

State * ell::S_Explicit::fromString ( const std::string &  stringRep  )  const [virtual]

Returns a new State based on the current state. The new state differs only by the information given by stringRep.

Implements ell::State.

Definition at line 141 of file S_Explicit.cc.

double ell::S_Explicit::getEnergy (  )  const [virtual]

Returns the state specific energy.

Implements ell::State.

Definition at line 98 of file S_Explicit.cc.

const std::string & ell::S_Explicit::getID ( void   )  const [virtual]

Access to a State subclass specific ID string to identify instances of this class.

Returns:
the subclass specific ID string

Implements ell::State.

Definition at line 34 of file S_Explicit.cc.

unsigned int ell::S_Explicit::getMinimalDistance ( const State state2  )  const [virtual]

Returns the minimal number of steps via valid neighbored states from this to another valid State.

Parameters:
state2 the State to reach

Implements ell::State.

Definition at line 110 of file S_Explicit.cc.

State * ell::S_Explicit::getNeighbor ( const size_t  index,
State neigh 
) const [virtual]

Access to a specific neighbor.

Parameters:
index the index of the neighbor in [0, getNeighborNumber())
neigh if != NULL this state should be converted into the neighbor otherwise a new one is created and returned
Returns:
the new neighbor state or NULL if the index is >= getNeighborNumber()

Implements ell::IterableNeighbors.

Definition at line 300 of file S_Explicit.cc.

State::NeighborListPtr ell::S_Explicit::getNeighborList (  )  const [virtual]

Returns a virtual list of all VALID neighbored states in the energy landscape in a specific order.

Implements ell::State.

Definition at line 186 of file S_Explicit.cc.

size_t ell::S_Explicit::getNeighborNumber ( void   )  const [virtual]

How many neighbor indices are accessible.

Returns:
the number of neighbors

Implements ell::IterableNeighbors.

Definition at line 42 of file S_Explicit.cc.

State * ell::S_Explicit::getRandomNeighbor ( State inPlaceNeigh = NULL  )  const [virtual]

Returns a VALID random neighbored state. If a state is given, this is changed to a neighbor.

Implements ell::State.

Definition at line 205 of file S_Explicit.cc.

State::NeighborListPtr ell::S_Explicit::getRandomNeighborList (  )  const [virtual]

Returns a virtual list of all VALID neighbored states in the energy landscape in a random order. If a state is given, this is changed to a neighbor.

Implements ell::State.

Definition at line 196 of file S_Explicit.cc.

static bool ell::S_Explicit::less ( const State s1,
const State s2 
) [static]

Comparison function that compares two State pointer based on the less than operator '<' of the first State. The function can be used in STL algorithms, e.g. if only State pointer are stored but the ordering should be based on the object order.

Parameters:
s1 the State pointer of the object that is asked to be smaller (!=NULL)
s2 the State pointer of the object that is asked to be bigger (!=NULL)
Returns:
s1->operator <(*s1);

Reimplemented from ell::State.

bool ell::S_Explicit::operator!= ( const State state2  )  const [virtual]

Implements ell::State.

Definition at line 58 of file S_Explicit.cc.

bool ell::S_Explicit::operator< ( const State state2  )  const [virtual]

Implements a unique order on states based on their energy and string representation. A state is smaller than another one iff it has smaller energy or it has equal energy and a lexicographically smaller string representation (tie breaker).

This function will be overwritten to achive a better performance than calling getEnergy() and getString().

If the energy function is non-degenerate the string comparison is obsolete.

Parameters:
state2 the State object to compare to
Returns:
true if this state is smaller than state2 according to the unique order of the states

Reimplemented from ell::State.

Definition at line 83 of file S_Explicit.cc.

bool ell::S_Explicit::operator== ( const State state2  )  const [virtual]

Implements ell::State.

Definition at line 49 of file S_Explicit.cc.

std::string & ell::S_Explicit::toString ( std::string &  toFill  )  const [virtual]

Fill the given string with a specific std::string representation of this State.

Parameters:
toFill the string to overwrite
Returns:
the changed toFill in parameter

Implements ell::State.

Definition at line 172 of file S_Explicit.cc.

std::string ell::S_Explicit::toString (  )  const [virtual]

Returns a specific std::string representation of this State.

Implements ell::State.

Definition at line 157 of file S_Explicit.cc.

State * ell::S_Explicit::uncompress ( const CSequence cseq  )  [virtual]

Uncompresses a compressed sequencce representation into a this State object.

Parameters:
cseq the compressed sequence representation of a state
Returns:
this or NULL in error case

Implements ell::State.

Definition at line 275 of file S_Explicit.cc.

State * ell::S_Explicit::uncompress ( const CSequence cseq,
State toFill 
) const [virtual]

Uncompresses a compressed sequencce representation into a new State object.

Parameters:
cseq the compressed sequence representation of a state
toFill a state object to uncompress too or NULL if a new object has to be created
Returns:
new State object that is encoded in cseq or NULL in error case.

Implements ell::State.

Definition at line 248 of file S_Explicit.cc.

State * ell::S_Explicit::undoNeighborChange ( const size_t  index,
State *const   neigh 
) const [virtual]

Undo the changes done to this state to generate the given neighbor. The goal is to do less operations than doing a full copy like (*neigh = *this).

Parameters:
index the neighbor index that was applied last [ 0, getNeighborNumber() )
neigh the state resulting from the last changes
Returns:
the copy of this object via undoing the last changes in neigh or NULL if neigh == NULL

Implements ell::IterableNeighbors.

Definition at line 333 of file S_Explicit.cc.


Field Documentation

const std::string ell::S_Explicit::ID [static]

the specific ID string of this class

Definition at line 23 of file S_Explicit.hh.

const LandscapeGraph* ell::S_Explicit::lg [protected]

the landscape graph representing the energy landscape

Definition at line 32 of file S_Explicit.hh.

size_t ell::S_Explicit::nodeIndex [protected]

the index of the node this state is representing

Definition at line 35 of file S_Explicit.hh.

const biu::Alphabet ell::S_Explicit::numberAlph [static, protected]

alphabet to compress and decompress a number string

Definition at line 38 of file S_Explicit.hh.

size_t ell::S_Explicit::sRepLength [protected]

length of all string representations of states of this landscape.

Definition at line 41 of file S_Explicit.hh.


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