Rosetta
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Attributes | Private Types | Private Attributes | Static Private Attributes | List of all members
protocols::jd2::archive::ArchiveBase Class Referenceabstract

#include <ArchiveBase.hh>

Inheritance diagram for protocols::jd2::archive::ArchiveBase:
Inheritance graph
[legend]

Public Member Functions

 ArchiveBase (ArchiveManagerAP ptr=nullptr)
 
 ~ArchiveBase () override
 
bool finished () const override
 is archive converged ? More...
 
void initialize () override
 
void generate_batch () override=0
 create a new batch with manager().start_new_batch() and manager().finalize_batch(); More...
 
virtual bool add_structure (core::io::silent::SilentStructOP new_decoy, core::io::silent::SilentStructOP alternative_decoy, Batch const &)
 add structure to Archive.. return false if structure is rejected. More...
 
core::Size nstruct () const
 how many structures should be in archive .. varies from decoys().size() in startup phase. More...
 
void set_nstruct (core::Size set)
 set target size of pool More...
 
void save_to_file (std::string suffix="") override
 save and restore archive to file-system More...
 
void save_decoys (std::string const &dirname, std::string const &name, SilentStructs const &decoys)
 helper routine to save decoys properly More...
 
void load_decoys (std::string const &filename, SilentStructs &decoys)
 
bool restore_from_file () override
 restore archive More...
 
void save_status (std::ostream &) const override
 save and restore status of archive to file-system More...
 
virtual void restore_status (std::istream &)
 
void idle () override
 called when nothing is happening More...
 
void init_from_decoy_set (core::io::silent::SilentFileData const &sfd) override
 read externally provided structures from decoy_file into archive More...
 
void read_structures (core::io::silent::SilentFileData &, core::io::silent::SilentFileData &alternative_decoys, Batch const &batch) override
 SilentFileData contains the new structures belonging to this batch. More...
 
core::Sizeaccepts_since_last_batch ()
 
core::Size accepts_since_last_batch () const
 
core::Size proposed_since_last_batch () const
 
core::Real current_acceptance_ratio () const
 
void reset_accept_counter ()
 
core::Size total_proposed ()
 
core::Size total_accepts ()
 
bool statistics_valid ()
 
SilentStructs const & decoys () const
 
SilentStructsdecoys ()
 
- Public Member Functions inherited from protocols::jd2::archive::AbstractArchiveBase
 ~AbstractArchiveBase () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 AbstractArchiveBase (BaseArchiveManagerAP ptr)
 
 AbstractArchiveBase ()
 
virtual bool still_interested (jd2::archive::Batch const &) const
 old-batches might be outdated and should not be computed anymore return true for this query if this is the case for old_batch More...
 
virtual core::Size generate_batch (jd2::archive::Batch &, core::Size)
 create a batch for the current stage, return ct != 0 if more batches should be created at current stage. (e.g., harvest_batches) More...
 
void set_name (std::string const &set)
 set name of archive ( used also for save_to_file and restore_from_file ) More...
 
std::string const & name () const
 
BaseArchiveManagermanager ()
 access to the ArchiveManager (control of batches) More...
 
virtual void set_manager (BaseArchiveManagerAP manager)
 

Static Public Member Functions

static void register_options ()
 

Protected Types

typedef std::list< core::io::silent::SilentStructOPSilentStructs
 
typedef SilentStructs::const_iterator const_decoy_iterator
 
typedef SilentStructs::const_iterator decoy_iterator
 

Protected Member Functions

virtual void count_structure (Batch const &batch, bool accepted)
 count the structure for the acceptance statistics only count if not from expired batch More...
 
void count_removed_structures (core::Size n_removed)
 count the structure for the acceptance statistics only count if not from expired batch More...
 
void set_max_nstruct (core::Size setting)
 
core::Size max_nstruct ()
 
virtual void add_structure_at_position (SilentStructs::iterator iss, core::io::silent::SilentStructOP new_decoy, core::io::silent::SilentStructOP alternative_decoy)
 call to insert structure at position given by iterator More...
 
virtual void erase_decoy (std::string const &tag)
 
- Protected Member Functions inherited from protocols::jd2::archive::AbstractArchiveBase
BaseArchiveManagerAP manager_ptr ()
 

Static Protected Attributes

static std::string const TAG_IN_FILE
 
static std::string const SOURCE_FILE
 

Private Types

typedef std::deque< bool > AcceptHistoryQueue
 

Private Attributes

core::Size max_nstruct_
 
core::Size nstruct_
 
SilentStructs decoys_
 
core::Size accepts_since_last_batch_
 
core::Size total_accepts_
 
core::Size proposed_since_last_batch_
 
core::Size total_proposed_
 
AcceptHistoryQueue acceptance_history_
 
core::Real floating_acceptance_ratio_
 
core::Size min_structures_for_acceptance_statistics_
 

Static Private Attributes

static bool options_registered_
 

Member Typedef Documentation

◆ AcceptHistoryQueue

◆ const_decoy_iterator

typedef SilentStructs::const_iterator protocols::jd2::archive::ArchiveBase::const_decoy_iterator
protected

◆ decoy_iterator

typedef SilentStructs::const_iterator protocols::jd2::archive::ArchiveBase::decoy_iterator
protected

◆ SilentStructs

Constructor & Destructor Documentation

◆ ArchiveBase()

protocols::jd2::archive::ArchiveBase::ArchiveBase ( ArchiveManagerAP  ptr = nullptr)

◆ ~ArchiveBase()

protocols::jd2::archive::ArchiveBase::~ArchiveBase ( )
overridedefault

Member Function Documentation

◆ accepts_since_last_batch() [1/2]

core::Size& protocols::jd2::archive::ArchiveBase::accepts_since_last_batch ( )
inline

-— methods to keep statistics of acceptance

References accepts_since_last_batch_.

Referenced by count_removed_structures(), protocols::abinitio::IterativeBase::idle(), and total_accepts().

◆ accepts_since_last_batch() [2/2]

core::Size protocols::jd2::archive::ArchiveBase::accepts_since_last_batch ( ) const
inline

◆ add_structure()

bool protocols::jd2::archive::ArchiveBase::add_structure ( core::io::silent::SilentStructOP  new_decoy,
core::io::silent::SilentStructOP  alternative_decoy,
Batch const &   
)
virtual

add structure to Archive.. return false if structure is rejected.

Reimplemented in protocols::abinitio::IterativeBase, and protocols::jd2::archive::EvaluatedArchive.

References add_structure_at_position(), and decoys_.

Referenced by read_structures().

◆ add_structure_at_position()

void protocols::jd2::archive::ArchiveBase::add_structure_at_position ( SilentStructs::iterator  iss,
core::io::silent::SilentStructOP  new_decoy,
core::io::silent::SilentStructOP  alternative_decoy 
)
protectedvirtual

◆ count_removed_structures()

void protocols::jd2::archive::ArchiveBase::count_removed_structures ( core::Size  n_removed)
protected

count the structure for the acceptance statistics only count if not from expired batch

References acceptance_history_, accepts_since_last_batch(), decoys(), floating_acceptance_ratio_, min_structures_for_acceptance_statistics_, and nstruct_.

◆ count_structure()

void protocols::jd2::archive::ArchiveBase::count_structure ( Batch const &  batch,
bool  accepted 
)
protectedvirtual

◆ current_acceptance_ratio()

core::Real protocols::jd2::archive::ArchiveBase::current_acceptance_ratio ( ) const
inline

◆ decoys() [1/2]

SilentStructs& protocols::jd2::archive::ArchiveBase::decoys ( )
inline

References decoys_.

◆ decoys() [2/2]

SilentStructs const& protocols::jd2::archive::ArchiveBase::decoys ( ) const
inline

◆ erase_decoy()

void protocols::jd2::archive::ArchiveBase::erase_decoy ( std::string const &  tag)
protectedvirtual

◆ finished()

bool protocols::jd2::archive::ArchiveBase::finished ( ) const
inlineoverridevirtual

is archive converged ?

Implements protocols::jd2::archive::AbstractArchiveBase.

◆ generate_batch()

void protocols::jd2::archive::ArchiveBase::generate_batch ( )
overridepure virtual

◆ idle()

void protocols::jd2::archive::ArchiveBase::idle ( )
inlineoverridevirtual

called when nothing is happening

Implements protocols::jd2::archive::AbstractArchiveBase.

◆ init_from_decoy_set()

void protocols::jd2::archive::ArchiveBase::init_from_decoy_set ( core::io::silent::SilentFileData const &  sfd)
overridevirtual

◆ initialize()

void protocols::jd2::archive::ArchiveBase::initialize ( )
inlineoverridevirtual

◆ load_decoys()

void protocols::jd2::archive::ArchiveBase::load_decoys ( std::string const &  filename,
SilentStructs decoys 
)

◆ max_nstruct()

core::Size protocols::jd2::archive::ArchiveBase::max_nstruct ( )
inlineprotected

References max_nstruct_.

◆ nstruct()

core::Size protocols::jd2::archive::ArchiveBase::nstruct ( ) const
inline

◆ proposed_since_last_batch()

core::Size protocols::jd2::archive::ArchiveBase::proposed_since_last_batch ( ) const
inline

◆ read_structures()

void protocols::jd2::archive::ArchiveBase::read_structures ( core::io::silent::SilentFileData sfd,
core::io::silent::SilentFileData alternative_decoys,
Batch const &  batch 
)
overridevirtual

◆ register_options()

void protocols::jd2::archive::ArchiveBase::register_options ( )
static

◆ reset_accept_counter()

void protocols::jd2::archive::ArchiveBase::reset_accept_counter ( )
inline

◆ restore_from_file()

bool protocols::jd2::archive::ArchiveBase::restore_from_file ( )
overridevirtual

◆ restore_status()

void protocols::jd2::archive::ArchiveBase::restore_status ( std::istream &  is)
virtual

◆ save_decoys()

void protocols::jd2::archive::ArchiveBase::save_decoys ( std::string const &  dirname,
std::string const &  name,
SilentStructs const &  decoys 
)

◆ save_status()

void protocols::jd2::archive::ArchiveBase::save_status ( std::ostream &  os) const
overridevirtual

◆ save_to_file()

void protocols::jd2::archive::ArchiveBase::save_to_file ( std::string  suffix = "")
overridevirtual

◆ set_max_nstruct()

void protocols::jd2::archive::ArchiveBase::set_max_nstruct ( core::Size  setting)
inlineprotected

◆ set_nstruct()

void protocols::jd2::archive::ArchiveBase::set_nstruct ( core::Size  set)
inline

set target size of pool

References nstruct_.

◆ statistics_valid()

bool protocols::jd2::archive::ArchiveBase::statistics_valid ( )
inline

◆ total_accepts()

core::Size protocols::jd2::archive::ArchiveBase::total_accepts ( )
inline

◆ total_proposed()

core::Size protocols::jd2::archive::ArchiveBase::total_proposed ( )
inline

Member Data Documentation

◆ acceptance_history_

AcceptHistoryQueue protocols::jd2::archive::ArchiveBase::acceptance_history_
private

◆ accepts_since_last_batch_

core::Size protocols::jd2::archive::ArchiveBase::accepts_since_last_batch_
private

◆ decoys_

SilentStructs protocols::jd2::archive::ArchiveBase::decoys_
private

◆ floating_acceptance_ratio_

core::Real protocols::jd2::archive::ArchiveBase::floating_acceptance_ratio_
private

◆ max_nstruct_

core::Size protocols::jd2::archive::ArchiveBase::max_nstruct_
private

◆ min_structures_for_acceptance_statistics_

core::Size protocols::jd2::archive::ArchiveBase::min_structures_for_acceptance_statistics_
private

◆ nstruct_

core::Size protocols::jd2::archive::ArchiveBase::nstruct_
private

◆ options_registered_

bool protocols::jd2::archive::ArchiveBase::options_registered_
staticprivate

Referenced by ArchiveBase().

◆ proposed_since_last_batch_

core::Size protocols::jd2::archive::ArchiveBase::proposed_since_last_batch_
private

◆ SOURCE_FILE

std::string const protocols::jd2::archive::ArchiveBase::SOURCE_FILE
staticprotected

Referenced by read_structures().

◆ TAG_IN_FILE

std::string const protocols::jd2::archive::ArchiveBase::TAG_IN_FILE
staticprotected

Referenced by read_structures().

◆ total_accepts_

core::Size protocols::jd2::archive::ArchiveBase::total_accepts_
private

◆ total_proposed_

core::Size protocols::jd2::archive::ArchiveBase::total_proposed_
private

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