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

src/ell/S_Explicit.hh

Go to the documentation of this file.
00001 #ifndef S_EXPLICIT_HH_
00002 #define S_EXPLICIT_HH_
00003 
00004 #include "ell/State.hh"
00005 #include "ell/IterableNeighbors.hh"
00006 
00007 #include <biu/Alphabet.hh>
00008 #include <biu/Graph_UD.hh>
00009 
00010 namespace ell
00011 {
00012     
00016     class S_Explicit : public State, public IterableNeighbors
00017     {
00018     public:
00019         
00023         class LandscapeGraph;
00024         
00025         
00027         static const std::string ID;
00028         
00029     protected:
00030         
00032         const LandscapeGraph * lg;
00033         
00035         size_t nodeIndex;
00036         
00038         static const biu::Alphabet numberAlph;
00039         
00041         size_t sRepLength;
00042         
00043     public:
00051         S_Explicit( const LandscapeGraph* lg
00052                     , const size_t nodeIndex );
00053         
00055         virtual ~S_Explicit();
00056         
00058         
00064         virtual const std::string& getID( void ) const;
00065     
00066         virtual bool            operator== (const State& state2) const;
00067         virtual bool            operator!= (const State& state2) const;
00068         
00084         virtual bool            operator< (const State& state2) const;
00085 
00098         static
00099         bool less(const State* s1, const State* s2);
00100         
00102         virtual double      getEnergy() const;
00103         
00108         virtual unsigned int    getMinimalDistance(const State& state2) const;
00109         
00117         virtual S_Explicit* clone( State* toFill = NULL) const;
00118         
00121         virtual State* fromString(const std::string& stringRep) const;
00122         
00126         virtual std::string toString() const;
00127 
00133         virtual std::string& toString( std::string & toFill ) const;
00134 
00135         // neighborhood
00139         virtual NeighborListPtr getNeighborList() const;
00140 
00145         virtual NeighborListPtr getRandomNeighborList() const;
00146 
00150         virtual State* getRandomNeighbor(State* inPlaceNeigh = NULL) const;
00151         
00153         
00157         virtual CSequence compress(void) const;
00158         
00164         virtual CSequence& compress(CSequence& toFill) const;
00165         
00174         virtual State* uncompress(const CSequence& cseq, State* toFill ) const;
00175         
00181         virtual State* uncompress(const CSequence& cseq);
00182         
00183         
00185         
00188         virtual 
00189         size_t 
00190         getNeighborNumber(void) const;
00191         
00198         virtual 
00199         State* 
00200         getNeighbor(const size_t index, State* neigh) const;
00201         
00210         virtual 
00211         State* 
00212         undoNeighborChange(const size_t index, State* const neigh) const;
00213         
00221         virtual 
00222         State* 
00223         applyNeighborChange(const size_t index, State* const copy) const;
00224 
00225     };
00226     
00227     
00228     
00229     
00230     
00234     class S_Explicit::LandscapeGraph : public biu::Graph_UD
00235     {
00236     protected:
00238         std::vector<double> nodeEnergy;
00239         
00240     public:
00242         LandscapeGraph( );
00243         
00245         ~LandscapeGraph();
00246         
00250         size_t
00251         addNode( const double energy );
00252         
00256         double
00257         getNodeEnergy( const size_t nodeIndex ) const;
00258         
00259     };
00260 
00261 } // namespace ell
00262 
00263 #endif /*S_EXPLICIT_HH_*/